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
This commit is contained in:
Włodzimierz Skiba 2005-03-08 20:53:16 +00:00
parent 656dad21d8
commit 8bc3ec1ff5
11 changed files with 52 additions and 61 deletions

View File

@ -214,7 +214,7 @@ END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&);
#define wxCalendarEventHandler(func) \ #define wxCalendarEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func)
#define wx__DECLARE_CALEVT(evt, id, fn) \ #define wx__DECLARE_CALEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn))

View File

@ -2522,76 +2522,76 @@ typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureC
#define wxCommandEventHandler(func) \ #define wxCommandEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func)
#define wxScrollEventHandler(func) \ #define wxScrollEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func)
#define wxScrollWinEventHandler(func) \ #define wxScrollWinEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func)
#define wxSizeEventHandler(func) \ #define wxSizeEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func)
#define wxMoveEventHandler(func) \ #define wxMoveEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func)
#define wxPaintEventHandler(func) \ #define wxPaintEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func)
#define wxNcPaintEventHandler(func) \ #define wxNcPaintEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func)
#define wxEraseEventHandler(func) \ #define wxEraseEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func)
#define wxMouseEventHandler(func) \ #define wxMouseEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func)
#define wxCharEventHandler(func) \ #define wxCharEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxCharEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCharEventFunction, &func)
#define wxKeyEventHandler(func) wxCharEventHandler(func) #define wxKeyEventHandler(func) wxCharEventHandler(func)
#define wxFocusEventHandler(func) \ #define wxFocusEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func)
#define wxChildFocusEventHandler(func) \ #define wxChildFocusEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func)
#define wxActivateEventHandler(func) \ #define wxActivateEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func)
#define wxMenuEventHandler(func) \ #define wxMenuEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func)
#define wxJoystickEventHandler(func) \ #define wxJoystickEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func)
#define wxDropFilesEventHandler(func) \ #define wxDropFilesEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func)
#define wxInitDialogEventHandler(func) \ #define wxInitDialogEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func)
#define wxSysColourChangedEventHandler(func) \ #define wxSysColourChangedEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func)
#define wxDisplayChangedEventHandler(func) \ #define wxDisplayChangedEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func)
#define wxUpdateUIEventHandler(func) \ #define wxUpdateUIEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func)
#define wxIdleEventHandler(func) \ #define wxIdleEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func)
#define wxCloseEventHandler(func) \ #define wxCloseEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func)
#define wxShowEventHandler(func) \ #define wxShowEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxShowEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxShowEventFunction, &func)
#define wxIconizeEventHandler(func) \ #define wxIconizeEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func)
#define wxMaximizeEventHandler(func) \ #define wxMaximizeEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func)
#define wxNavigationKeyEventHandler(func) \ #define wxNavigationKeyEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func)
#define wxPaletteChangedEventHandler(func) \ #define wxPaletteChangedEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func)
#define wxQueryNewPaletteEventHandler(func) \ #define wxQueryNewPaletteEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func)
#define wxWindowCreateEventHandler(func) \ #define wxWindowCreateEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func)
#define wxWindowDestroyEventHandler(func) \ #define wxWindowDestroyEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func)
#define wxSetCursorEventHandler(func) \ #define wxSetCursorEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func)
#define wxNotifyEventHandler(func) \ #define wxNotifyEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func)
#define wxHelpEventHandler(func) \ #define wxHelpEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func)
#define wxContextMenuEventHandler(func) \ #define wxContextMenuEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func)
#define wxMouseCaptureChangedEventHandler(func) \ #define wxMouseCaptureChangedEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func)
#endif // wxUSE_GUI #endif // wxUSE_GUI

View File

@ -444,7 +444,7 @@ END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
#define wxListEventHandler(func) \ #define wxListEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxListEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListEventFunction, &func)
#define wx__DECLARE_LISTEVT(evt, id, fn) \ #define wx__DECLARE_LISTEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_LIST_ ## evt, id, wxListEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_COMMAND_LIST_ ## evt, id, wxListEventHandler(fn))

View File

