// constants
// ----------------------------------------------------------------------------
-extern WXDLLEXPORT_DATA(const wxChar*) wxToolBarNameStr;
+extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[];
extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize;
extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition;
m_tbar = tbar;
m_id = toolid;
if (m_id == wxID_ANY)
- m_id = wxNewId();
+ m_id = wxWindow::NewControlId();
m_clientData = clientData;
m_bmpNormal = bmpNormal;
m_toolStyle = wxTOOL_STYLE_CONTROL;
}
- ~wxToolBarToolBase(){}
+ virtual ~wxToolBarToolBase(){}
// accessors
// ---------
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
- wxDEPRECATED( const wxBitmap& GetBitmap1() const );
- wxDEPRECATED( const wxBitmap& GetBitmap2() const );
-
- wxDEPRECATED( void SetBitmap1(const wxBitmap& bmp) );
- wxDEPRECATED( void SetBitmap2(const wxBitmap& bmp) );
-#endif // WXWIN_COMPATIBILITY_2_2
-
protected:
wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL)
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
// 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);