+public:
+ wxToolBarTool( wxToolBarBase *tbar = (wxToolBarBase *)NULL,
+ int id = wxID_SEPARATOR,
+ const wxBitmap& bitmap1 = wxNullBitmap,
+ const wxBitmap& bitmap2 = wxNullBitmap,
+ bool toggle = FALSE,
+ wxObject *clientData = (wxObject *) NULL,
+ const wxString& shortHelpString = wxEmptyString,
+ const wxString& longHelpString = wxEmptyString )
+ : wxToolBarToolBase(tbar, id, bitmap1, bitmap2, toggle, clientData,
+ shortHelpString, longHelpString)
+ {
+ // no position yet
+ m_x =
+ m_y = -1;
+
+ // not pressed yet
+ m_isInverted = FALSE;
+ }
+
+ // is this tool pressed, even temporarily? (this is different from being
+ // permanently toggled which is what IsToggled() returns)
+ bool IsPressed() const
+ { return CanBeToggled() ? IsToggled() != m_isInverted : m_isInverted; }
+
+ // are we temporarily pressed/unpressed?
+ bool IsInverted() const { return m_isInverted; }
+
+ // press the tool temporarily by inverting its toggle state
+ void Invert() { m_isInverted = !m_isInverted; }
+
+public:
+ // the tool position (the size is known by the toolbar itself)
+ int m_x,
+ m_y;
+
+private:
+ // TRUE if the tool is pressed
+ bool m_isInverted;
+};
+
+// ============================================================================
+// wxToolBar implementation
+// ============================================================================
+
+IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl);
+
+// ----------------------------------------------------------------------------
+// wxToolBar creation
+// ----------------------------------------------------------------------------