implement column resizing events in wxHeaderCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -359,11 +359,6 @@ private:
|
||||
m_sortAscending = true;
|
||||
}
|
||||
|
||||
// like SetWidth() but does not ask the header window of the
|
||||
// wxDataViewCtrl to reflect the width-change.
|
||||
void SetInternalWidth(int width);
|
||||
|
||||
|
||||
wxString m_title;
|
||||
int m_width,
|
||||
m_minWidth;
|
||||
@@ -482,8 +477,11 @@ public: // utility functions not part of the API
|
||||
// called by header window after reorder
|
||||
void ColumnMoved( wxDataViewColumn* col, unsigned int new_pos );
|
||||
|
||||
// updates the header window after a change in a column setting
|
||||
void OnColumnChange();
|
||||
// update the display after a change to an individual column
|
||||
void OnColumnChange(unsigned int idx);
|
||||
|
||||
// update after a change to the number of columns
|
||||
void OnColumnsCountChanged();
|
||||
|
||||
wxWindow *GetMainWindow() { return (wxWindow*) m_clientArea; }
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/overlay.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxHeaderCtrl
|
||||
@@ -64,6 +65,7 @@ private:
|
||||
// event handlers
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouse(wxMouseEvent& event);
|
||||
void OnCaptureLost(wxMouseCaptureLostEvent& event);
|
||||
|
||||
// return the horizontal start position of the given column
|
||||
int GetColStart(unsigned int idx) const;
|
||||
@@ -84,6 +86,17 @@ private:
|
||||
// column 1 but close enough to the divider separating it from column 0)
|
||||
int FindColumnAtPos(int x, bool& onSeparator) const;
|
||||
|
||||
// end any drag operation currently in progress (resizing or reordering)
|
||||
void EndDragging();
|
||||
|
||||
// and the resizing operation currently in progress and generate an event
|
||||
// about it with its cancelled flag set if width is -1
|
||||
void EndResizing(int width);
|
||||
|
||||
// update the current position of the resizing marker if xPhysical is a
|
||||
// valid physical coordinate value or remove it entirely if it is -1
|
||||
void UpdateResizingMarker(int xPhysical);
|
||||
|
||||
|
||||
// number of columns in the control currently
|
||||
unsigned int m_numColumns;
|
||||
@@ -91,9 +104,16 @@ private:
|
||||
// index of the column under mouse or -1 if none
|
||||
unsigned int m_hover;
|
||||
|
||||
// the column being resized or -1 if there is no resizing operation in
|
||||
// progress
|
||||
unsigned int m_colBeingResized;
|
||||
|
||||
// the horizontal scroll offset
|
||||
int m_scrollOffset;
|
||||
|
||||
// the overlay display used during the dragging operations
|
||||
wxOverlay m_overlay;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_NO_COPY_CLASS(wxHeaderCtrl)
|
||||
|
Reference in New Issue
Block a user