Finally removes occurences of OnMenuCommand and closes bug #1164678

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-11-16 17:27:38 +00:00
parent 582ca3535a
commit 5e06d749ed
9 changed files with 44 additions and 83 deletions

View File

@@ -38,10 +38,7 @@ individually. This event handler class also holds a label string.
The DiagramCommand class is the key to implementing Undo/Redo. Each instance of DiagramCommand
stores enough information about an operation (create, delete, change colour etc.) to allow
it to carry out (or undo) its command. In DiagramView::OnMenuCommand, when the user initiates the
command, a new DiagramCommand instance is created which is then sent to the document's
command processor (see wxWindows manual for more information about doc/view and command
processing).
it to carry out (or undo) its command.
Apart from menu commands, another way commands are initiated is by the user left-clicking on
the canvas or right-dragging on a node. MyCanvas::OnLeftClick in view.cpp shows how

View File

@@ -51,7 +51,7 @@ class DiagramView: public wxView
public:
wxFrame *frame;
MyCanvas *canvas;
DiagramView(void) { canvas = NULL; frame = NULL; };
~DiagramView(void) {};
@@ -62,8 +62,6 @@ class DiagramView: public wxView
wxShape *FindSelectedShape(void);
// void OnMenuCommand(int cmd);
void OnCut(wxCommandEvent& event);
void OnChangeBackgroundColour(wxCommandEvent& event);
void OnEditLabel(wxCommandEvent& event);

View File

@@ -30,8 +30,6 @@ public:
cbSimpleCustomizationPlugin* mpBackRef;
public:
void OnMenuCommand( wxCommandEvent& evt );
void OnCommandEvents( wxCommandEvent& evt );
DECLARE_EVENT_TABLE()
@@ -45,12 +43,12 @@ public:
BEGIN_EVENT_TABLE( cbContextMenuHandler, wxEvtHandler )
// FIXME:: what is the right range for these ids ? so that they
// FIXME:: what is the right range for these ids ? so that they
// would not collide with user commands?
EVT_COMMAND_RANGE( CB_CUSTOMIZE_MENU_FIRST_ITEM_ID,
CB_CUSTOMIZE_MENU_FIRST_ITEM_ID + 300,
wxEVT_COMMAND_MENU_SELECTED,
CB_CUSTOMIZE_MENU_FIRST_ITEM_ID + 300,
wxEVT_COMMAND_MENU_SELECTED,
cbContextMenuHandler::OnCommandEvents )
END_EVENT_TABLE()
@@ -121,7 +119,7 @@ void cbSimpleCustomizationPlugin::OnCustomizeLayout( cbCustomizeLayoutEvent& eve
#if 0
pMenu->AppendSeparator();
pMenu->Append( id, "Customize...", "Show layout customization dialog", false );
#endif
#endif
mCustMenuItemId = id;
cbContextMenuHandler* pHandler = new cbContextMenuHandler();
@@ -190,9 +188,8 @@ void cbSimpleCustomizationPlugin::OnMenuItemSelected( wxCommandEvent& event )
mpLayout->SetBarState( pBar, newState, true );
if ( newState == wxCBAR_FLOATING )
mpLayout->RepositionFloatedBar( pBar );
mpLayout->RepositionFloatedBar( pBar );
}
// menu-item-selected event is "eaten"
}