add more flexible and safer template Connect() overloads (#10000)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-12 14:26:13 +00:00
parent 8946ede10c
commit 3c77890141
136 changed files with 2503 additions and 1233 deletions

View File

@@ -18,6 +18,7 @@
class WXDLLIMPEXP_FWD_CORE wxComboBox;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
// ----------------------------------------------------------------------------
// wxGenericCalendarCtrl
@@ -181,7 +182,9 @@ private:
void OnDClick(wxMouseEvent& event);
void OnChar(wxKeyEvent& event);
void OnMonthChange(wxCommandEvent& event);
void OnYearChange(wxCommandEvent& event);
void HandleYearChange(wxCommandEvent& event);
void OnYearChange(wxSpinEvent& event);
void OnYearTextChange(wxCommandEvent& event);
// (re)calc m_widthCol and m_heightRow

View File

@@ -17,8 +17,8 @@
#include "wx/dirdlg.h"
extern WXDLLIMPEXP_DATA_CORE(const wxEventType) wxEVT_COMMAND_DIRPICKER_CHANGED;
extern WXDLLIMPEXP_DATA_CORE(const wxEventType) wxEVT_COMMAND_FILEPICKER_CHANGED;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEvent )
//-----------------------------------------------------------------------------

View File

@@ -2304,26 +2304,26 @@ private:
};
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_LEFT_CLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_RIGHT_CLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_LEFT_DCLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_RIGHT_DCLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_LEFT_CLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_RIGHT_CLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_LEFT_DCLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_RIGHT_DCLICK;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_ROW_SIZE;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_COL_SIZE;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_RANGE_SELECT;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_CHANGING;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_CHANGED;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_SELECT_CELL;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_EDITOR_SHOWN;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_EDITOR_HIDDEN;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_EDITOR_CREATED;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_BEGIN_DRAG;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_COL_MOVE;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_COL_SORT;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_DCLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_DCLICK, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_ROW_SIZE, wxGridSizeEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SIZE, wxGridSizeEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGING, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGED, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_SELECT_CELL, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_SHOWN, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_HIDDEN, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_CREATED, wxGridEditorCreatedEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_BEGIN_DRAG, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_MOVE, wxGridEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SORT, wxGridEvent )
typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&);
typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&);
@@ -2331,16 +2331,16 @@ typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEv
typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&);
#define wxGridEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridEventFunction, &func)
wxEVENT_HANDLER_CAST(wxGridEventFunction, func)
#define wxGridSizeEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridSizeEventFunction, &func)
wxEVENT_HANDLER_CAST(wxGridSizeEventFunction, func)
#define wxGridRangeSelectEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridRangeSelectEventFunction, &func)
wxEVENT_HANDLER_CAST(wxGridRangeSelectEventFunction, func)
#define wxGridEditorCreatedEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridEditorCreatedEventFunction, &func)
wxEVENT_HANDLER_CAST(wxGridEditorCreatedEventFunction, func)
#define wx__DECLARE_GRIDEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEventHandler(fn))

View File

@@ -21,8 +21,11 @@
#include "wx/event.h"
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_QUERY_LAYOUT_INFO;
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALCULATE_LAYOUT;
class WXDLLIMPEXP_FWD_ADV wxQueryLayoutInfoEvent;
class WXDLLIMPEXP_FWD_ADV wxCalculateLayoutEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_QUERY_LAYOUT_INFO, wxQueryLayoutInfoEvent )
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALCULATE_LAYOUT, wxCalculateLayoutEvent )
enum wxLayoutOrientation
{
@@ -100,8 +103,11 @@ private:
typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&);
#define wxQueryLayoutInfoEventHandler( func ) \
wxEVENT_HANDLER_CAST( wxQueryLayoutInfoEventFunction, func )
#define EVT_QUERY_LAYOUT_INFO(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxQueryLayoutInfoEventFunction, & func ), NULL ),
DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, wxQueryLayoutInfoEventHandler( func ), NULL ),
/*
* This event is used to take a bite out of the available client area.
@@ -137,8 +143,10 @@ private:
typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&);
#define wxCalculateLayoutEventHandler( func ) wxEVENT_HANDLER_CAST(wxCalculateLayoutEventFunction, func)
#define EVT_CALCULATE_LAYOUT(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCalculateLayoutEventFunction, & func ), NULL ),
DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, wxCalculateLayoutEventHandler( func ), NULL ),
#if wxUSE_SASH

View File

@@ -203,7 +203,9 @@ private:
DECLARE_NO_COPY_CLASS(wxSashWindow)
};
extern WXDLLIMPEXP_ADV const wxEventType wxEVT_SASH_DRAGGED;
class WXDLLIMPEXP_FWD_ADV wxSashEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_SASH_DRAGGED, wxSashEvent )
enum wxSashDragStatus
{
@@ -253,7 +255,7 @@ private:
typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&);
#define wxSashEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSashEventFunction, &func)
wxEVENT_HANDLER_CAST(wxSashEventFunction, func)
#define EVT_SASH_DRAGGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_SASH_DRAGGED, id, wxSashEventHandler(fn))

View File

@@ -390,7 +390,7 @@ private:
typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
#define wxSplitterEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSplitterEventFunction, &func)
wxEVENT_HANDLER_CAST(wxSplitterEventFunction, func)
#define wx__DECLARE_SPLITTEREVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))