+IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
+
+// ----------------------------------------------------------------------------
+// private functions
+// ----------------------------------------------------------------------------
+
+static void wxToolButtonCallback (Widget w, XtPointer clientData,
+ XtPointer ptr);
+static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
+ XEvent *event, Boolean *continue_to_dispatch);
+
+// ----------------------------------------------------------------------------
+// private classes
+// ----------------------------------------------------------------------------
+
+class wxToolBarTimer : public wxTimer
+{
+public:
+ virtual void Notify();
+
+ static Widget help_popup;
+ static Widget buttonWidget;
+ static wxString helpString;
+};
+
+class wxToolBarTool : public wxToolBarToolBase
+{
+public:
+ wxToolBarTool(wxToolBar *tbar,
+ int id,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpToggled,
+ wxItemKind kind,
+ wxObject *clientData,
+ const wxString& shortHelp,
+ const wxString& longHelp)
+ : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpToggled, kind,
+ clientData, shortHelp, longHelp)
+ {
+ Init();
+ }
+
+ wxToolBarTool(wxToolBar *tbar, wxControl *control)
+ : wxToolBarToolBase(tbar, control)
+ {
+ Init();
+ }
+
+ virtual ~wxToolBarTool();
+
+ // accessors
+ void SetWidget(Widget widget) { m_widget = widget; }
+ Widget GetButtonWidget() const { return m_widget; }
+
+ Pixmap GetArmPixmap()
+ {
+ m_bitmapCache.SetBitmap( GetNormalBitmap() );
+ return (Pixmap)m_bitmapCache.GetArmPixmap( (WXWidget)m_widget );
+ }
+
+ Pixmap GetInsensPixmap()
+ {
+ m_bitmapCache.SetBitmap( GetNormalBitmap() );
+ return (Pixmap)m_bitmapCache.GetInsensPixmap( (WXWidget)m_widget );
+ }
+protected:
+ void Init();
+
+ Widget m_widget;
+ wxBitmapCache m_bitmapCache;
+};
+
+// ----------------------------------------------------------------------------
+// globals
+// ----------------------------------------------------------------------------
+
+static wxToolBarTimer* wxTheToolBarTimer = (wxToolBarTimer*) NULL;
+
+Widget wxToolBarTimer::help_popup = (Widget) 0;
+Widget wxToolBarTimer::buttonWidget = (Widget) 0;
+wxString wxToolBarTimer::helpString;
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxToolBarTool
+// ----------------------------------------------------------------------------
+
+wxToolBarToolBase *wxToolBar::CreateTool(int id,
+ const wxString& label,
+ const wxBitmap& bmpNormal,
+ const wxBitmap& bmpToggled,
+ wxItemKind kind,
+ wxObject *clientData,
+ const wxString& shortHelp,
+ const wxString& longHelp)
+{
+ return new wxToolBarTool(this, id, label, bmpNormal, bmpToggled, kind,
+ clientData, shortHelp, longHelp);
+}
+
+
+wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
+{
+ return new wxToolBarTool(this, control);
+}