X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cb719f2e29bd20effa3259d2d7dead9fd857442c..b901ac2c3b618a020f87a4a02555b72c4b41bc21:/include/wx/tbarbase.h diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index 74430da1ad..582fb2da81 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -16,10 +16,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "tbarbase.h" -#endif - #include "wx/defs.h" #if wxUSE_TOOLBAR @@ -36,9 +32,9 @@ class WXDLLEXPORT wxImage; // constants // ---------------------------------------------------------------------------- -WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; -WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize; -WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition; +extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[]; +extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize; +extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition; enum wxToolBarToolStyle { @@ -80,7 +76,7 @@ public: m_tbar = tbar; m_id = toolid; if (m_id == wxID_ANY) - m_id = wxNewId(); + m_id = wxWindow::NewControlId(); m_clientData = clientData; m_bmpNormal = bmpNormal; @@ -109,7 +105,7 @@ public: m_toolStyle = wxTOOL_STYLE_CONTROL; } - ~wxToolBarToolBase(); + virtual ~wxToolBarToolBase(){} // accessors // --------- @@ -151,10 +147,10 @@ public: const wxBitmap& GetBitmap() const { return IsEnabled() ? GetNormalBitmap() : GetDisabledBitmap(); } - wxString GetLabel() const { return m_label; } + const wxString& GetLabel() const { return m_label; } - wxString GetShortHelp() const { return m_shortHelpString; } - wxString GetLongHelp() const { return m_longHelpString; } + const wxString& GetShortHelp() const { return m_shortHelpString; } + const wxString& GetLongHelp() const { return m_longHelpString; } wxObject *GetClientData() const { @@ -198,15 +194,6 @@ public: virtual void Detach() { m_tbar = (wxToolBarBase *)NULL; } virtual void Attach(wxToolBarBase *tbar) { m_tbar = tbar; } - // compatibility only, don't use -#if WXWIN_COMPATIBILITY_2_2 - const wxBitmap& GetBitmap1() const { return GetNormalBitmap(); } - const wxBitmap& GetBitmap2() const { return GetDisabledBitmap(); } - - void SetBitmap1(const wxBitmap& bmp) { SetNormalBitmap(bmp); } - void SetBitmap2(const wxBitmap& bmp) { SetDisabledBitmap(bmp); } -#endif // WXWIN_COMPATIBILITY_2_2 - protected: wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL) @@ -433,7 +420,7 @@ public: wxToolBarToolBase *FindById(int toolid) const; // return true if this is a vertical toolbar, otherwise false - bool IsVertical() const { return HasFlag(wxTB_VERTICAL); } + bool IsVertical() const { return HasFlag(wxTB_LEFT | wxTB_RIGHT); } // the old versions of the various methods kept for compatibility @@ -577,6 +564,13 @@ protected: // helper functions // ---------------- + // call this from derived class ctor/Create() to ensure that we have either + // wxTB_HORIZONTAL or wxTB_VERTICAL style, there is a lot of existing code + // which randomly checks either one or the other of them and gets confused + // if neither is set (and making one of them 0 is not an option neither as + // then the existing tests would break down) + void FixupStyle(); + // un-toggle all buttons in the same radio group void UnToggleRadioGroup(wxToolBarToolBase *tool);