X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d9e2e4c2425b8338ff6e6cd2fb62438c9fb2a12b..960b193e59a7700570cfcae914ef2f698e6ba3b8:/include/wx/tbarbase.h diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index 20883df2cd..299a018e23 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -16,7 +16,7 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(__APPLE__) +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "tbarbase.h" #endif @@ -79,6 +79,8 @@ public: { m_tbar = tbar; m_id = toolid; + if (m_id == wxID_ANY) + m_id = wxNewId(); m_clientData = clientData; m_bmpNormal = bmpNormal; @@ -235,7 +237,7 @@ protected: wxString m_shortHelpString; wxString m_longHelpString; - DECLARE_NO_COPY_CLASS(wxToolBarToolBase) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxToolBarToolBase) }; // a list of toolbar tools @@ -370,6 +372,9 @@ public: virtual wxObject *GetToolClientData(int toolid) const; virtual void SetToolClientData(int toolid, wxObject *clientData); + // returns tool pos, or wxNOT_FOUND if tool isn't found + virtual int GetToolPos(int id) const; + // return TRUE if the tool is toggled virtual bool GetToolState(int toolid) const; @@ -424,6 +429,9 @@ public: virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const = 0; + // find the tool by id + wxToolBarToolBase *FindById(int toolid) const; + // return TRUE if this is a vertical toolbar, otherwise FALSE bool IsVertical() const { return HasFlag(wxTB_VERTICAL); } @@ -503,17 +511,6 @@ public: // more deprecated functions // ------------------------- -#if WXWIN_COMPATIBILITY - void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); } - long GetDefaultWidth() const { return m_defaultWidth; } - long GetDefaultHeight() const { return m_defaultHeight; } - int GetDefaultButtonWidth() const { return (int) GetDefaultButtonSize().x; }; - int GetDefaultButtonHeight() const { return (int) GetDefaultButtonSize().y; }; - virtual void SetDefaultSize(const wxSize& size) { SetToolBitmapSize(size); } - virtual wxSize GetDefaultSize() const { return GetToolBitmapSize(); } - virtual wxSize GetDefaultButtonSize() const { return GetToolSize(); } -#endif // WXWIN_COMPATIBILITY - // use GetToolMargins() instead wxSize GetMargins() const { return GetToolMargins(); } @@ -522,10 +519,8 @@ public: size_t GetToolsCount() const { return m_tools.GetCount(); } - void OnIdle(wxIdleEvent& event); - // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) - virtual void DoToolbarUpdates(); + virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) ; // don't want toolbars to accept the focus virtual bool AcceptsFocus() const { return FALSE; } @@ -582,8 +577,8 @@ protected: // helper functions // ---------------- - // find the tool by id - wxToolBarToolBase *FindById(int toolid) const; + // un-toggle all buttons in the same radio group + void UnToggleRadioGroup(wxToolBarToolBase *tool); // the list of all our tools wxToolBarToolsList m_tools; @@ -605,7 +600,7 @@ protected: private: DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxToolBarBase) + DECLARE_NO_COPY_CLASS(wxToolBarBase) }; // Helper function for creating the image for disabled buttons