+public:
+ wxToolBarTool(wxToolBar *tbar,
+ int id,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpDisabled,
+ wxItemKind kind,
+ wxObject *clientData,
+ const wxString& shortHelp,
+ const wxString& longHelp)
+ : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpDisabled, kind,
+ clientData, shortHelp, longHelp)
+ {
+ // 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
+// ----------------------------------------------------------------------------