@ -147,23 +147,14 @@ extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING;
typedef void (wxEvtHandler::*wxListbookEventFunction)(wxListbookEvent&); typedef void (wxEvtHandler::*wxListbookEventFunction)(wxListbookEvent&);
#define EVT_LISTBOOK_PAGE_CHANGED(id, fn) \ #define wxListbookEventHandler(func) \
DECLARE_EVENT_TABLE_ENTRY( \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListbookEventFunction, &func)
wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, \
id, \
wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxListbookEventFunction, &fn ), \
NULL \
),
#define EVT_LISTBOOK_PAGE_CHANGING(id, fn) \ #define EVT_LISTBOOK_PAGE_CHANGED(winid, fn) \
DECLARE_EVENT_TABLE_ENTRY( \ wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, winid, wxListbookEventHandler(fn))
wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, \
id, \ #define EVT_LISTBOOK_PAGE_CHANGING(winid, fn) \
wxID_ANY, \ wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, winid, wxListbookEventHandler(fn))
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxListbookEventFunction, &fn ), \
NULL \
),
#endif // wxUSE_LISTBOOK #endif // wxUSE_LISTBOOK

View File

@ -123,7 +123,7 @@ END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&); typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
#define wxNotebookEventHandler(func) \ #define wxNotebookEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func)
#define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \ #define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxNotebookEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxNotebookEventHandler(fn))

View File

@ -321,7 +321,7 @@ public:
typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&);
#define wxSocketEventHandler(func) \ #define wxSocketEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func)
#define EVT_SOCKET(id, func) \ #define EVT_SOCKET(id, func) \
wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func)) wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func))

View File

@ -111,7 +111,7 @@ private:
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&); typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
#define wxSpinEventHandler(func) \ #define wxSpinEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxSpinEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSpinEventFunction, &func)
// macros for handling spin events // macros for handling spin events
#define EVT_SPIN_UP(winid, func) \ #define EVT_SPIN_UP(winid, func) \

View File

@ -85,7 +85,7 @@ BEGIN_DECLARE_EVENT_TYPES()
END_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES()
#define wxTaskBarIconEventHandler(func) \ #define wxTaskBarIconEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func)
#define wx__DECLARE_TASKBAREVT(evt, fn) \ #define wx__DECLARE_TASKBAREVT(evt, fn) \
wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn)) wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn))

View File

@ -190,7 +190,7 @@ private:
typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&);
#define wxTimerEventHandler(func) \ #define wxTimerEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxTimerEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTimerEventFunction, &func)
#define EVT_TIMER(timerid, func) \ #define EVT_TIMER(timerid, func) \
wx__DECLARE_EVT1(wxEVT_TIMER, timerid, wxTimerEventHandler(func)) wx__DECLARE_EVT1(wxEVT_TIMER, timerid, wxTimerEventHandler(func))

View File

@ -284,7 +284,7 @@ public:
// Set the tooltip for the item (for EVT\_TREE\_ITEM\_GETTOOLTIP events) // Set the tooltip for the item (for EVT\_TREE\_ITEM\_GETTOOLTIP events)
void SetToolTip(const wxString& toolTip) { m_label = toolTip; } void SetToolTip(const wxString& toolTip) { m_label = toolTip; }
wxString GetToolTip() { return m_label; } wxString GetToolTip() { return m_label; }
#if WXWIN_COMPATIBILITY_2_2 #if WXWIN_COMPATIBILITY_2_2
// for compatibility only, don't use // for compatibility only, don't use
wxDEPRECATED( int GetCode() const); wxDEPRECATED( int GetCode() const);
@ -336,7 +336,7 @@ BEGIN_DECLARE_EVENT_TYPES()
END_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES()
#define wxTreeEventHandler(func) \ #define wxTreeEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxTreeEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTreeEventFunction, &func)
#define wx__DECLARE_TREEEVT(evt, id, fn) \ #define wx__DECLARE_TREEEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn))

View File

@ -297,7 +297,7 @@ END_DECLARE_EVENT_TYPES()
typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&);
#define wxWizardEventHandler(func) \ #define wxWizardEventHandler(func) \
(wxObjectEventFunction)wxStaticCastEvent(wxWizardEventFunction, &func) (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWizardEventFunction, &func)
#define wx__DECLARE_WIZARDEVT(evt, id, fn) \ #define wx__DECLARE_WIZARDEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn)) wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn))