Provide shorter synonyms for wxEVT_XXX constants.
Use the same short names as are used by the event table macros for the event type constants themselves. This makes them much more comfortable to use, e.g. Bind(wxEVT_BUTTON) compared to Bind(wxEVT_COMMAND_BUTTON_CLICKED). The old long names are still kept for backwards compatibility and shouldn't be removed as it doesn't really cost anything to continue providing them, but all new event types should only use the short versions. Closes #10661. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -209,12 +209,10 @@ private:
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericDirCtrl);
|
||||
};
|
||||
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRCTRL_CHANGED, wxTreeEvent );
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRCTRL_CHANGED, wxTreeEvent );
|
||||
|
||||
#define wx__DECLARE_DIRCTRL_EVT(evt, id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_DIRCTRL_ ## evt, id, wxTreeEventHandler(fn))
|
||||
|
||||
#define EVT_DIRCTRL_CHANGED(id, fn) wx__DECLARE_DIRCTRL_EVT(CHANGED, id, fn)
|
||||
#define EVT_DIRCTRL_CHANGED(id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_DIRCTRL_CHANGED, id, wxTreeEventHandler(fn))
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDirFilterListCtrl
|
||||
@@ -308,5 +306,8 @@ extern WXDLLIMPEXP_DATA_CORE(wxFileIconsTable *) wxTheFileIconsTable;
|
||||
|
||||
#endif // wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL
|
||||
|
||||
// old wxEVT_COMMAND_* constants
|
||||
#define wxEVT_COMMAND_DIRCTRL_CHANGED wxEVT_DIRCTRL_CHANGED
|
||||
|
||||
#endif
|
||||
// _WX_DIRCTRLG_H_
|
||||
|
@@ -17,8 +17,8 @@
|
||||
#include "wx/dirdlg.h"
|
||||
|
||||
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEvent );
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEvent );
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRPICKER_CHANGED, wxFileDirPickerEvent );
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILEPICKER_CHANGED, wxFileDirPickerEvent );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -148,7 +148,7 @@ public: // overridable
|
||||
virtual wxDialog *CreateDialog();
|
||||
|
||||
wxEventType GetEventType() const
|
||||
{ return wxEVT_COMMAND_FILEPICKER_CHANGED; }
|
||||
{ return wxEVT_FILEPICKER_CHANGED; }
|
||||
|
||||
protected:
|
||||
void UpdateDialogPath(wxDialog *p)
|
||||
@@ -203,7 +203,7 @@ public: // overridable
|
||||
virtual wxDialog *CreateDialog();
|
||||
|
||||
wxEventType GetEventType() const
|
||||
{ return wxEVT_COMMAND_DIRPICKER_CHANGED; }
|
||||
{ return wxEVT_DIRPICKER_CHANGED; }
|
||||
|
||||
protected:
|
||||
void UpdateDialogPath(wxDialog *p)
|
||||
@@ -215,5 +215,8 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericDirButton)
|
||||
};
|
||||
|
||||
// old wxEVT_COMMAND_* constants
|
||||
//#define wxEVT_COMMAND_DIRPICKER_CHANGED wxEVT_DIRPICKER_CHANGED
|
||||
//#define wxEVT_COMMAND_FILEPICKER_CHANGED wxEVT_FILEPICKER_CHANGED
|
||||
|
||||
#endif // _WX_FILEDIRPICKER_H_
|
||||
|
@@ -117,7 +117,7 @@ private:
|
||||
|
||||
// start (if m_colBeingResized is -1) or continue resizing the column
|
||||
//
|
||||
// this generates wxEVT_COMMAND_HEADER_BEGIN_RESIZE/RESIZING events and can
|
||||
// this generates wxEVT_HEADER_BEGIN_RESIZE/RESIZING events and can
|
||||
// cancel the operation if the user handler decides so
|
||||
void StartOrContinueResizing(unsigned int col, int xPhysical);
|
||||
|
||||
|
@@ -334,16 +334,16 @@ public:
|
||||
// all
|
||||
void SetSashPosition(int pos)
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
|
||||
|| GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
|
||||
wxASSERT( GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGED
|
||||
|| GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGING);
|
||||
|
||||
m_data.pos = pos;
|
||||
}
|
||||
|
||||
int GetSashPosition() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
|
||||
|| GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
|
||||
wxASSERT( GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGED
|
||||
|| GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGING);
|
||||
|
||||
return m_data.pos;
|
||||
}
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
// UNSPLIT event methods
|
||||
wxWindow *GetWindowBeingRemoved() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_UNSPLIT );
|
||||
wxASSERT( GetEventType() == wxEVT_SPLITTER_UNSPLIT );
|
||||
|
||||
return m_data.win;
|
||||
}
|
||||
@@ -359,14 +359,14 @@ public:
|
||||
// DCLICK event methods
|
||||
int GetX() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
|
||||
wxASSERT( GetEventType() == wxEVT_SPLITTER_DOUBLECLICKED );
|
||||
|
||||
return m_data.pt.x;
|
||||
}
|
||||
|
||||
int GetY() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
|
||||
wxASSERT( GetEventType() == wxEVT_SPLITTER_DOUBLECLICKED );
|
||||
|
||||
return m_data.pt.y;
|
||||
}
|
||||
@@ -396,7 +396,7 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
|
||||
wxEVENT_HANDLER_CAST(wxSplitterEventFunction, func)
|
||||
|
||||
#define wx__DECLARE_SPLITTEREVT(evt, id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))
|
||||
wx__DECLARE_EVT1(wxEVT_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))
|
||||
|
||||
#define EVT_SPLITTER_SASH_POS_CHANGED(id, fn) \
|
||||
wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGED, id, fn)
|
||||
@@ -410,4 +410,11 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
|
||||
#define EVT_SPLITTER_UNSPLIT(id, fn) \
|
||||
wx__DECLARE_SPLITTEREVT(UNSPLIT, id, fn)
|
||||
|
||||
|
||||
// old wxEVT_COMMAND_* constants
|
||||
#define wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED wxEVT_SPLITTER_SASH_POS_CHANGED
|
||||
#define wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING wxEVT_SPLITTER_SASH_POS_CHANGING
|
||||
#define wxEVT_COMMAND_SPLITTER_DOUBLECLICKED wxEVT_SPLITTER_DOUBLECLICKED
|
||||
#define wxEVT_COMMAND_SPLITTER_UNSPLIT wxEVT_SPLITTER_UNSPLIT
|
||||
|
||||
#endif // _WX_GENERIC_SPLITTER_H_
|
||||
|
Reference in New Issue
Block a user