+ wxToolBarBase *GetToolBar() const { return m_tbar; }
+
+ // style
+ int IsButton() const { return m_toolStyle == wxTOOL_STYLE_BUTTON; }
+ int IsControl() const { return m_toolStyle == wxTOOL_STYLE_CONTROL; }
+ int IsSeparator() const { return m_toolStyle == wxTOOL_STYLE_SEPARATOR; }
+ int GetStyle() const { return m_toolStyle; }
+
+ // state
+ bool IsEnabled() const { return m_enabled; }
+ bool IsToggled() const { return m_toggled; }
+ bool CanBeToggled() const { return m_isToggle; }
+
+ // attributes
+ const wxBitmap& GetBitmap1() const { return m_bitmap1; }
+ const wxBitmap& GetBitmap2() const { return m_bitmap2; }
+
+ const wxBitmap& GetBitmap() const
+ { return IsToggled() ? m_bitmap2 : m_bitmap1; }
+
+ wxString GetShortHelp() const { return m_shortHelpString; }
+ wxString GetLongHelp() const { return m_longHelpString; }
+
+ wxObject *GetClientData() const
+ {
+ if ( m_toolStyle == wxTOOL_STYLE_CONTROL )
+ {
+ return (wxObject*)m_control->GetClientData();
+ }
+ else
+ {
+ return m_clientData;
+ }
+ }
+
+ // modifiers: return TRUE if the state really changed
+ bool Enable(bool enable);
+ bool Toggle(bool toggle);
+ bool SetToggle(bool toggle);
+ bool SetShortHelp(const wxString& help);
+ bool SetLongHelp(const wxString& help);
+
+ void Toggle() { Toggle(!IsToggled()); }
+
+ void SetBitmap1(const wxBitmap& bmp) { m_bitmap1 = bmp; }
+ void SetBitmap2(const wxBitmap& bmp) { m_bitmap2 = bmp; }
+
+ void SetClientData(wxObject *clientData)
+ {
+ if ( m_toolStyle == wxTOOL_STYLE_CONTROL )
+ {
+ m_control->SetClientData(clientData);
+ }
+ else
+ {
+ m_clientData = clientData;
+ }
+ }
+
+ // add tool to/remove it from a toolbar
+ virtual void Detach() { m_tbar = (wxToolBarBase *)NULL; }
+ virtual void Attach(wxToolBarBase *tbar) { m_tbar = tbar; }
+
+protected:
+ wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL)
+
+ int m_toolStyle; // see enum wxToolBarToolStyle
+ int m_id; // the tool id, wxID_SEPARATOR for separator