Some mouse events need to be handled even when outside the grid.

Added flag and accessors to enable/disable the dragging of the grid
lines.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-02-23 07:03:56 +00:00
parent 28a77bc43b
commit 4cfa5de640
4 changed files with 41 additions and 32 deletions

View File

@@ -70,6 +70,7 @@ BEGIN_EVENT_TABLE( GridFrame, wxFrame )
EVT_MENU( ID_TOGGLEEDIT, GridFrame::ToggleEditing )
EVT_MENU( ID_TOGGLEROWSIZING, GridFrame::ToggleRowSizing )
EVT_MENU( ID_TOGGLECOLSIZING, GridFrame::ToggleColSizing )
EVT_MENU( ID_TOGGLEGRIDSIZING, GridFrame::ToggleGridSizing )
EVT_MENU( ID_SETLABELCOLOUR, GridFrame::SetLabelColour )
EVT_MENU( ID_SETLABELTEXTCOLOUR, GridFrame::SetLabelTextColour )
EVT_MENU( ID_ROWLABELHORIZALIGN, GridFrame::SetRowLabelHorizAlignment )
@@ -124,6 +125,7 @@ GridFrame::GridFrame()
viewMenu->Append( ID_TOGGLEEDIT, "&Editable", "", TRUE );
viewMenu->Append( ID_TOGGLEROWSIZING, "Ro&w drag-resize", "", TRUE );
viewMenu->Append( ID_TOGGLECOLSIZING, "C&ol drag-resize", "", TRUE );
viewMenu->Append( ID_TOGGLEGRIDSIZING, "&Grid drag-resize", "", TRUE );
wxMenu *rowLabelMenu = new wxMenu;
@@ -261,6 +263,7 @@ void GridFrame::SetDefaults()
GetMenuBar()->Check( ID_TOGGLEEDIT, TRUE );
GetMenuBar()->Check( ID_TOGGLEROWSIZING, TRUE );
GetMenuBar()->Check( ID_TOGGLECOLSIZING, TRUE );
GetMenuBar()->Check( ID_TOGGLEGRIDSIZING, TRUE );
}
@@ -310,6 +313,12 @@ void GridFrame::ToggleColSizing( wxCommandEvent& WXUNUSED(ev) )
GetMenuBar()->IsChecked( ID_TOGGLECOLSIZING ) );
}
void GridFrame::ToggleGridSizing( wxCommandEvent& WXUNUSED(ev) )
{
grid->EnableDragGridSize(
GetMenuBar()->IsChecked( ID_TOGGLEGRIDSIZING ) );
}
void GridFrame::SetLabelColour( wxCommandEvent& WXUNUSED(ev) )
{