diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 4f5ea81c00..30617b9ee7 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -183,6 +183,7 @@ wxBEGIN_EVENT_TABLE( GridFrame, wxFrame ) EVT_MENU( ID_DELETEROW, GridFrame::DeleteSelectedRows ) EVT_MENU( ID_DELETECOL, GridFrame::DeleteSelectedCols ) EVT_MENU( ID_CLEARGRID, GridFrame::ClearGrid ) + EVT_MENU( ID_EDITCELL, GridFrame::EditCell ) EVT_MENU( ID_SETCORNERLABEL, GridFrame::SetCornerLabelValue ) EVT_MENU( ID_SHOWSEL, GridFrame::ShowSelection ) EVT_MENU( ID_SELCELLS, GridFrame::SelectCells ) @@ -372,6 +373,7 @@ GridFrame::GridFrame() editMenu->Append( ID_DELETEROW, "Delete selected ro&ws" ); editMenu->Append( ID_DELETECOL, "Delete selected co&ls" ); editMenu->Append( ID_CLEARGRID, "Cl&ear grid cell contents" ); + editMenu->Append( ID_EDITCELL, "&Edit current cell" ); editMenu->Append( ID_SETCORNERLABEL, "&Set corner label..." ); editMenu->AppendCheckItem( ID_FREEZE_OR_THAW, "Freeze up to cursor\tCtrl-F" ); @@ -1161,6 +1163,11 @@ void GridFrame::ClearGrid( wxCommandEvent& WXUNUSED(ev) ) grid->ClearGrid(); } +void GridFrame::EditCell( wxCommandEvent& WXUNUSED(ev) ) +{ + grid->EnableCellEditControl(); +} + void GridFrame::SetCornerLabelValue( wxCommandEvent& WXUNUSED(ev) ) { wxTextEntryDialog dialog(this, diff --git a/samples/grid/griddemo.h b/samples/grid/griddemo.h index 086136b7ed..9c7ab3e8f3 100644 --- a/samples/grid/griddemo.h +++ b/samples/grid/griddemo.h @@ -69,6 +69,7 @@ class GridFrame : public wxFrame void DeleteSelectedRows( wxCommandEvent& ); void DeleteSelectedCols( wxCommandEvent& ); void ClearGrid( wxCommandEvent& ); + void EditCell( wxCommandEvent& ); void SetCornerLabelValue( wxCommandEvent& ); void ShowSelection( wxCommandEvent& ); void SelectCells( wxCommandEvent& ); @@ -179,6 +180,7 @@ public: ID_DELETEROW, ID_DELETECOL, ID_CLEARGRID, + ID_EDITCELL, ID_SETCORNERLABEL, ID_SHOWSEL, ID_CHANGESEL,