X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd72551c2b6cbf67a4a5caf0ba00ba64e41183b2..f8a280159dcd2d6a98d8b5722645f9cb11c96c73:/contrib/include/wx/gizmos/dynamicsash.h?ds=sidebyside diff --git a/contrib/include/wx/gizmos/dynamicsash.h b/contrib/include/wx/gizmos/dynamicsash.h index a3b2f22363..2d5da5c8b0 100644 --- a/contrib/include/wx/gizmos/dynamicsash.h +++ b/contrib/include/wx/gizmos/dynamicsash.h @@ -13,11 +13,11 @@ #ifndef _WX_DYNAMICSASH_H_ #define _WX_DYNAMICSASH_H_ -#ifdef GIZMOISDLL -#define GIZMODLLEXPORT WXDLLEXPORT -#else -#define GIZMODLLEXPORT -#endif +#include "wx/gizmos/gizmos.h" + +#if !wxUSE_MDI +# error "wxUSE_MDI must be defined for gizmos to compile." +#endif /* !wxUSE_MDI */ /* @@ -66,18 +66,14 @@ */ -#include -#include -class wxScrollBar; - - -#define wxEVT_DYNAMIC_SASH_BASE (((int)('d' - 'a') << 11) | ((int)('s' - 'a') << 6) | ((int)('h' - 'a') << 1)) -#define wxEVT_DYNAMIC_SASH_SPLIT (wxEVT_DYNAMIC_SASH_BASE + 1) -#define wxEVT_DYNAMIC_SASH_UNIFY (wxEVT_DYNAMIC_SASH_BASE + 2) +#include "wx/event.h" +#include "wx/window.h" -#define EVT_DYNAMIC_SASH_SPLIT(id, func) EVT_CUSTOM(wxEVT_DYNAMIC_SASH_SPLIT, (id), (func)) -#define EVT_DYNAMIC_SASH_UNIFY(id, func) EVT_CUSTOM(wxEVT_DYNAMIC_SASH_UNIFY, (id), (func)) +class WXDLLIMPEXP_CORE wxScrollBar; +// ---------------------------------------------------------------------------- +// dynamic sash styles +// ---------------------------------------------------------------------------- /* wxDS_MANAGE_SCROLLBARS is a default style of wxDynamicSashWindow which @@ -94,6 +90,26 @@ class wxScrollBar; */ #define wxDS_DRAG_CORNER 0x0020 +/* + Default style for wxDynamicSashWindow. + */ +#define wxDS_DEFAULT wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER + +// ---------------------------------------------------------------------------- +// dynamic sash events +// ---------------------------------------------------------------------------- + +extern WXDLLIMPEXP_GIZMOS const wxEventType wxEVT_DYNAMIC_SASH_SPLIT; +extern WXDLLIMPEXP_GIZMOS const wxEventType wxEVT_DYNAMIC_SASH_UNIFY; + +#define EVT_DYNAMIC_SASH_SPLIT(id, func) \ + wx__DECLARE_EVT1(wxEVT_DYNAMIC_SASH_SPLIT, id, \ + wxDynamicSashSplitEventHandler(func)) + +#define EVT_DYNAMIC_SASH_UNIFY(id, func) \ + wx__DECLARE_EVT1(wxEVT_DYNAMIC_SASH_UNIFY, id, \ + wxDynamicSashUnifyEventHandler(func)) + /* wxDynamicSashSplitEvents are sent to your view by wxDynamicSashWindow @@ -102,10 +118,12 @@ class wxScrollBar; a child of the wxDynamicSashWindow. wxDynamicSashWindow will automatically reparent it to the proper place in its window hierarchy. */ -class GIZMODLLEXPORT wxDynamicSashSplitEvent : public wxCommandEvent { +class WXDLLIMPEXP_GIZMOS wxDynamicSashSplitEvent : public wxCommandEvent +{ public: wxDynamicSashSplitEvent(); - wxDynamicSashSplitEvent(const wxDynamicSashSplitEvent& event): wxCommandEvent(event) { } + wxDynamicSashSplitEvent(const wxDynamicSashSplitEvent& event) + : wxCommandEvent(event) { } wxDynamicSashSplitEvent(wxObject *target); virtual wxEvent* Clone() const { return new wxDynamicSashSplitEvent(*this); } @@ -124,7 +142,8 @@ private: the scrollbars' event handlers connected to your view's event handler class. */ -class GIZMODLLEXPORT wxDynamicSashUnifyEvent : public wxCommandEvent { +class WXDLLIMPEXP_GIZMOS wxDynamicSashUnifyEvent : public wxCommandEvent +{ public: wxDynamicSashUnifyEvent(); wxDynamicSashUnifyEvent(const wxDynamicSashUnifyEvent& event): wxCommandEvent(event) {} @@ -133,28 +152,44 @@ public: virtual wxEvent* Clone() const { return new wxDynamicSashUnifyEvent(*this); } private: - DECLARE_DYNAMIC_CLASS(wxDynamicSashUnifyEvent); + DECLARE_DYNAMIC_CLASS(wxDynamicSashUnifyEvent) }; typedef void (wxEvtHandler::*wxDynamicSashSplitEventFunction)(wxDynamicSashSplitEvent&); -typedef void (wxEvtHandler::*wxDynamicSashUnifyEventFunction)(wxDynamicSashSplitEvent&); +typedef void (wxEvtHandler::*wxDynamicSashUnifyEventFunction)(wxDynamicSashUnifyEvent&); -/* - wxDynamicSashWindow. See above. -*/ -class GIZMODLLEXPORT wxDynamicSashWindow : public wxWindow { +#define wxDynamicSashSplitEventHandler(func) \ + (wxObjectEventFunction)(wxEventFunction) \ + wxStaticCastEvent(wxDynamicSashSplitEventFunction, &func) + +#define wxDynamicSashUnifyEventHandler(func) \ + (wxObjectEventFunction)(wxEventFunction) \ + wxStaticCastEvent(wxDynamicSashUnifyEventFunction, &func) + +#define wx__DECLARE_TREEEVT(evt, id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn)) + +// ---------------------------------------------------------------------------- +// wxDynamicSashWindow itself +// ---------------------------------------------------------------------------- + +WXDLLIMPEXP_GIZMOS extern const wxChar* wxDynamicSashWindowNameStr; + +class WXDLLIMPEXP_GIZMOS wxDynamicSashWindow : public wxWindow +{ public: wxDynamicSashWindow(); wxDynamicSashWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const wxString& name = "dynamicSashWindow"); + long style = wxDS_DEFAULT, + const wxString& name = wxDynamicSashWindowNameStr); virtual ~wxDynamicSashWindow(); virtual bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const wxString& name = "dynamicSashWindow"); + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDS_DEFAULT, + const wxString& name = wxDynamicSashWindowNameStr); virtual wxScrollBar *GetHScrollBar(const wxWindow *child) const; virtual wxScrollBar *GetVScrollBar(const wxWindow *child) const; @@ -168,5 +203,5 @@ private: DECLARE_DYNAMIC_CLASS(wxDynamicSashWindow) }; +#endif // _WX_DYNAMICSASH_H_ -#endif