]>
Commit | Line | Data |
---|---|---|
10b959e3 | 1 | ///////////////////////////////////////////////////////////////////////////// |
8a0681f9 VZ |
2 | // Name: common/tbarbase.cpp |
3 | // Purpose: wxToolBarBase implementation | |
10b959e3 | 4 | // Author: Julian Smart |
8a0681f9 | 5 | // Modified by: VZ at 11.12.99 (wxScrollableToolBar splitted off) |
10b959e3 JS |
6 | // Created: 04/01/98 |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
1c383dba | 9 | // Licence: wxWindows license |
10b959e3 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
8a0681f9 VZ |
12 | // ============================================================================ |
13 | // declarations | |
14 | // ============================================================================ | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // headers | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
10b959e3 | 20 | #ifdef __GNUG__ |
8a0681f9 | 21 | #pragma implementation "tbarbase.h" |
10b959e3 JS |
22 | #endif |
23 | ||
24 | // For compilers that support precompilation, includes "wx.h". | |
25 | #include "wx/wxprec.h" | |
26 | ||
27 | #ifdef __BORLANDC__ | |
8a0681f9 | 28 | #pragma hdrstop |
10b959e3 JS |
29 | #endif |
30 | ||
31 | #ifndef WX_PRECOMP | |
8a0681f9 | 32 | #include "wx/wx.h" |
10b959e3 JS |
33 | #endif |
34 | ||
e702ff0f JS |
35 | #include "wx/frame.h" |
36 | ||
10b959e3 | 37 | // For ::UpdateWindow |
2049ba38 | 38 | #ifdef __WXMSW__ |
10b959e3 JS |
39 | #include <windows.h> |
40 | #endif | |
41 | ||
47d67540 | 42 | #if wxUSE_TOOLBAR |
10b959e3 JS |
43 | |
44 | #include "wx/tbarbase.h" | |
45 | ||
8a0681f9 VZ |
46 | // ---------------------------------------------------------------------------- |
47 | // wxWindows macros | |
48 | // ---------------------------------------------------------------------------- | |
49 | ||
50 | #if !USE_SHARED_LIBRARY | |
51 | BEGIN_EVENT_TABLE(wxToolBarBase, wxControl) | |
52 | EVT_IDLE(wxToolBarBase::OnIdle) | |
53 | END_EVENT_TABLE() | |
4fcd73bd | 54 | #endif |
10b959e3 | 55 | |
8a0681f9 | 56 | #include "wx/listimpl.cpp" |
1c383dba | 57 | |
8a0681f9 | 58 | WX_DEFINE_LIST(wxToolBarToolsList); |
10b959e3 | 59 | |
8a0681f9 VZ |
60 | // ============================================================================ |
61 | // implementation | |
62 | // ============================================================================ | |
10b959e3 | 63 | |
8a0681f9 VZ |
64 | // ---------------------------------------------------------------------------- |
65 | // wxToolBarToolBase | |
66 | // ---------------------------------------------------------------------------- | |
10b959e3 | 67 | |
8a0681f9 | 68 | bool wxToolBarToolBase::Enable(bool enable) |
10b959e3 | 69 | { |
8a0681f9 VZ |
70 | if ( m_enabled == enable ) |
71 | return FALSE; | |
10b959e3 | 72 | |
8a0681f9 | 73 | m_enabled = enable; |
10b959e3 | 74 | |
8a0681f9 | 75 | return TRUE; |
10b959e3 JS |
76 | } |
77 | ||
8a0681f9 | 78 | bool wxToolBarToolBase::Toggle(bool toggle) |
10b959e3 | 79 | { |
8a0681f9 VZ |
80 | wxASSERT_MSG( m_isToggle, _T("can't toggle this tool") ); |
81 | ||
82 | if ( m_toggled == toggle ) | |
83 | return FALSE; | |
10b959e3 | 84 | |
8a0681f9 VZ |
85 | m_toggled = toggle; |
86 | ||
87 | return TRUE; | |
10b959e3 JS |
88 | } |
89 | ||
8a0681f9 | 90 | bool wxToolBarToolBase::SetToggle(bool toggle) |
10b959e3 | 91 | { |
8a0681f9 VZ |
92 | if ( m_isToggle == toggle ) |
93 | return FALSE; | |
10b959e3 | 94 | |
8a0681f9 | 95 | m_isToggle = toggle; |
10b959e3 JS |
96 | |
97 | return TRUE; | |
98 | } | |
99 | ||
8a0681f9 | 100 | bool wxToolBarToolBase::SetShortHelp(const wxString& help) |
10b959e3 | 101 | { |
8a0681f9 VZ |
102 | if ( m_shortHelpString == help ) |
103 | return FALSE; | |
10b959e3 | 104 | |
8a0681f9 VZ |
105 | m_shortHelpString = help; |
106 | ||
107 | return TRUE; | |
10b959e3 JS |
108 | } |
109 | ||
8a0681f9 | 110 | bool wxToolBarToolBase::SetLongHelp(const wxString& help) |
10b959e3 | 111 | { |
8a0681f9 VZ |
112 | if ( m_longHelpString == help ) |
113 | return FALSE; | |
10b959e3 | 114 | |
8a0681f9 VZ |
115 | m_longHelpString = help; |
116 | ||
117 | return TRUE; | |
10b959e3 JS |
118 | } |
119 | ||
8a0681f9 | 120 | wxToolBarToolBase::~wxToolBarToolBase() |
10b959e3 | 121 | { |
8a0681f9 | 122 | } |
10b959e3 | 123 | |
8a0681f9 VZ |
124 | // ---------------------------------------------------------------------------- |
125 | // wxToolBarBase adding/deleting items | |
126 | // ---------------------------------------------------------------------------- | |
ac91b9d2 | 127 | |
8a0681f9 VZ |
128 | wxToolBarBase::wxToolBarBase() |
129 | { | |
130 | // the list owns the pointers | |
131 | m_tools.DeleteContents(TRUE); | |
10b959e3 | 132 | |
8a0681f9 | 133 | m_xMargin = m_yMargin = 0; |
10b959e3 | 134 | |
8a0681f9 | 135 | m_maxRows = m_maxCols = 0; |
10b959e3 JS |
136 | } |
137 | ||
8a0681f9 VZ |
138 | wxToolBarToolBase *wxToolBarBase::AddTool(int id, |
139 | const wxBitmap& bitmap, | |
140 | const wxBitmap& pushedBitmap, | |
141 | bool toggle, | |
142 | wxCoord WXUNUSED(xPos), | |
143 | wxCoord WXUNUSED(yPos), | |
144 | wxObject *clientData, | |
145 | const wxString& helpString1, | |
146 | const wxString& helpString2) | |
10b959e3 | 147 | { |
8a0681f9 VZ |
148 | return InsertTool(GetToolsCount(), id, bitmap, pushedBitmap, |
149 | toggle, clientData, helpString1, helpString2); | |
10b959e3 JS |
150 | } |
151 | ||
8a0681f9 VZ |
152 | wxToolBarToolBase *wxToolBarBase::InsertTool(size_t pos, |
153 | int id, | |
154 | const wxBitmap& bitmap, | |
155 | const wxBitmap& pushedBitmap, | |
156 | bool toggle, | |
157 | wxObject *clientData, | |
158 | const wxString& helpString1, | |
159 | const wxString& helpString2) | |
10b959e3 | 160 | { |
8a0681f9 VZ |
161 | wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, |
162 | _T("invalid position in wxToolBar::InsertTool()") ); | |
163 | ||
164 | wxToolBarToolBase *tool = CreateTool(id, bitmap, pushedBitmap, toggle, | |
165 | clientData, helpString1, helpString2); | |
166 | ||
167 | if ( !tool || !DoInsertTool(pos, tool) ) | |
168 | { | |
169 | delete tool; | |
170 | ||
171 | return NULL; | |
172 | } | |
173 | ||
174 | m_tools.Insert(pos, tool); | |
175 | ||
176 | return tool; | |
10b959e3 JS |
177 | } |
178 | ||
8a0681f9 | 179 | wxToolBarToolBase *wxToolBarBase::AddControl(wxControl *control) |
10b959e3 | 180 | { |
8a0681f9 | 181 | return InsertControl(GetToolsCount(), control); |
10b959e3 JS |
182 | } |
183 | ||
8a0681f9 | 184 | wxToolBarToolBase *wxToolBarBase::InsertControl(size_t pos, wxControl *control) |
10b959e3 | 185 | { |
8a0681f9 VZ |
186 | wxCHECK_MSG( control, (wxToolBarToolBase *)NULL, |
187 | _T("toolbar: can't insert NULL control") ); | |
188 | ||
189 | wxCHECK_MSG( control->GetParent() == this, (wxToolBarToolBase *)NULL, | |
190 | _T("control must have toolbar as parent") ); | |
191 | ||
192 | wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, | |
193 | _T("invalid position in wxToolBar::InsertControl()") ); | |
194 | ||
195 | wxToolBarToolBase *tool = CreateTool(control); | |
196 | ||
197 | if ( !tool || !DoInsertTool(pos, tool) ) | |
198 | { | |
199 | delete tool; | |
200 | ||
201 | return NULL; | |
202 | } | |
203 | ||
204 | m_tools.Insert(pos, tool); | |
205 | ||
206 | return tool; | |
10b959e3 JS |
207 | } |
208 | ||
8a0681f9 | 209 | wxToolBarToolBase *wxToolBarBase::AddSeparator() |
10b959e3 | 210 | { |
8a0681f9 | 211 | return InsertSeparator(GetToolsCount()); |
10b959e3 JS |
212 | } |
213 | ||
8a0681f9 | 214 | wxToolBarToolBase *wxToolBarBase::InsertSeparator(size_t pos) |
10b959e3 | 215 | { |
8a0681f9 VZ |
216 | wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, |
217 | _T("invalid position in wxToolBar::InsertSeparator()") ); | |
218 | ||
219 | wxToolBarToolBase *tool = CreateTool(wxID_SEPARATOR, | |
220 | wxNullBitmap, wxNullBitmap, | |
221 | FALSE, (wxObject *)NULL, | |
222 | wxEmptyString, wxEmptyString); | |
223 | ||
224 | if ( !tool || !DoInsertTool(pos, tool) ) | |
10b959e3 | 225 | { |
8a0681f9 VZ |
226 | delete tool; |
227 | ||
228 | return NULL; | |
10b959e3 | 229 | } |
8a0681f9 VZ |
230 | |
231 | m_tools.Insert(pos, tool); | |
232 | ||
233 | return tool; | |
10b959e3 JS |
234 | } |
235 | ||
8a0681f9 | 236 | wxToolBarToolBase *wxToolBarBase::RemoveTool(int id) |
10b959e3 | 237 | { |
8a0681f9 VZ |
238 | size_t pos = 0; |
239 | wxToolBarToolsList::Node *node; | |
240 | for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) | |
10b959e3 | 241 | { |
8a0681f9 VZ |
242 | if ( node->GetData()->GetId() == id ) |
243 | break; | |
244 | ||
245 | pos++; | |
10b959e3 | 246 | } |
10b959e3 | 247 | |
8a0681f9 | 248 | if ( !node ) |
10b959e3 | 249 | { |
8a0681f9 VZ |
250 | // don't give any error messages - sometimes we might call RemoveTool() |
251 | // without knowing whether the tool is or not in the toolbar | |
252 | return (wxToolBarToolBase *)NULL; | |
10b959e3 | 253 | } |
10b959e3 | 254 | |
8a0681f9 VZ |
255 | wxToolBarToolBase *tool = node->GetData(); |
256 | if ( !DoDeleteTool(pos, tool) ) | |
257 | { | |
258 | return (wxToolBarToolBase *)NULL; | |
259 | } | |
10b959e3 | 260 | |
8a0681f9 VZ |
261 | // the node would delete the data, so set it to NULL to avoid this |
262 | node->SetData(NULL); | |
10b959e3 | 263 | |
8a0681f9 | 264 | m_tools.DeleteNode(node); |
10b959e3 | 265 | |
8a0681f9 | 266 | return tool; |
10b959e3 JS |
267 | } |
268 | ||
8a0681f9 | 269 | bool wxToolBarBase::DeleteToolByPos(size_t pos) |
10b959e3 | 270 | { |
8a0681f9 VZ |
271 | wxCHECK_MSG( pos < GetToolsCount(), FALSE, |
272 | _T("invalid position in wxToolBar::DeleteToolByPos()") ); | |
10b959e3 | 273 | |
8a0681f9 | 274 | wxToolBarToolsList::Node *node = m_tools.Item(pos); |
10b959e3 | 275 | |
8a0681f9 VZ |
276 | if ( !DoDeleteTool(pos, node->GetData()) ) |
277 | { | |
278 | return FALSE; | |
279 | } | |
280 | ||
281 | m_tools.DeleteNode(node); | |
282 | ||
283 | return TRUE; | |
10b959e3 JS |
284 | } |
285 | ||
8a0681f9 | 286 | bool wxToolBarBase::DeleteTool(int id) |
10b959e3 | 287 | { |
8a0681f9 VZ |
288 | size_t pos = 0; |
289 | wxToolBarToolsList::Node *node; | |
290 | for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) | |
291 | { | |
292 | if ( node->GetData()->GetId() == id ) | |
293 | break; | |
294 | ||
295 | pos++; | |
296 | } | |
297 | ||
298 | if ( !node || !DoDeleteTool(pos, node->GetData()) ) | |
299 | { | |
300 | return FALSE; | |
301 | } | |
302 | ||
303 | m_tools.DeleteNode(node); | |
304 | ||
305 | return TRUE; | |
10b959e3 JS |
306 | } |
307 | ||
8a0681f9 | 308 | wxToolBarToolBase *wxToolBarBase::FindById(int id) const |
10b959e3 | 309 | { |
8a0681f9 VZ |
310 | wxToolBarToolBase *tool = (wxToolBarToolBase *)NULL; |
311 | ||
312 | for ( wxToolBarToolsList::Node *node = m_tools.GetFirst(); | |
313 | node; | |
314 | node = node->GetNext() ) | |
315 | { | |
316 | tool = node->GetData(); | |
317 | if ( tool->GetId() == id ) | |
318 | { | |
319 | // found | |
320 | break; | |
321 | } | |
322 | } | |
323 | ||
324 | return tool; | |
10b959e3 JS |
325 | } |
326 | ||
8a0681f9 | 327 | void wxToolBarBase::ClearTools() |
10b959e3 | 328 | { |
8a0681f9 | 329 | m_tools.Clear(); |
10b959e3 JS |
330 | } |
331 | ||
8a0681f9 | 332 | bool wxToolBarBase::Realize() |
10b959e3 | 333 | { |
8a0681f9 | 334 | return TRUE; |
10b959e3 JS |
335 | } |
336 | ||
8a0681f9 | 337 | wxToolBarBase::~wxToolBarBase() |
10b959e3 | 338 | { |
10b959e3 JS |
339 | } |
340 | ||
8a0681f9 VZ |
341 | // ---------------------------------------------------------------------------- |
342 | // wxToolBarBase tools state | |
343 | // ---------------------------------------------------------------------------- | |
10b959e3 | 344 | |
8a0681f9 | 345 | void wxToolBarBase::EnableTool(int id, bool enable) |
10b959e3 | 346 | { |
8a0681f9 VZ |
347 | wxToolBarToolBase *tool = FindById(id); |
348 | if ( tool ) | |
10b959e3 | 349 | { |
8a0681f9 VZ |
350 | if ( tool->Enable(enable) ) |
351 | { | |
352 | DoEnableTool(tool, enable); | |
353 | } | |
10b959e3 | 354 | } |
8a0681f9 | 355 | } |
10b959e3 | 356 | |
8a0681f9 VZ |
357 | void wxToolBarBase::ToggleTool(int id, bool toggle) |
358 | { | |
359 | wxToolBarToolBase *tool = FindById(id); | |
360 | if ( tool && tool->CanBeToggled() ) | |
10b959e3 | 361 | { |
8a0681f9 VZ |
362 | if ( tool->Toggle(toggle) ) |
363 | { | |
364 | DoToggleTool(tool, toggle); | |
365 | } | |
10b959e3 | 366 | } |
10b959e3 JS |
367 | } |
368 | ||
8a0681f9 VZ |
369 | void wxToolBarBase::SetToggle(int id, bool toggle) |
370 | { | |
371 | wxToolBarToolBase *tool = FindById(id); | |
372 | if ( tool ) | |
10b959e3 | 373 | { |
8a0681f9 VZ |
374 | if ( tool->SetToggle(toggle) ) |
375 | { | |
376 | DoSetToggle(tool, toggle); | |
377 | } | |
10b959e3 | 378 | } |
8a0681f9 VZ |
379 | } |
380 | ||
381 | void wxToolBarBase::SetToolShortHelp(int id, const wxString& help) | |
382 | { | |
383 | wxToolBarToolBase *tool = FindById(id); | |
384 | if ( tool ) | |
10b959e3 | 385 | { |
8a0681f9 | 386 | (void)tool->SetShortHelp(help); |
10b959e3 | 387 | } |
8a0681f9 VZ |
388 | } |
389 | ||
390 | void wxToolBarBase::SetToolLongHelp(int id, const wxString& help) | |
391 | { | |
392 | wxToolBarToolBase *tool = FindById(id); | |
393 | if ( tool ) | |
10b959e3 | 394 | { |
8a0681f9 | 395 | (void)tool->SetLongHelp(help); |
10b959e3 | 396 | } |
10b959e3 JS |
397 | } |
398 | ||
8a0681f9 | 399 | wxObject *wxToolBarBase::GetToolClientData(int id) const |
10b959e3 | 400 | { |
8a0681f9 VZ |
401 | wxToolBarToolBase *tool = FindById(id); |
402 | ||
403 | return tool ? tool->GetClientData() : (wxObject *)NULL; | |
10b959e3 JS |
404 | } |
405 | ||
8a0681f9 | 406 | bool wxToolBarBase::GetToolState(int id) const |
10b959e3 | 407 | { |
8a0681f9 VZ |
408 | wxToolBarToolBase *tool = FindById(id); |
409 | wxCHECK_MSG( tool, FALSE, _T("no such tool") ); | |
410 | ||
411 | return tool->IsToggled(); | |
10b959e3 JS |
412 | } |
413 | ||
8a0681f9 | 414 | bool wxToolBarBase::GetToolEnabled(int id) const |
10b959e3 | 415 | { |
8a0681f9 VZ |
416 | wxToolBarToolBase *tool = FindById(id); |
417 | wxCHECK_MSG( tool, FALSE, _T("no such tool") ); | |
418 | ||
419 | return tool->IsEnabled(); | |
10b959e3 JS |
420 | } |
421 | ||
8a0681f9 | 422 | wxString wxToolBarBase::GetToolShortHelp(int id) const |
10b959e3 | 423 | { |
8a0681f9 VZ |
424 | wxToolBarToolBase *tool = FindById(id); |
425 | wxCHECK_MSG( tool, _T(""), _T("no such tool") ); | |
426 | ||
427 | return tool->GetShortHelp(); | |
10b959e3 JS |
428 | } |
429 | ||
8a0681f9 | 430 | wxString wxToolBarBase::GetToolLongHelp(int id) const |
10b959e3 | 431 | { |
8a0681f9 VZ |
432 | wxToolBarToolBase *tool = FindById(id); |
433 | wxCHECK_MSG( tool, _T(""), _T("no such tool") ); | |
10b959e3 | 434 | |
8a0681f9 | 435 | return tool->GetLongHelp(); |
10b959e3 JS |
436 | } |
437 | ||
8a0681f9 VZ |
438 | // ---------------------------------------------------------------------------- |
439 | // wxToolBarBase geometry | |
440 | // ---------------------------------------------------------------------------- | |
441 | ||
442 | void wxToolBarBase::SetMargins(int x, int y) | |
10b959e3 | 443 | { |
8a0681f9 VZ |
444 | m_xMargin = x; |
445 | m_yMargin = y; | |
10b959e3 JS |
446 | } |
447 | ||
8a0681f9 | 448 | void wxToolBarBase::SetRows(int WXUNUSED(nRows)) |
10b959e3 | 449 | { |
8a0681f9 | 450 | // nothing |
10b959e3 JS |
451 | } |
452 | ||
8a0681f9 VZ |
453 | // ---------------------------------------------------------------------------- |
454 | // event processing | |
455 | // ---------------------------------------------------------------------------- | |
456 | ||
457 | // Only allow toggle if returns TRUE | |
458 | bool wxToolBarBase::OnLeftClick(int id, bool toggleDown) | |
10b959e3 | 459 | { |
8a0681f9 VZ |
460 | wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, id); |
461 | event.SetEventObject(this); | |
462 | event.SetExtraLong((long) toggleDown); | |
463 | ||
464 | // Send events to this toolbar instead (and thence up the window hierarchy) | |
465 | GetEventHandler()->ProcessEvent(event); | |
466 | ||
467 | return TRUE; | |
10b959e3 JS |
468 | } |
469 | ||
8a0681f9 VZ |
470 | // Call when right button down. |
471 | void wxToolBarBase::OnRightClick(int id, | |
472 | long WXUNUSED(x), | |
473 | long WXUNUSED(y)) | |
10b959e3 | 474 | { |
8a0681f9 VZ |
475 | wxCommandEvent event(wxEVT_COMMAND_TOOL_RCLICKED, id); |
476 | event.SetEventObject(this); | |
477 | event.SetInt(id); | |
478 | ||
479 | GetEventHandler()->ProcessEvent(event); | |
480 | } | |
43d811ea | 481 | |
8a0681f9 VZ |
482 | // Called when the mouse cursor enters a tool bitmap (no button pressed). |
483 | // Argument is -1 if mouse is exiting the toolbar. | |
484 | // Note that for this event, the id of the window is used, | |
485 | // and the integer parameter of wxCommandEvent is used to retrieve | |
486 | // the tool id. | |
487 | void wxToolBarBase::OnMouseEnter(int id) | |
488 | { | |
489 | wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, GetId()); | |
490 | event.SetEventObject(this); | |
491 | event.SetInt(id); | |
492 | ||
493 | (void)GetEventHandler()->ProcessEvent(event); | |
494 | ||
495 | wxToolBarToolBase *tool = FindById(id); | |
496 | if ( !tool || !tool->GetLongHelp() ) | |
497 | return; | |
498 | ||
499 | wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); | |
500 | if ( !frame ) | |
501 | return; | |
502 | ||
503 | frame->SetStatusText(tool->GetLongHelp()); | |
504 | } | |
505 | ||
506 | // ---------------------------------------------------------------------------- | |
507 | // UI updates | |
508 | // ---------------------------------------------------------------------------- | |
509 | ||
510 | void wxToolBarBase::OnIdle(wxIdleEvent& event) | |
511 | { | |
ac91b9d2 | 512 | DoToolbarUpdates(); |
8a0681f9 VZ |
513 | |
514 | event.Skip(); | |
10b959e3 JS |
515 | } |
516 | ||
517 | // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) | |
ac91b9d2 VZ |
518 | void wxToolBarBase::DoToolbarUpdates() |
519 | { | |
8a0681f9 | 520 | wxEvtHandler* evtHandler = GetEventHandler(); |
e702ff0f | 521 | |
8a0681f9 VZ |
522 | for ( wxToolBarToolsList::Node* node = m_tools.GetFirst(); |
523 | node; | |
524 | node = node->GetNext() ) | |
ac91b9d2 | 525 | { |
8a0681f9 | 526 | int id = node->GetData()->GetId(); |
ac91b9d2 | 527 | |
8a0681f9 | 528 | wxUpdateUIEvent event(id); |
ac91b9d2 VZ |
529 | event.SetEventObject(this); |
530 | ||
8a0681f9 | 531 | if ( evtHandler->ProcessEvent(event) ) |
ac91b9d2 | 532 | { |
8a0681f9 VZ |
533 | if ( event.GetSetEnabled() ) |
534 | EnableTool(id, event.GetEnabled()); | |
535 | if ( event.GetSetChecked() ) | |
536 | ToggleTool(id, event.GetChecked()); | |
537 | #if 0 | |
538 | if ( event.GetSetText() ) | |
ac91b9d2 | 539 | // Set tooltip? |
8a0681f9 | 540 | #endif // 0 |
ac91b9d2 | 541 | } |
ac91b9d2 | 542 | } |
10b959e3 JS |
543 | } |
544 | ||
8a0681f9 | 545 | #endif // wxUSE_TOOLBAR |