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:
@@ -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