tarFish
tarFish

Reputation: 15

WxWidgets dynamic event handler resize

In WxWidgets when using a Dynamic event table versus a static one, with capturing a resize event. with a static table I use

EVT_SIZE(MyFrame::OnSize)

and for reference for a menu item I use

EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
//for the dynamic
frame->Connect( wxID_ABOUT,
    wxEVT_COMMAND_MENU_SELECTED,
    wxCommandEventHandler(MyFrame::OnAbout) );

ok so with the menu in the dynamic setup wxEVT_COMMAND_MENU_SELECTED is used while in the static setup I use EVT_MENU. so my question is what do I use instead of EVT_SIZE? I'm also wondering what the differance is between the two EVT_MENU and wxEVT_COMMAND_MENU_SELECTED. One more what type of thing are they in c++? enums

Upvotes: 0

Views: 335

Answers (2)

VZ.
VZ.

Reputation: 22753

In wxWidgets 3.0, you can, and should, use wxEVT_MENU instead of wxEVT_COMMAND_MENU_SELECTED too as all the event type constants have been renamed to the same names as are used by the macros, for consistency (the old names still exist for compatibility and there is no real harm in using them, but they're long and unwieldy, so why bother).

As for the type, the wxEVT_XXX themselves are just ints, but there are also matching specializations of wxEventTypeTag<> template for them, so you can't just define your own ones, see wxDECLARE_EVENT() and wxDEFINE_EVENT() macros for the proper way to do it.

Upvotes: 1

ravenspoint
ravenspoint

Reputation: 20616

my question is what do I use instead of EVT_SIZE?

wxEVT_SIZE

Upvotes: 0

Related Questions