generate wxEVT_GRID_{COL,ROW}_SIZE events when the user double clicks the separating line too; do not generate these events if the size didn't really change (further improvements to grid events are possible and remain needed, see #10754)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1956,10 +1956,10 @@ protected:
|
||||
// it was processed (but not vetoed) and 0 if it wasn't processed
|
||||
int SendEvent(const wxEventType evtType,
|
||||
int row, int col,
|
||||
wxMouseEvent& e);
|
||||
const wxMouseEvent& e);
|
||||
int SendEvent(const wxEventType evtType,
|
||||
const wxGridCellCoords& coords,
|
||||
wxMouseEvent& e)
|
||||
const wxMouseEvent& e)
|
||||
{ return SendEvent(evtType, coords.GetRow(), coords.GetCol(), e); }
|
||||
int SendEvent(const wxEventType evtType,
|
||||
int row, int col,
|
||||
@@ -1971,6 +1971,11 @@ protected:
|
||||
int SendEvent(const wxEventType evtType, const wxString& s = wxString())
|
||||
{ return SendEvent(evtType, m_currentCellCoords, s); }
|
||||
|
||||
// send wxEVT_GRID_{ROW,COL}_SIZE
|
||||
void SendSizeEvent(wxEventType type,
|
||||
int row, int col,
|
||||
const wxMouseEvent& mouseEv);
|
||||
|
||||
void OnPaint( wxPaintEvent& );
|
||||
void OnSize( wxSizeEvent& );
|
||||
void OnKeyDown( wxKeyEvent& );
|
||||
@@ -2084,14 +2089,14 @@ private:
|
||||
void DoUpdateResizeColWidth(int w);
|
||||
void DoStartMoveCol(int col);
|
||||
|
||||
void DoEndDragResizeRow();
|
||||
void DoEndDragResizeCol(wxMouseEvent *event = NULL);
|
||||
void DoEndDragResizeRow(const wxMouseEvent& event);
|
||||
void DoEndDragResizeCol(const wxMouseEvent& event);
|
||||
void DoEndMoveCol(int pos);
|
||||
|
||||
|
||||
// common implementations of methods defined for both rows and columns
|
||||
void DeselectLine(int line, const wxGridOperations& oper);
|
||||
void DoEndDragResizeLine(const wxGridOperations& oper);
|
||||
bool DoEndDragResizeLine(const wxGridOperations& oper);
|
||||
int PosToLinePos(int pos, bool clipToMinMax,
|
||||
const wxGridOperations& oper) const;
|
||||
int PosToLine(int pos, bool clipToMinMax,
|
||||
|
@@ -195,7 +195,12 @@ private:
|
||||
|
||||
// as this is done by the user we should notify the main program about
|
||||
// it
|
||||
GetOwner()->SendEvent(wxEVT_GRID_COL_SIZE, -1, idx);
|
||||
|
||||
// make up a dummy event for the grid event to use -- unfortunately we
|
||||
// can't do anything else here
|
||||
wxMouseEvent e;
|
||||
e.SetState(wxGetMouseState());
|
||||
GetOwner()->SendSizeEvent(wxEVT_GRID_COL_SIZE, -1, idx, e);
|
||||
}
|
||||
|
||||
// overridden to react to the columns order changes in the customization
|
||||
@@ -226,7 +231,12 @@ private:
|
||||
|
||||
void OnEndResize(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoEndDragResizeCol();
|
||||
// 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);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
Reference in New Issue
Block a user