Use enum constants to identify menu items in propgrid sample.
To implement the same pattern of coding in the sample.
This commit is contained in:
@@ -26,8 +26,13 @@ private:
|
|||||||
wxDECLARE_EVENT_TABLE();
|
wxDECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ID_ACTION = wxID_HIGHEST+1
|
||||||
|
};
|
||||||
|
|
||||||
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
EVT_MENU(wxID_HIGHEST+1, MyFrame::OnAction)
|
EVT_MENU(ID_ACTION, MyFrame::OnAction)
|
||||||
EVT_PG_CHANGED( -1, MyFrame::OnPropertyGridChange )
|
EVT_PG_CHANGED( -1, MyFrame::OnPropertyGridChange )
|
||||||
EVT_PG_CHANGING( -1, MyFrame::OnPropertyGridChanging )
|
EVT_PG_CHANGING( -1, MyFrame::OnPropertyGridChanging )
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
@@ -36,7 +41,7 @@ MyFrame::MyFrame(wxWindow* parent)
|
|||||||
: wxFrame(parent, wxID_ANY, wxT("PropertyGrid Test"))
|
: wxFrame(parent, wxID_ANY, wxT("PropertyGrid Test"))
|
||||||
{
|
{
|
||||||
wxMenu *Menu = new wxMenu;
|
wxMenu *Menu = new wxMenu;
|
||||||
Menu->Append(wxID_HIGHEST+1, wxT("Action"));
|
Menu->Append(ID_ACTION, wxT("Action"));
|
||||||
wxMenuBar *MenuBar = new wxMenuBar();
|
wxMenuBar *MenuBar = new wxMenuBar();
|
||||||
MenuBar->Append(Menu, wxT("Action"));
|
MenuBar->Append(Menu, wxT("Action"));
|
||||||
SetMenuBar(MenuBar);
|
SetMenuBar(MenuBar);
|
||||||
|
Reference in New Issue
Block a user