compilation fix for new event types (this shouldn't be necessary but do it to temporarily fix the build)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -34,20 +34,9 @@
|
|||||||
// event constants
|
// event constants
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// declare a custom event type
|
// define a custom event type (we don't need a separate declaration here but
|
||||||
//
|
// usually you would use a matching wxDECLARE_LOCAL_EVENT in a header)
|
||||||
// note that in wxWin 2.3+ these macros expand simply into the following code:
|
wxDEFINE_EVENT(wxEVT_MY_CUSTOM_COMMAND, wxCommandEvent)
|
||||||
//
|
|
||||||
// extern const wxEventType wxEVT_MY_CUSTOM_COMMAND;
|
|
||||||
//
|
|
||||||
// const wxEventType wxEVT_MY_CUSTOM_COMMAND = wxNewEventType();
|
|
||||||
//
|
|
||||||
// and you may use this code directly if you don't care about 2.2 compatibility
|
|
||||||
BEGIN_DECLARE_EVENT_TYPES()
|
|
||||||
DECLARE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND, 7777)
|
|
||||||
END_DECLARE_EVENT_TYPES()
|
|
||||||
|
|
||||||
DEFINE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND)
|
|
||||||
|
|
||||||
// it may also be convenient to define an event table macro for this event type
|
// it may also be convenient to define an event table macro for this event type
|
||||||
#define EVT_MY_CUSTOM_COMMAND(id, fn) \
|
#define EVT_MY_CUSTOM_COMMAND(id, fn) \
|
||||||
@@ -313,20 +302,18 @@ void MyFrame::OnConnect(wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
if ( event.IsChecked() )
|
if ( event.IsChecked() )
|
||||||
{
|
{
|
||||||
// disconnect
|
Connect(Event_Dynamic, wxEVT_COMMAND_MENU_SELECTED,
|
||||||
Connect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
|
wxCommandEventHandler(MyFrame::OnDynamic));
|
||||||
(wxObjectEventFunction)
|
|
||||||
(wxEventFunction)
|
|
||||||
(wxCommandEventFunction)&MyFrame::OnDynamic);
|
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
SetStatusText(_T("You can now use \"Dynamic\" item in the menu"));
|
SetStatusText(_T("You can now use \"Dynamic\" item in the menu"));
|
||||||
SetStatusText(_T("Dynamic: on"), Status_Dynamic);
|
SetStatusText(_T("Dynamic: on"), Status_Dynamic);
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
}
|
}
|
||||||
else // connect
|
else // disconnect
|
||||||
{
|
{
|
||||||
Disconnect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED);
|
Disconnect(Event_Dynamic, wxEVT_COMMAND_MENU_SELECTED,
|
||||||
|
wxCommandEventHandler(MyFrame::OnDynamic));
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
|
SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
|
||||||
|
Reference in New Issue
Block a user