Make interface between wxGridHeaderCtrl and wxGrid more explicit
Rename the functions used from wxGridHeaderCtrl event handlers to start with DoHeader prefix to make it clear that they're (only) used by it in an attempt to make things more clear and more uniform. No real changes.
This commit is contained in:
@@ -2534,18 +2534,26 @@ private:
|
||||
|
||||
void DoColHeaderClick(int col);
|
||||
|
||||
void DoStartResizeCol(int col);
|
||||
void DoUpdateResizeColWidth(int w);
|
||||
void DoStartMoveCol(int col);
|
||||
|
||||
void DoEndDragResizeRow(const wxMouseEvent& event, wxGridWindow *gridWindow);
|
||||
void DoEndDragResizeCol(const wxMouseEvent& event, wxGridWindow *gridWindow);
|
||||
void DoEndDragResizeCol(const wxMouseEvent& event)
|
||||
{
|
||||
DoEndDragResizeCol(event, m_gridWin);
|
||||
}
|
||||
void DoEndMoveCol(int pos);
|
||||
|
||||
// Helper function returning the position (only the horizontal component
|
||||
// really counts) corresponding to the given column drag-resize event.
|
||||
//
|
||||
// It's a bit ugly to create a phantom mouse position when we really only
|
||||
// need the column width anyhow, but wxGrid code was originally written to
|
||||
// expect the position and not the width and it's simpler to keep it happy
|
||||
// by giving it the position than to change it.
|
||||
wxPoint GetPositionForResizeEvent(int width) const;
|
||||
|
||||
// functions called by wxGridHeaderCtrl while resizing m_dragRowOrCol
|
||||
void DoHeaderStartDragResizeCol(int col);
|
||||
void DoHeaderDragResizeCol(int width);
|
||||
void DoHeaderEndDragResizeCol(int width);
|
||||
|
||||
// process a TAB keypress
|
||||
void DoGridProcessTab(wxKeyboardState& kbdState);
|
||||
|
||||
|
@@ -252,24 +252,19 @@ private:
|
||||
|
||||
void OnBeginResize(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoStartResizeCol(event.GetColumn());
|
||||
GetOwner()->DoHeaderStartDragResizeCol(event.GetColumn());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void OnResizing(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoUpdateResizeColWidth(event.GetWidth());
|
||||
GetOwner()->DoHeaderDragResizeCol(event.GetWidth());
|
||||
}
|
||||
|
||||
void OnEndResize(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
// we again need to pass a mouse event to be used for the grid event
|
||||
// generation but we don't have it here so use a dummy one as in
|
||||
// UpdateColumnVisibility()
|
||||
wxMouseEvent e;
|
||||
e.SetState(wxGetMouseState());
|
||||
GetOwner()->DoEndDragResizeCol(e);
|
||||
GetOwner()->DoHeaderEndDragResizeCol(event.GetWidth());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
Reference in New Issue
Block a user