Search found 3 matches

by winzjqwin
Wed Aug 03, 2016 9:41 am
Forum: Component Writing
Topic: How to response MENU_SELECTED event in an Inherited wxMenuBar?
Replies: 2
Views: 1183

Re: How to response MENU_SELECTED event in an Inherited wxMenuBar?

doublemax wrote:I'm not 100% sure, but i have a faint memory that this can't work, because the menu events are directly sent to the owning wxFrame, not to the wxMenuBar
thanks!
by winzjqwin
Wed Aug 03, 2016 6:38 am
Forum: Component Writing
Topic: How to response MENU_SELECTED event in an Inherited wxMenuBar?
Replies: 2
Views: 1183

How to response MENU_SELECTED event in an Inherited wxMenuBar?

I had tried DECLARE_EVENT_TABLE() && Connect(),but it dosen't work.My code just like this.How to make it work? //.h class MainFrameMenuBar :public wxMenuBar //... private: DECLARE_EVENT_TABLE(); }; //... //.cpp BEGIN_EVENT_TABLE(MainFrameMenuBar, wxMenuBar) EVT_MENU(XRCID("ID_MENU_FIGURE"), MainFram...
by winzjqwin
Wed Aug 03, 2016 6:33 am
Forum: wxWidgets Development (Chinese)
Topic: 如何在一个继承自wxMenuBar的类中响应Menu Item的点击事件?
Replies: 1
Views: 1337

如何在一个继承自wxMenuBar的类中响应Menu Item的点击事件?

我试了使用DECLARE_EVENT_TABLE()和Connect()的方式。但点击并没有反应。 应该怎么做才行呢? 我的代码如下: //.h class MainFrameMenuBar :public wxMenuBar //... private: DECLARE_EVENT_TABLE(); }; //... //.cpp BEGIN_EVENT_TABLE(MainFrameMenuBar, wxMenuBar) EVT_MENU(XRCID("ID_MENU_FIGURE"), MainFrameMenuBar::onMenuItemFigure) END_EVENT_TABLE...