]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/palmos/toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/palmos/toolbar.h
3 // Purpose: wxToolBar class
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "toolbar.h"
21 #include "wx/dynarray.h"
23 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
27 wxToolBar() { Init(); }
29 wxToolBar(wxWindow
*parent
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
34 const wxString
& name
= wxToolBarNameStr
)
38 Create(parent
, id
, pos
, size
, style
, name
);
41 bool Create(wxWindow
*parent
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
46 const wxString
& name
= wxToolBarNameStr
);
50 // override/implement base class virtuals
51 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
53 virtual bool Realize();
55 virtual void SetToolBitmapSize(const wxSize
& size
);
56 virtual wxSize
GetToolSize() const;
58 virtual void SetRows(int nRows
);
60 // implementation only from now on
61 // -------------------------------
63 void OnMouseEvent(wxMouseEvent
& event
);
68 // common part of all ctors
71 // recreate the control completely
74 // implement base class pure virtuals
75 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
76 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
78 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
79 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
80 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
82 virtual wxToolBarToolBase
*CreateTool(int id
,
83 const wxString
& label
,
84 const wxBitmap
& bmpNormal
,
85 const wxBitmap
& bmpDisabled
,
88 const wxString
& shortHelp
,
89 const wxString
& longHelp
);
90 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
92 // return the appropriate size and flags for the toolbar control
93 virtual wxSize
DoGetBestSize() const;
95 // should be called whenever the toolbar size changes
98 // the big bitmap containing all bitmaps of the toolbar buttons
101 // the total number of toolbar elements
104 // the tool the cursor is in
105 wxToolBarToolBase
*m_pInTool
;
108 DECLARE_EVENT_TABLE()
109 DECLARE_DYNAMIC_CLASS(wxToolBar
)
110 DECLARE_NO_COPY_CLASS(wxToolBar
)
113 #endif // wxUSE_TOOLBAR