1/////////////////////////////////////////////////////////////////////////////
2// Name:        wx/motif/toolbar.h
3// Purpose:     wxToolBar class
4// Author:      Julian Smart
5// Modified by: 13.12.99 by VZ during toolbar classes reorganization
6// Created:     17/09/98
7// RCS-ID:      $Id: toolbar.h 42077 2006-10-17 14:44:52Z ABX $
8// Copyright:   (c) Julian Smart
9// Licence:     wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_TOOLBAR_H_
13#define _WX_TOOLBAR_H_
14
15class WXDLLEXPORT wxToolBar : public wxToolBarBase
16{
17public:
18    // ctors and dtor
19    wxToolBar() { Init(); }
20
21    wxToolBar(wxWindow *parent,
22        wxWindowID id,
23        const wxPoint& pos = wxDefaultPosition,
24        const wxSize& size = wxDefaultSize,
25        long style = wxNO_BORDER | wxTB_HORIZONTAL,
26        const wxString& name = wxToolBarNameStr)
27    {
28        Init();
29
30        Create(parent, id, pos, size, style, name);
31    }
32
33    bool Create(wxWindow *parent,
34        wxWindowID id,
35        const wxPoint& pos = wxDefaultPosition,
36        const wxSize& size = wxDefaultSize,
37        long style = wxNO_BORDER | wxTB_HORIZONTAL,
38        const wxString& name = wxToolBarNameStr);
39
40    virtual ~wxToolBar();
41
42    // override/implement base class virtuals
43    virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
44
45    virtual bool Realize();
46
47    // implementation from now on
48
49    // find tool by widget
50    wxToolBarToolBase *FindToolByWidget(WXWidget w) const;
51
52private:
53    // common part of all ctors
54    void Init();
55
56    // implement base class pure virtuals
57    virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
58    virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
59
60    virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
61    virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
62    virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
63
64    virtual wxToolBarToolBase *CreateTool(int id,
65                                          const wxString& label,
66                                          const wxBitmap& bmpNormal,
67                                          const wxBitmap& bmpDisabled,
68                                          wxItemKind kind,
69                                          wxObject *clientData,
70                                          const wxString& shortHelp,
71                                          const wxString& longHelp);
72    virtual wxToolBarToolBase *CreateTool(wxControl *control);
73
74    virtual void DoSetSize(int x, int y,
75                           int width, int height,
76                           int sizeFlags = wxSIZE_AUTO);
77private:
78    DECLARE_DYNAMIC_CLASS(wxToolBar)
79};
80
81#endif
82    // _WX_TOOLBAR_H_
83