114 const wxPoint &pos = wxDefaultPosition,
115 const wxSize &size = wxDefaultSize,
116 long style = wxNO_BORDER,
int orient = wxTB_HORIZONTAL)
120 Create(parent, winid, pos, size, style, orient);
124 const wxPoint &pos = wxDefaultPosition,
125 const wxSize &size = wxDefaultSize,
long style = wxNO_BORDER,
126 int orient = wxTB_HORIZONTAL);
130 virtual void SetToggledBackgroundColour(wxColour c) {
131 m_toggle_bg_color = c;
133 virtual void SetBackgroundColour(wxColour c) { m_background_color = c; }
134 virtual wxColour GetBackgroundColour() {
return m_background_color; }
135 virtual void SetColorScheme(ColorScheme cs);
138 bool OnMouseEvent(wxMouseEvent &event, wxPoint &position);
139 void OnToolTipTimerEvent(wxTimerEvent &event);
140 void OnToolTipOffTimerEvent(wxTimerEvent &event);
142 wxToolBarToolBase *AddTool(
int toolid,
const wxString &label,
143 const wxBitmap &bitmap,
144 const wxBitmap &bmpDisabled,
145 wxItemKind kind = wxITEM_NORMAL,
146 const wxString &shortHelp =
"",
147 const wxString &longHelp =
"",
148 wxObject *data = NULL);
150 wxToolBarToolBase *AddTool(
int toolid,
const wxString &label,
151 const wxBitmap &bitmap,
152 const wxString &shortHelp =
"",
153 wxItemKind kind = wxITEM_NORMAL) {
154 return AddTool(toolid, label, bitmap, wxNullBitmap, kind, shortHelp);
157 wxToolBarToolBase *InsertTool(
size_t pos,
int id,
const wxString &label,
158 const wxBitmap &bitmap,
159 const wxBitmap &bmpDisabled, wxItemKind kind,
160 const wxString &shortHelp,
161 const wxString &longHelp, wxObject *clientData);
163 wxToolBarToolBase *InsertTool(
size_t pos, wxToolBarToolBase *tool);
166 virtual bool OnLeftClick(
int toolid,
bool toggleDown);
169 virtual void OnRightClick(
int toolid,
long x,
long y);
171 virtual void DoPluginToolUp();
173 bool IsDirty() {
return m_dirty; }
174 void SetDirty(
bool value) { m_dirty = value; }
176 size_t GetToolsCount()
const {
return m_tools.GetCount(); }
177 void SetToolShowCount(
int count) { m_nShowTools = count; }
178 int GetToolShowCount() {
return m_nShowTools; }
180 int GetNoRowsOrColumns() {
return m_currentRowsOrColumns; };
181 int GetLineCount() {
return m_LineCount; };
182 int GetVisibleToolCount();
184 void SetToolNormalBitmapEx(wxToolBarToolBase *tool,
const wxString &iconname);
185 void SetToolNormalBitmapSVG(wxToolBarToolBase *tool, wxString fileSVG);
187 void EnableRolloverBitmaps(
bool enable) {
188 m_tbenableRolloverBitmaps = enable;
191 wxBitmap &GetBitmap() {
return m_bitmap; }
194 virtual wxControl *FindControl(
int toolid);
197 virtual wxToolBarToolBase *AddSeparator();
198 virtual wxToolBarToolBase *InsertSeparator(
size_t pos);
202 virtual wxToolBarToolBase *RemoveTool(
int toolid);
205 virtual bool DeleteToolByPos(
size_t pos);
206 virtual bool DeleteTool(
int toolid);
209 virtual void ClearTools();
213 virtual bool Realize();
218 virtual void EnableTool(
int toolid,
bool enable);
219 virtual void ToggleTool(
int toolid,
bool toggle);
221 virtual void SetToolBitmaps(
int toolid, wxBitmap *bmp, wxBitmap *bmpRollover);
222 virtual void SetToolBitmapsSVG(
int id, wxString fileSVGNormal,
223 wxString fileSVGRollover,
224 wxString fileSVGToggled);
226 void InvalidateBitmaps();
227 wxBitmap &CreateBitmap(
double display_scale = 1.0);
230 virtual wxObject *GetToolClientData(
int toolid)
const;
231 virtual void SetToolClientData(
int toolid, wxObject *clientData);
234 virtual int GetToolPos(
int id)
const;
237 virtual bool GetToolState(
int toolid)
const;
239 virtual bool GetToolEnabled(
int toolid)
const;
241 virtual void SetToolShortHelp(
int toolid,
const wxString &helpString);
242 virtual wxString GetToolShortHelp(
int toolid)
const;
243 virtual void SetToolLongHelp(
int toolid,
const wxString &helpString);
244 virtual wxString GetToolLongHelp(
int toolid)
const;
246 virtual void SetToolTooltipHiViz(
int id,
bool b_hiviz);
248 virtual void SetSizeFactor(
float factor) {
249 m_sizefactor = factor;
256 void SetMaxRowsCols(
int rows,
int cols) {
260 int GetMaxRows()
const {
return m_maxRows; }
261 int GetMaxCols()
const {
return m_maxCols; }
265 virtual void SetToolBitmapSize(
const wxSize &size) {
266 m_defaultWidth = size.x;
267 m_defaultHeight = size.y;
269 virtual wxSize GetToolBitmapSize()
const {
270 return wxSize(m_defaultWidth, m_defaultHeight);
275 virtual wxSize GetToolSize()
const {
return GetToolBitmapSize(); }
277 virtual wxRect GetToolRect(
int tool_id);
281 wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
284 wxToolBarToolBase *FindById(
int toolid)
const;
287 bool IsVertical()
const {
return m_orient == wxTB_VERTICAL; }
290 wxToolBarToolsList m_tools;
299 wxCoord m_defaultWidth, m_defaultHeight;
302 wxCoord m_maxWidth, m_maxHeight;
306 void EnableTooltips();
307 void DisableTooltips();
314 virtual wxToolBarToolBase *DoAddTool(
315 int toolid,
const wxString &label,
const wxBitmap &bitmap,
316 const wxBitmap &bmpDisabled, wxItemKind kind,
317 const wxString &shortHelp =
"",
const wxString &longHelp =
"",
318 wxObject *clientData = NULL, wxCoord xPos = wxDefaultCoord,
319 wxCoord yPos = wxDefaultCoord);
321 virtual bool DoInsertTool(
size_t pos, wxToolBarToolBase *tool);
322 virtual bool DoDeleteTool(
size_t pos, wxToolBarToolBase *tool);
324 virtual void DoEnableTool(wxToolBarToolBase *tool,
bool enable);
325 virtual void DoToggleTool(wxToolBarToolBase *tool,
bool toggle);
327 virtual wxToolBarToolBase *CreateTool(
int winid,
const wxString &label,
328 const wxBitmap &bmpNormal,
329 const wxBitmap &bmpDisabled,
330 wxItemKind kind, wxObject *clientData,
331 const wxString &shortHelp,
332 const wxString &longHelp);
335 void DrawTool(wxToolBarToolBase *tool);
336 virtual void DrawTool(wxDC &dc, wxToolBarToolBase *tool);
337 void CreateToolBitmap(wxToolBarToolBase *toolBase);
340 int m_currentRowsOrColumns;
343 int m_pressedTool, m_currentTool;
345 wxCoord m_lastX, m_lastY;
346 wxCoord m_xPos, m_yPos;
348 wxColour m_toggle_bg_color;
349 wxColour m_toolOutlineColour;
350 wxColour m_background_color;
354 ColorScheme m_currentColorScheme;
356 wxTimer m_tooltip_timer;
358 wxTimer m_tooltipoff_timer;
360 bool m_btooltip_show;
362 bool m_btoolbar_is_zooming;
369 int m_last_plugin_down_id;
372 bool m_tbenableRolloverBitmaps;
377 DECLARE_EVENT_TABLE()
396 void OnClose(wxCloseEvent &event);
397 void OnWindowCreate(wxWindowCreateEvent &event);
398 void OnToolLeftClick(wxCommandEvent &event);
399 virtual void OnKeyDown(wxKeyEvent &event);
400 virtual void OnKeyUp(wxKeyEvent &event);
401 void OldMouseEvent(wxMouseEvent &event);
402 bool MouseEvent(wxMouseEvent &event);
403 void FadeTimerEvent(wxTimerEvent &event);
404 bool IsToolbarShown() {
return (m_ptoolbar != 0); }
405 float GetScaleFactor() {
return m_sizefactor; }
406 void DestroyTimerEvent(wxTimerEvent &event);
407 void DrawDC(
ocpnDC &dc,
double displayScale);
408 void DrawGL(
ocpnDC &gldc,
double displayScale);
410 void RefreshFadeTimer();
412 void EnableSubmerge(
bool enable) { m_benableSubmerge = enable; }
416 void SetToolbarHideMethod(
int n_method) { n_toolbarHideMethod = n_method; }
418 void SetToolConfigString(wxString
string) { m_configString = string; }
419 wxString GetToolConfigString() {
return m_configString; }
421 float GetSizeFactor() {
return m_sizefactor; }
423 void CreateConfigMenu();
426 void RefreshToolbar();
432 void EnableTooltips() {
433 if (m_ptoolbar) m_ptoolbar->EnableTooltips();
435 void DisableTooltips() {
436 if (m_ptoolbar) m_ptoolbar->DisableTooltips();
438 void UpdateRecoveryWindow(
bool b_toolbarEnable);
439 void EnableTool(
int toolid,
bool enable);
440 void SetToolShortHelp(
int toolid,
const wxString &helpString);
442 void DestroyToolBar();
443 void ToggleOrientation();
444 void MoveDialogInScreenCoords(wxPoint posn, wxPoint posn_old);
445 void SetDefaultPosition();
446 void LockPosition(
bool lock) { m_block = lock; }
447 virtual void SetColorScheme(ColorScheme cs);
448 ColorScheme GetColorScheme() {
return m_cs; }
449 bool CheckSurfaceRequest(wxMouseEvent &event);
450 void GetFrameRelativePosition(
int *x,
int *y);
451 void RestoreRelativePosition(
int x,
int y);
453 void SetGeometry(
bool bAvoid, wxRect rectAvoid);
454 void SetMinX(
int offset) { m_dock_min_x = offset; }
455 void SetMinY(
int offset) { m_dock_min_y = offset; }
456 long GetOrient() {
return m_orient; }
457 wxSize GetToolSize();
458 wxRect GetToolbarRect();
459 wxSize GetToolbarSize();
460 wxPoint GetToolbarPosition();
462 void SetAutoHideTimer(
int time);
463 void SetAutoHide(
bool hide) { m_bAutoHideToolbar = hide; }
465 size_t GetToolCount();
466 void SetToolShowMask(wxString mask);
467 wxString GetToolShowMask() {
return m_toolShowMask; }
469 void SetToolShowCount(
int count);
470 int GetToolShowCount();
475 int GetDockX() {
return m_dock_x; }
476 int GetDockY() {
return m_dock_y; }
477 void SetDockX(
int x) { m_dock_x = x; }
478 void SetDockY(
int y) { m_dock_y = y; }
480 void SetYAuxOffset(
int offset) { m_auxOffsetY = offset; }
482 void SetCanToggleOrientation(
bool enable) { b_canToggleOrientation = enable; }
483 bool GetCanToggleOrientation() {
return b_canToggleOrientation; }
485 bool toolbarConfigChanged;
487 wxMenu *m_FloatingToolbarConfigMenu;
489 wxString m_tblastAISiconName;
490 wxToolBarToolBase *m_pTBAISTool;
491 bool m_toolbar_scale_tools_shown;
492 void SetBackGroundColorString(wxString colorRef);
493 void SetULDockPosition(wxPoint position);
495 ArrayOfToolbarItemContainer m_Items;
498 int RebuildToolbar();
499 void EnableRolloverBitmaps(
bool bEnable);
500 bool GetEnableRolloverBitmaps() {
return m_enableRolloverBitmaps; }
506 void DoFade(
int value);
511 wxBoxSizer *m_topSizer;
514 wxTimer m_fade_timer;
527 bool m_marginsInvisible;
529 wxTimer m_destroyTimer;
530 wxSize m_recoversize;
532 bool m_bAutoHideToolbar;
533 int m_nAutoHideToolbar;
534 bool m_benableSubmerge;
536 wxString m_backcolorString;
538 wxString m_toolShowMask;
539 int n_toolbarHideMethod;
540 bool b_canToggleOrientation;
541 wxString m_configString;
542 bool m_enableRolloverBitmaps;
545 unsigned int m_texture;
546 wxImage m_toolbar_image;