+// ----------------------------------------------------------------------------
+// event class and macros
+// ----------------------------------------------------------------------------
+
+// we reuse the same class for all splitter event types because this is the
+// usual wxWin convention, but the three event types have different kind of
+// data associated with them, so the accessors can be only used if the real
+// event type matches with the one for which the accessors make sense
+class WXDLLEXPORT wxSplitterEvent : public wxCommandEvent
+{
+public:
+ wxSplitterEvent(wxEventType type = wxEVT_NULL,
+ wxSplitterWindow *splitter = (wxSplitterWindow *)NULL)
+ : wxCommandEvent(type)
+ {
+ SetEventObject(splitter);
+ }
+
+ // SASH_POS_CHANGED methods
+
+ // setting the sash position to -1 prevents the change from taking place at
+ // all
+ void SetSashPosition(int pos)
+ {
+ wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
+ || GetEventType() == wxEVT_COMMAND_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);
+
+ return m_data.pos;
+ }
+
+ // UNSPLIT event methods
+ wxWindow *GetWindowBeingRemoved() const
+ {
+ wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_UNSPLIT );
+
+ return m_data.win;
+ }
+
+ // DCLICK event methods
+ int GetX() const
+ {
+ wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
+
+ return m_data.pt.x;
+ }
+
+ int GetY() const
+ {
+ wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
+
+ return m_data.pt.y;
+ }
+
+private:
+#ifdef __MWERKS__
+ friend class wxSplitterWindow;
+#else
+ friend wxSplitterWindow;