]>
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.
43 Parent window for the tool bar (typically a wxRibbonPanel).
45 Initial position of the tool bar.
47 Initial size of the tool bar.
49 Tool bar style, currently unused.
51 wxRibbonToolBar(wxWindow
* parent
,
52 wxWindowID id
= wxID_ANY
,
53 const wxPoint
& pos
= wxDefaultPosition
,
54 const wxSize
& size
= wxDefaultSize
,
60 virtual ~wxRibbonToolBar();
63 Create a tool bar in two-step tool bar construction.
64 Should only be called when the default constructor is used, and
65 arguments have the same meaning as in the full constructor.
67 bool Create(wxWindow
* parent
,
68 wxWindowID id
= wxID_ANY
,
69 const wxPoint
& pos
= wxDefaultPosition
,
70 const wxSize
& size
= wxDefaultSize
,
74 Add a tool to the tool bar (simple version).
76 virtual wxRibbonToolBarToolBase
* AddTool(
78 const wxBitmap
& bitmap
,
79 const wxString
& help_string
,
80 wxRibbonButtonKind kind
= wxRIBBON_BUTTON_NORMAL
);
83 Add a dropdown tool to the tool bar (simple version).
87 virtual wxRibbonToolBarToolBase
* AddDropdownTool(
89 const wxBitmap
& bitmap
,
90 const wxString
& help_string
= wxEmptyString
);
93 Add a hybrid tool to the tool bar (simple version).
97 virtual wxRibbonToolBarToolBase
* AddHybridTool(
99 const wxBitmap
& bitmap
,
100 const wxString
& help_string
= wxEmptyString
);
103 Add a tool to the tool bar.
106 ID of the new tool (used for event callbacks).
108 Bitmap to use as the foreground for the new tool. Does not have
109 to be the same size as other tool bitmaps, but should be similar
110 as otherwise it will look visually odd.
111 @param bitmap_disabled
112 Bitmap to use when the tool is disabled. If left as wxNullBitmap,
113 then a bitmap will be automatically generated from @a bitmap.
115 The UI help string to associate with the new tool.
117 The kind of tool to add.
119 Client data to associate with the new tool.
121 @return An opaque pointer which can be used only with other tool bar
124 @see AddDropdownTool()
128 virtual wxRibbonToolBarToolBase
* AddTool(
130 const wxBitmap
& bitmap
,
131 const wxBitmap
& bitmap_disabled
= wxNullBitmap
,
132 const wxString
& help_string
= wxEmptyString
,
133 wxRibbonButtonKind kind
= wxRIBBON_BUTTON_NORMAL
,
134 wxObject
* client_data
= NULL
);
137 Add a separator to the tool bar.
139 Separators are used to separate tools into groups. As such, a separator
140 is not explicity drawn, but is visually seen as the gap between tool
143 virtual wxRibbonToolBarToolBase
* AddSeparator();
146 Set the number of rows to distribute tool groups over.
148 Tool groups can be distributed over a variable number of rows. The way
149 in which groups are assigned to rows is not specificed, and the order
150 of groups may change, but they will be distributed in such a way as to
151 minimise the overall size of the tool bar.
154 The minimum number of rows to use.
156 The maximum number of rows to use (defaults to nMin).
158 virtual void SetRows(int nMin
, int nMax
= -1);