X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8bc10f3280653cf193f1a07a2b61932fa70a9a68..58ce18f2fdadecffb21e27555115af708325cf18:/include/wx/aui/auibar.h diff --git a/include/wx/aui/auibar.h b/include/wx/aui/auibar.h index 50a5018969..9b26529e0e 100644 --- a/include/wx/aui/auibar.h +++ b/include/wx/aui/auibar.h @@ -20,7 +20,8 @@ #include "wx/sizer.h" #include "wx/pen.h" -//class WXDLLIMPEXP_FWD_CORE wxSizerItem; +class WXDLLIMPEXP_FWD_CORE wxClientDC; +class WXDLLIMPEXP_FWD_AUI wxAuiPaneInfo; enum wxAuiToolBarStyle { @@ -29,9 +30,17 @@ enum wxAuiToolBarStyle wxAUI_TB_NO_AUTORESIZE = 1 << 2, wxAUI_TB_GRIPPER = 1 << 3, wxAUI_TB_OVERFLOW = 1 << 4, + // using this style forces the toolbar to be vertical and + // be only dockable to the left or right sides of the window + // whereas by default it can be horizontal or vertical and + // be docked anywhere wxAUI_TB_VERTICAL = 1 << 5, wxAUI_TB_HORZ_LAYOUT = 1 << 6, + // analogous to wxAUI_TB_VERTICAL, but forces the toolbar + // to be horizontal + wxAUI_TB_HORIZONTAL = 1 << 7, wxAUI_TB_HORZ_TEXT = (wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT), + wxAUI_ORIENTATION_MASK = (wxAUI_TB_VERTICAL | wxAUI_TB_HORIZONTAL), wxAUI_TB_DEFAULT_STYLE = 0 }; @@ -119,6 +128,7 @@ public: dropdown = true; sticky = true; user_data = 0; + alignment = wxALIGN_CENTER; } wxAuiToolBarItem(const wxAuiToolBarItem& c) @@ -152,6 +162,7 @@ public: dropdown = c.dropdown; sticky = c.sticky; user_data = c.user_data; + alignment = c.alignment; } @@ -209,6 +220,9 @@ public: void SetUserData(long l) { user_data = l; } long GetUserData() const { return user_data; } + void SetAlignment(int l) { alignment = l; } + int GetAlignment() const { return alignment; } + private: wxWindow* window; // item's associated window @@ -229,6 +243,7 @@ private: bool dropdown; // true if the item has a dropdown button bool sticky; // overrides button states if true (always active) long user_data; // user-specified data + int alignment; // sizer alignment flag, defaults to wxCENTER, may be wxEXPAND or any other }; #ifndef SWIG @@ -558,6 +573,10 @@ public: void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend, const wxAuiToolBarItemArray& append); + // get size of hint rectangle for a particular dock location + wxSize GetHintSize(int dock_direction) const; + bool IsPaneValid(const wxAuiPaneInfo& pane) const; + protected: virtual void OnCustomRender(wxDC& WXUNUSED(dc), @@ -597,6 +616,7 @@ protected: // handlers void OnMiddleUp(wxMouseEvent& evt); void OnMotion(wxMouseEvent& evt); void OnLeaveWindow(wxMouseEvent& evt); + void OnCaptureLost(wxMouseCaptureLostEvent& evt); void OnSetCursor(wxSetCursorEvent& evt); protected: @@ -630,6 +650,18 @@ protected: bool m_overflow_visible; long m_style; + bool RealizeHelper(wxClientDC& dc, bool horizontal); + static bool IsPaneValid(long style, const wxAuiPaneInfo& pane); + bool IsPaneValid(long style) const; + void SetArtFlags() const; + wxOrientation m_orientation; + wxSize m_horzHintSize; + wxSize m_vertHintSize; + +private: + // Common part of OnLeaveWindow() and OnCaptureLost(). + void DoResetMouseState(); + DECLARE_EVENT_TABLE() DECLARE_CLASS(wxAuiToolBar) };