115 const wxPoint &pos = wxDefaultPosition,
116 const wxSize &size = wxDefaultSize,
117 long style = wxNO_BORDER,
int orient = wxTB_HORIZONTAL)
121 Create(parent, winid, pos, size, style, orient);
125 const wxPoint &pos = wxDefaultPosition,
126 const wxSize &size = wxDefaultSize,
long style = wxNO_BORDER,
127 int orient = wxTB_HORIZONTAL);
131 virtual void SetToggledBackgroundColour(wxColour c) {
132 m_toggle_bg_color = c;
134 virtual void SetBackgroundColour(wxColour c) { m_background_color = c; }
135 virtual wxColour GetBackgroundColour() {
return m_background_color; }
136 virtual void SetColorScheme(ColorScheme cs);
139 bool OnMouseEvent(wxMouseEvent &event, wxPoint &position);
140 void OnToolTipTimerEvent(wxTimerEvent &event);
141 void OnToolTipOffTimerEvent(wxTimerEvent &event);
143 wxToolBarToolBase *AddTool(
int toolid,
const wxString &label,
144 const wxBitmap &bitmap,
145 const wxBitmap &bmpDisabled,
146 wxItemKind kind = wxITEM_NORMAL,
147 const wxString &shortHelp =
"",
148 const wxString &longHelp =
"",
149 wxObject *data = NULL);
151 wxToolBarToolBase *AddTool(
int toolid,
const wxString &label,
152 const wxBitmap &bitmap,
153 const wxString &shortHelp =
"",
154 wxItemKind kind = wxITEM_NORMAL) {
155 return AddTool(toolid, label, bitmap, wxNullBitmap, kind, shortHelp);
158 wxToolBarToolBase *InsertTool(
size_t pos,
int id,
const wxString &label,
159 const wxBitmap &bitmap,
160 const wxBitmap &bmpDisabled, wxItemKind kind,
161 const wxString &shortHelp,
162 const wxString &longHelp, wxObject *clientData);
164 wxToolBarToolBase *InsertTool(
size_t pos, wxToolBarToolBase *tool);
167 virtual bool OnLeftClick(
int toolid,
bool toggleDown);
170 virtual void OnRightClick(
int toolid,
long x,
long y);
172 virtual void DoPluginToolUp();
174 bool IsDirty() {
return m_dirty; }
175 void SetDirty(
bool value) { m_dirty = value; }
177 size_t GetToolsCount()
const {
return m_tools.GetCount(); }
178 void SetToolShowCount(
int count) { m_nShowTools = count; }
179 int GetToolShowCount() {
return m_nShowTools; }
181 int GetNoRowsOrColumns() {
return m_currentRowsOrColumns; };
182 int GetLineCount() {
return m_LineCount; };
183 int GetVisibleToolCount();
185 void SetToolNormalBitmapEx(wxToolBarToolBase *tool,
const wxString &iconname);
186 void SetToolNormalBitmapSVG(wxToolBarToolBase *tool, wxString fileSVG);
188 void EnableRolloverBitmaps(
bool enable) {
189 m_tbenableRolloverBitmaps = enable;
192 wxBitmap &GetBitmap() {
return m_bitmap; }
195 virtual wxControl *FindControl(
int toolid);
198 virtual wxToolBarToolBase *AddSeparator();
199 virtual wxToolBarToolBase *InsertSeparator(
size_t pos);
203 virtual wxToolBarToolBase *RemoveTool(
int toolid);
206 virtual bool DeleteToolByPos(
size_t pos);
207 virtual bool DeleteTool(
int toolid);
210 virtual void ClearTools();
214 virtual bool Realize();
219 virtual void EnableTool(
int toolid,
bool enable);
220 virtual void ToggleTool(
int toolid,
bool toggle);
222 virtual void SetToolBitmaps(
int toolid, wxBitmap *bmp, wxBitmap *bmpRollover);
223 virtual void SetToolBitmapsSVG(
int id, wxString fileSVGNormal,
224 wxString fileSVGRollover,
225 wxString fileSVGToggled);
227 void InvalidateBitmaps();
228 wxBitmap &CreateBitmap(
double display_scale = 1.0);
231 virtual wxObject *GetToolClientData(
int toolid)
const;
232 virtual void SetToolClientData(
int toolid, wxObject *clientData);
235 virtual int GetToolPos(
int id)
const;
238 virtual bool GetToolState(
int toolid)
const;
240 virtual bool GetToolEnabled(
int toolid)
const;
242 virtual void SetToolShortHelp(
int toolid,
const wxString &helpString);
243 virtual wxString GetToolShortHelp(
int toolid)
const;
244 virtual void SetToolLongHelp(
int toolid,
const wxString &helpString);
245 virtual wxString GetToolLongHelp(
int toolid)
const;
247 virtual void SetToolTooltipHiViz(
int id,
bool b_hiviz);
249 virtual void SetSizeFactor(
float factor) {
250 m_sizefactor = factor;
257 void SetMaxRowsCols(
int rows,
int cols) {
261 int GetMaxRows()
const {
return m_maxRows; }
262 int GetMaxCols()
const {
return m_maxCols; }
266 virtual void SetToolBitmapSize(
const wxSize &size) {
267 m_defaultWidth = size.x;
268 m_defaultHeight = size.y;
270 virtual wxSize GetToolBitmapSize()
const {
271 return wxSize(m_defaultWidth, m_defaultHeight);
276 virtual wxSize GetToolSize()
const {
return GetToolBitmapSize(); }
278 virtual wxRect GetToolRect(
int tool_id);
282 wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
285 wxToolBarToolBase *FindById(
int toolid)
const;
288 bool IsVertical()
const {
return m_orient == wxTB_VERTICAL; }
291 wxToolBarToolsList m_tools;
300 wxCoord m_defaultWidth, m_defaultHeight;
303 wxCoord m_maxWidth, m_maxHeight;
307 void EnableTooltips();
308 bool DisableTooltips();
315 virtual wxToolBarToolBase *DoAddTool(
316 int toolid,
const wxString &label,
const wxBitmap &bitmap,
317 const wxBitmap &bmpDisabled, wxItemKind kind,
318 const wxString &shortHelp =
"",
const wxString &longHelp =
"",
319 wxObject *clientData = NULL, wxCoord xPos = wxDefaultCoord,
320 wxCoord yPos = wxDefaultCoord);
322 virtual bool DoInsertTool(
size_t pos, wxToolBarToolBase *tool);
323 virtual bool DoDeleteTool(
size_t pos, wxToolBarToolBase *tool);
325 virtual void DoEnableTool(wxToolBarToolBase *tool,
bool enable);
326 virtual void DoToggleTool(wxToolBarToolBase *tool,
bool toggle);
328 virtual wxToolBarToolBase *CreateTool(
int winid,
const wxString &label,
329 const wxBitmap &bmpNormal,
330 const wxBitmap &bmpDisabled,
331 wxItemKind kind, wxObject *clientData,
332 const wxString &shortHelp,
333 const wxString &longHelp);
336 void DrawTool(wxToolBarToolBase *tool);
337 virtual void DrawTool(wxDC &dc, wxToolBarToolBase *tool);
338 void CreateToolBitmap(wxToolBarToolBase *toolBase);
341 int m_currentRowsOrColumns;
344 int m_pressedTool, m_currentTool;
346 wxCoord m_lastX, m_lastY;
347 wxCoord m_xPos, m_yPos;
349 wxColour m_toggle_bg_color;
350 wxColour m_toolOutlineColour;
351 wxColour m_background_color;
355 ColorScheme m_currentColorScheme;
357 wxTimer m_tooltip_timer;
359 wxTimer m_tooltipoff_timer;
361 bool m_btooltip_show;
363 bool m_btoolbar_is_zooming;
370 int m_last_plugin_down_id;
373 bool m_tbenableRolloverBitmaps;
378 DECLARE_EVENT_TABLE()
401 void OnClose(wxCloseEvent &event);
402 void OnWindowCreate(wxWindowCreateEvent &event);
403 void OnToolLeftClick(wxCommandEvent &event);
404 virtual void OnKeyDown(wxKeyEvent &event);
405 virtual void OnKeyUp(wxKeyEvent &event);
406 void OldMouseEvent(wxMouseEvent &event);
407 bool MouseEvent(wxMouseEvent &event);
408 void FadeTimerEvent(wxTimerEvent &event);
409 bool IsToolbarShown() {
return (m_ptoolbar != 0); }
410 float GetScaleFactor() {
return m_sizefactor; }
411 void DestroyTimerEvent(wxTimerEvent &event);
412 void DrawDC(
ocpnDC &dc,
double displayScale);
413 void DrawGL(
ocpnDC &gldc,
double displayScale);
415 void RefreshFadeTimer();
417 void EnableSubmerge(
bool enable) { m_benableSubmerge = enable; }
421 void SetToolbarHideMethod(
int n_method) { n_toolbarHideMethod = n_method; }
423 void SetToolConfigString(wxString
string) { m_configString = string; }
424 wxString GetToolConfigString() {
return m_configString; }
426 float GetSizeFactor() {
return m_sizefactor; }
428 void CreateConfigMenu();
431 void RefreshToolbar();
437 void EnableTooltips() {
438 if (m_ptoolbar) m_ptoolbar->EnableTooltips();
440 bool DisableTooltips() {
441 if (m_ptoolbar)
return m_ptoolbar->DisableTooltips();
444 void UpdateRecoveryWindow(
bool b_toolbarEnable);
445 void EnableTool(
int toolid,
bool enable);
446 void SetToolShortHelp(
int toolid,
const wxString &helpString);
448 void DestroyToolBar();
449 void ToggleOrientation();
450 void MoveDialogInScreenCoords(wxPoint posn, wxPoint posn_old);
451 void SetDefaultPosition();
452 void LockPosition(
bool lock) { m_block = lock; }
453 virtual void SetColorScheme(ColorScheme cs);
454 ColorScheme GetColorScheme() {
return m_cs; }
455 bool CheckSurfaceRequest(wxMouseEvent &event);
456 void GetFrameRelativePosition(
int *x,
int *y);
457 void RestoreRelativePosition(
int x,
int y);
459 void SetGeometry(
bool bAvoid, wxRect rectAvoid);
460 void SetMinX(
int offset) { m_dock_min_x = offset; }
461 void SetMinY(
int offset) { m_dock_min_y = offset; }
462 long GetOrient() {
return m_orient; }
463 wxSize GetToolSize();
464 wxRect GetToolbarRect();
465 wxSize GetToolbarSize();
466 wxPoint GetToolbarPosition();
468 void SetAutoHideTimer(
int time);
469 void SetAutoHide(
bool hide) { m_bAutoHideToolbar = hide; }
471 size_t GetToolCount();
472 void SetToolShowMask(wxString mask);
473 wxString GetToolShowMask() {
return m_toolShowMask; }
475 void SetToolShowCount(
int count);
476 int GetToolShowCount();
481 int GetDockX() {
return m_dock_x; }
482 int GetDockY() {
return m_dock_y; }
483 void SetDockX(
int x) { m_dock_x = x; }
484 void SetDockY(
int y) { m_dock_y = y; }
486 void SetYAuxOffset(
int offset) { m_auxOffsetY = offset; }
488 void SetCanToggleOrientation(
bool enable) { b_canToggleOrientation = enable; }
489 bool GetCanToggleOrientation() {
return b_canToggleOrientation; }
491 bool toolbarConfigChanged;
493 wxMenu *m_FloatingToolbarConfigMenu;
495 wxString m_tblastAISiconName;
496 wxToolBarToolBase *m_pTBAISTool;
497 bool m_toolbar_scale_tools_shown;
498 void SetBackGroundColorString(wxString colorRef);
499 void SetULDockPosition(wxPoint position);
501 ArrayOfToolbarItemContainer m_Items;
504 int RebuildToolbar();
505 void EnableRolloverBitmaps(
bool bEnable);
506 bool GetEnableRolloverBitmaps() {
return m_enableRolloverBitmaps; }
512 void DoFade(
int value);
517 wxBoxSizer *m_topSizer;
521 wxTimer m_fade_timer;
534 bool m_marginsInvisible;
536 wxTimer m_destroyTimer;
537 wxSize m_recoversize;
539 bool m_bAutoHideToolbar;
540 int m_nAutoHideToolbar;
541 bool m_benableSubmerge;
543 wxString m_backcolorString;
545 wxString m_toolShowMask;
546 int n_toolbarHideMethod;
547 bool b_canToggleOrientation;
548 wxString m_configString;
549 bool m_enableRolloverBitmaps;
552 unsigned int m_texture;
553 wxImage m_toolbar_image;