]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/ribbon/toolbar.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: ribbon/toolbar.h
3 // Purpose: interface of wxRibbonToolBar
4 // Author: Peter Cawley
6 // Licence: wxWindows licence
7 ///////////////////////////////////////////////////////////////////////////////
10 @class wxRibbonToolBar
12 A ribbon tool bar is similar to a traditional toolbar which has no labels.
13 It contains one or more tool groups, each of which contains one or more
14 tools. Each tool is represented by a (generally small, i.e. 16x15) bitmap.
16 @beginEventEmissionTable{wxRibbonToolBarEvent}
17 @event{EVT_RIBBONTOOLBAR_CLICKED(id, func)}
18 Triggered when the normal (non-dropdown) region of a tool on the tool
20 @event{EVT_RIBBONTOOLBAR_DROPDOWN_CLICKED(id, func)}
21 Triggered when the dropdown region of a tool on the tool bar is
22 clicked. wxRibbonToolBarEvent::PopupMenu() should be called by the
23 event handler if it wants to display a popup menu (which is what most
24 dropdown tools should be doing).
30 class wxRibbonToolBar
: public wxRibbonControl
35 With this constructor, Create() should be called in order to create
41 Construct a ribbon tool bar with the given parameters.
44 Parent window for the tool bar (typically a wxRibbonPanel).
46 An identifier for the toolbar. @c wxID_ANY is taken to mean a default.
48 Initial position of the tool bar.
50 Initial size of the tool bar.
52 Tool bar style, currently unused.
54 wxRibbonToolBar(wxWindow
* parent
,
55 wxWindowID id
= wxID_ANY
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
63 virtual ~wxRibbonToolBar();
66 Create a tool bar in two-step tool bar construction.
67 Should only be called when the default constructor is used, and
68 arguments have the same meaning as in the full constructor.
70 bool Create(wxWindow
* parent
,
71 wxWindowID id
= wxID_ANY
,
72 const wxPoint
& pos
= wxDefaultPosition
,
73 const wxSize
& size
= wxDefaultSize
,
77 Add a tool to the tool bar (simple version).
79 virtual wxRibbonToolBarToolBase
* AddTool(
81 const wxBitmap
& bitmap
,
82 const wxString
& help_string
,
83 wxRibbonButtonKind kind
= wxRIBBON_BUTTON_NORMAL
);
86 Add a dropdown tool to the tool bar (simple version).
90 virtual wxRibbonToolBarToolBase
* AddDropdownTool(
92 const wxBitmap
& bitmap
,
93 const wxString
& help_string
= wxEmptyString
);
96 Add a hybrid tool to the tool bar (simple version).
100 virtual wxRibbonToolBarToolBase
* AddHybridTool(
102 const wxBitmap
& bitmap
,
103 const wxString
& help_string
= wxEmptyString
);
106 Add a tool to the tool bar.
109 ID of the new tool (used for event callbacks).
111 Bitmap to use as the foreground for the new tool. Does not have
112 to be the same size as other tool bitmaps, but should be similar
113 as otherwise it will look visually odd.
114 @param bitmap_disabled
115 Bitmap to use when the tool is disabled. If left as wxNullBitmap,
116 then a bitmap will be automatically generated from @a bitmap.
118 The UI help string to associate with the new tool.
120 The kind of tool to add.
122 Client data to associate with the new tool.
124 @return An opaque pointer which can be used only with other tool bar
127 @see AddDropdownTool(), AddHybridTool(), AddSeparator()
129 virtual wxRibbonToolBarToolBase
* AddTool(
131 const wxBitmap
& bitmap
,
132 const wxBitmap
& bitmap_disabled
= wxNullBitmap
,
133 const wxString
& help_string
= wxEmptyString
,
134 wxRibbonButtonKind kind
= wxRIBBON_BUTTON_NORMAL
,
135 wxObject
* client_data
= NULL
);
138 Add a separator to the tool bar.
140 Separators are used to separate tools into groups. As such, a separator
141 is not explicity drawn, but is visually seen as the gap between tool
144 virtual wxRibbonToolBarToolBase
* AddSeparator();
147 Set the number of rows to distribute tool groups over.
149 Tool groups can be distributed over a variable number of rows. The way
150 in which groups are assigned to rows is not specificed, and the order
151 of groups may change, but they will be distributed in such a way as to
152 minimise the overall size of the tool bar.
155 The minimum number of rows to use.
157 The maximum number of rows to use (defaults to nMin).
159 virtual void SetRows(int nMin
, int nMax
= -1);