From: Włodzimierz Skiba Date: Tue, 8 Mar 2005 20:53:16 +0000 (+0000) Subject: Casting fix for events. Needs check by ARM eVC4 users. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8bc3ec1ff5384eab3f8fb5b3a0ca7f7887889813?hp=656dad21d847f6d27f552cd07eef229c24690bf3 Casting fix for events. Needs check by ARM eVC4 users. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/calctrl.h b/include/wx/calctrl.h index 2fd259e425..99d0ef6034 100644 --- a/include/wx/calctrl.h +++ b/include/wx/calctrl.h @@ -214,7 +214,7 @@ END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); #define wxCalendarEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func) #define wx__DECLARE_CALEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn)) diff --git a/include/wx/event.h b/include/wx/event.h index 0165b960e3..d056318fa7 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -2522,76 +2522,76 @@ typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureC #define wxCommandEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func) #define wxScrollEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func) #define wxScrollWinEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func) #define wxSizeEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func) #define wxMoveEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func) #define wxPaintEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func) #define wxNcPaintEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func) #define wxEraseEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func) #define wxMouseEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func) #define wxCharEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxCharEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCharEventFunction, &func) #define wxKeyEventHandler(func) wxCharEventHandler(func) #define wxFocusEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func) #define wxChildFocusEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func) #define wxActivateEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func) #define wxMenuEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func) #define wxJoystickEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func) #define wxDropFilesEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func) #define wxInitDialogEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func) #define wxSysColourChangedEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func) #define wxDisplayChangedEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func) #define wxUpdateUIEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func) #define wxIdleEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) #define wxCloseEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func) #define wxShowEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxShowEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxShowEventFunction, &func) #define wxIconizeEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func) #define wxMaximizeEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func) #define wxNavigationKeyEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func) #define wxPaletteChangedEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func) #define wxQueryNewPaletteEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func) #define wxWindowCreateEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func) #define wxWindowDestroyEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func) #define wxSetCursorEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func) #define wxNotifyEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func) #define wxHelpEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func) #define wxContextMenuEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func) #define wxMouseCaptureChangedEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func) #endif // wxUSE_GUI diff --git a/include/wx/listbase.h b/include/wx/listbase.h index ef640effcb..97a3555fae 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -444,7 +444,7 @@ END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); #define wxListEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxListEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListEventFunction, &func) #define wx__DECLARE_LISTEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_LIST_ ## evt, id, wxListEventHandler(fn)) diff --git a/include/wx/listbook.h b/include/wx/listbook.h index 1b292be686..9414943190 100644 --- a/include/wx/listbook.h +++ b/include/wx/listbook.h @@ -147,23 +147,14 @@ extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING; typedef void (wxEvtHandler::*wxListbookEventFunction)(wxListbookEvent&); -#define EVT_LISTBOOK_PAGE_CHANGED(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( \ - wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, \ - id, \ - wxID_ANY, \ - (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxListbookEventFunction, &fn ), \ - NULL \ - ), - -#define EVT_LISTBOOK_PAGE_CHANGING(id, fn) \ - DECLARE_EVENT_TABLE_ENTRY( \ - wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, \ - id, \ - wxID_ANY, \ - (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxListbookEventFunction, &fn ), \ - NULL \ - ), +#define wxListbookEventHandler(func) \ + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListbookEventFunction, &func) + +#define EVT_LISTBOOK_PAGE_CHANGED(winid, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, winid, wxListbookEventHandler(fn)) + +#define EVT_LISTBOOK_PAGE_CHANGING(winid, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, winid, wxListbookEventHandler(fn)) #endif // wxUSE_LISTBOOK diff --git a/include/wx/notebook.h b/include/wx/notebook.h index c1a04385bf..02f4a11675 100644 --- a/include/wx/notebook.h +++ b/include/wx/notebook.h @@ -123,7 +123,7 @@ END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&); #define wxNotebookEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func) #define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxNotebookEventHandler(fn)) diff --git a/include/wx/socket.h b/include/wx/socket.h index 2cd5df584a..15a718b4fd 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -321,7 +321,7 @@ public: typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); #define wxSocketEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func) #define EVT_SOCKET(id, func) \ wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func)) diff --git a/include/wx/spinbutt.h b/include/wx/spinbutt.h index cf7fab4421..7f7edb9e5b 100644 --- a/include/wx/spinbutt.h +++ b/include/wx/spinbutt.h @@ -111,7 +111,7 @@ private: typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&); #define wxSpinEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxSpinEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSpinEventFunction, &func) // macros for handling spin events #define EVT_SPIN_UP(winid, func) \ diff --git a/include/wx/taskbar.h b/include/wx/taskbar.h index 202aae6f78..2a03b0f0c1 100644 --- a/include/wx/taskbar.h +++ b/include/wx/taskbar.h @@ -85,7 +85,7 @@ BEGIN_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES() #define wxTaskBarIconEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func) #define wx__DECLARE_TASKBAREVT(evt, fn) \ wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn)) diff --git a/include/wx/timer.h b/include/wx/timer.h index 409f88dc53..2ee202c106 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -190,7 +190,7 @@ private: typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); #define wxTimerEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxTimerEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTimerEventFunction, &func) #define EVT_TIMER(timerid, func) \ wx__DECLARE_EVT1(wxEVT_TIMER, timerid, wxTimerEventHandler(func)) diff --git a/include/wx/treebase.h b/include/wx/treebase.h index 065432bc69..51c4249027 100644 --- a/include/wx/treebase.h +++ b/include/wx/treebase.h @@ -284,7 +284,7 @@ public: // Set the tooltip for the item (for EVT\_TREE\_ITEM\_GETTOOLTIP events) void SetToolTip(const wxString& toolTip) { m_label = toolTip; } wxString GetToolTip() { return m_label; } - + #if WXWIN_COMPATIBILITY_2_2 // for compatibility only, don't use wxDEPRECATED( int GetCode() const); @@ -336,7 +336,7 @@ BEGIN_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES() #define wxTreeEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxTreeEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTreeEventFunction, &func) #define wx__DECLARE_TREEEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn)) diff --git a/include/wx/wizard.h b/include/wx/wizard.h index 3fe354b377..712ea4f7a1 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -297,7 +297,7 @@ END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); #define wxWizardEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxWizardEventFunction, &func) + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWizardEventFunction, &func) #define wx__DECLARE_WIZARDEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn))