+// ----------------------------------------------------------------------------
+// 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; }
+
+ void SetPixmap(Pixmap pixmap) { m_pixmap = pixmap; }
+ Pixmap GetPixmap() const { return m_pixmap; }
+
+protected:
+ void Init();
+
+ Widget m_widget;
+ Pixmap m_pixmap;
+};
+
+// ----------------------------------------------------------------------------
+// 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)