109 const wxPoint &pos = wxDefaultPosition,
110 const wxSize &size = wxDefaultSize,
111 long style = wxNO_BORDER,
int orient = wxTB_HORIZONTAL)
115 Create(parent, winid, pos, size, style, orient);
119 const wxPoint &pos = wxDefaultPosition,
120 const wxSize &size = wxDefaultSize,
long style = wxNO_BORDER,
121 int orient = wxTB_HORIZONTAL);
125 virtual void SetToggledBackgroundColour(wxColour c) {
126 m_toggle_bg_color = c;
128 virtual void SetBackgroundColour(wxColour c) { m_background_color = c; }
129 virtual wxColour GetBackgroundColour() {
return m_background_color; }
130 virtual void SetColorScheme(ColorScheme cs);
133 bool OnMouseEvent(wxMouseEvent &event, wxPoint &position);
134 void OnToolTipTimerEvent(wxTimerEvent &event);
135 void OnToolTipOffTimerEvent(wxTimerEvent &event);
137 wxToolBarToolBase *AddTool(
int toolid,
const wxString &label,
138 const wxBitmap &bitmap,
139 const wxBitmap &bmpDisabled,
140 wxItemKind kind = wxITEM_NORMAL,
141 const wxString &shortHelp = wxEmptyString,
142 const wxString &longHelp = wxEmptyString,
143 wxObject *data = NULL);
145 wxToolBarToolBase *AddTool(
int toolid,
const wxString &label,
146 const wxBitmap &bitmap,
147 const wxString &shortHelp = wxEmptyString,
148 wxItemKind kind = wxITEM_NORMAL) {
149 return AddTool(toolid, label, bitmap, wxNullBitmap, kind, shortHelp);
152 wxToolBarToolBase *InsertTool(
size_t pos,
int id,
const wxString &label,
153 const wxBitmap &bitmap,
154 const wxBitmap &bmpDisabled, wxItemKind kind,
155 const wxString &shortHelp,
156 const wxString &longHelp, wxObject *clientData);
158 wxToolBarToolBase *InsertTool(
size_t pos, wxToolBarToolBase *tool);
161 virtual bool OnLeftClick(
int toolid,
bool toggleDown);
164 virtual void OnRightClick(
int toolid,
long x,
long y);
166 virtual void DoPluginToolUp();
168 bool IsDirty() {
return m_dirty; }
169 void SetDirty(
bool value) { m_dirty = value; }
171 size_t GetToolsCount()
const {
return m_tools.GetCount(); }
172 void SetToolShowCount(
int count) { m_nShowTools = count; }
173 int GetToolShowCount() {
return m_nShowTools; }
175 int GetNoRowsOrColumns() {
return m_currentRowsOrColumns; };
176 int GetLineCount() {
return m_LineCount; };
177 int GetVisibleToolCount();
179 void SetToolNormalBitmapEx(wxToolBarToolBase *tool,
const wxString &iconname);
180 void SetToolNormalBitmapSVG(wxToolBarToolBase *tool, wxString fileSVG);
182 void EnableRolloverBitmaps(
bool enable) {
183 m_tbenableRolloverBitmaps = enable;
186 wxBitmap &GetBitmap() {
return m_bitmap; }
189 virtual wxControl *FindControl(
int toolid);
192 virtual wxToolBarToolBase *AddSeparator();
193 virtual wxToolBarToolBase *InsertSeparator(
size_t pos);
197 virtual wxToolBarToolBase *RemoveTool(
int toolid);
200 virtual bool DeleteToolByPos(
size_t pos);
201 virtual bool DeleteTool(
int toolid);
204 virtual void ClearTools();
208 virtual bool Realize();
213 virtual void EnableTool(
int toolid,
bool enable);
214 virtual void ToggleTool(
int toolid,
bool toggle);
216 virtual void SetToolBitmaps(
int toolid, wxBitmap *bmp, wxBitmap *bmpRollover);
217 virtual void SetToolBitmapsSVG(
int id, wxString fileSVGNormal,
218 wxString fileSVGRollover,
219 wxString fileSVGToggled);
221 void InvalidateBitmaps();
222 wxBitmap &CreateBitmap(
double display_scale = 1.0);
225 virtual wxObject *GetToolClientData(
int toolid)
const;
226 virtual void SetToolClientData(
int toolid, wxObject *clientData);
229 virtual int GetToolPos(
int id)
const;
232 virtual bool GetToolState(
int toolid)
const;
234 virtual bool GetToolEnabled(
int toolid)
const;
236 virtual void SetToolShortHelp(
int toolid,
const wxString &helpString);
237 virtual wxString GetToolShortHelp(
int toolid)
const;
238 virtual void SetToolLongHelp(
int toolid,
const wxString &helpString);
239 virtual wxString GetToolLongHelp(
int toolid)
const;
241 virtual void SetToolTooltipHiViz(
int id,
bool b_hiviz);
243 virtual void SetSizeFactor(
float factor) {
244 m_sizefactor = factor;
251 void SetMaxRowsCols(
int rows,
int cols) {
255 int GetMaxRows()
const {
return m_maxRows; }
256 int GetMaxCols()
const {
return m_maxCols; }
260 virtual void SetToolBitmapSize(
const wxSize &size) {
261 m_defaultWidth = size.x;
262 m_defaultHeight = size.y;
264 virtual wxSize GetToolBitmapSize()
const {
265 return wxSize(m_defaultWidth, m_defaultHeight);
270 virtual wxSize GetToolSize()
const {
return GetToolBitmapSize(); }
272 virtual wxRect GetToolRect(
int tool_id);
276 wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
279 wxToolBarToolBase *FindById(
int toolid)
const;
282 bool IsVertical()
const {
return m_orient == wxTB_VERTICAL; }
285 wxToolBarToolsList m_tools;
294 wxCoord m_defaultWidth, m_defaultHeight;
297 wxCoord m_maxWidth, m_maxHeight;
301 void EnableTooltips();
302 void DisableTooltips();
309 virtual wxToolBarToolBase *DoAddTool(
310 int toolid,
const wxString &label,
const wxBitmap &bitmap,
311 const wxBitmap &bmpDisabled, wxItemKind kind,
312 const wxString &shortHelp = wxEmptyString,
313 const wxString &longHelp = wxEmptyString, wxObject *clientData = NULL,
314 wxCoord xPos = wxDefaultCoord, wxCoord yPos = wxDefaultCoord);
316 virtual bool DoInsertTool(
size_t pos, wxToolBarToolBase *tool);
317 virtual bool DoDeleteTool(
size_t pos, wxToolBarToolBase *tool);
319 virtual void DoEnableTool(wxToolBarToolBase *tool,
bool enable);
320 virtual void DoToggleTool(wxToolBarToolBase *tool,
bool toggle);
322 virtual wxToolBarToolBase *CreateTool(
int winid,
const wxString &label,
323 const wxBitmap &bmpNormal,
324 const wxBitmap &bmpDisabled,
325 wxItemKind kind, wxObject *clientData,
326 const wxString &shortHelp,
327 const wxString &longHelp);
330 void DrawTool(wxToolBarToolBase *tool);
331 virtual void DrawTool(wxDC &dc, wxToolBarToolBase *tool);
332 void CreateToolBitmap(wxToolBarToolBase *toolBase);
335 int m_currentRowsOrColumns;
338 int m_pressedTool, m_currentTool;
340 wxCoord m_lastX, m_lastY;
341 wxCoord m_xPos, m_yPos;
343 wxColour m_toggle_bg_color;
344 wxColour m_toolOutlineColour;
345 wxColour m_background_color;
350 ColorScheme m_currentColorScheme;
352 wxTimer m_tooltip_timer;
354 wxTimer m_tooltipoff_timer;
356 bool m_btooltip_show;
358 bool m_btoolbar_is_zooming;
365 int m_last_plugin_down_id;
368 bool m_tbenableRolloverBitmaps;
373 DECLARE_EVENT_TABLE()
392 void OnClose(wxCloseEvent &event);
393 void OnWindowCreate(wxWindowCreateEvent &event);
394 void OnToolLeftClick(wxCommandEvent &event);
395 virtual void OnKeyDown(wxKeyEvent &event);
396 virtual void OnKeyUp(wxKeyEvent &event);
397 void OldMouseEvent(wxMouseEvent &event);
398 bool MouseEvent(wxMouseEvent &event);
399 void FadeTimerEvent(wxTimerEvent &event);
400 bool IsToolbarShown() {
return (m_ptoolbar != 0); }
401 float GetScaleFactor() {
return m_sizefactor; }
402 void DestroyTimerEvent(wxTimerEvent &event);
403 void DrawDC(
ocpnDC &dc,
double displayScale);
404 void DrawGL(
ocpnDC &gldc,
double displayScale);
406 void RefreshFadeTimer();
408 void EnableSubmerge(
bool enable) { m_benableSubmerge = enable; }
412 void SetToolbarHideMethod(
int n_method) { n_toolbarHideMethod = n_method; }
414 void SetToolConfigString(wxString
string) { m_configString = string; }
415 wxString GetToolConfigString() {
return m_configString; }
417 float GetSizeFactor() {
return m_sizefactor; }
419 void CreateConfigMenu();
422 void RefreshToolbar();
428 void EnableTooltips() {
429 if (m_ptoolbar) m_ptoolbar->EnableTooltips();
431 void DisableTooltips() {
432 if (m_ptoolbar) m_ptoolbar->DisableTooltips();
434 void UpdateRecoveryWindow(
bool b_toolbarEnable);
435 void EnableTool(
int toolid,
bool enable);
436 void SetToolShortHelp(
int toolid,
const wxString &helpString);
438 void DestroyToolBar();
439 void ToggleOrientation();
440 void MoveDialogInScreenCoords(wxPoint posn, wxPoint posn_old);
441 void SetDefaultPosition();
442 void LockPosition(
bool lock) { m_block = lock; }
443 virtual void SetColorScheme(ColorScheme cs);
444 ColorScheme GetColorScheme() {
return m_cs; }
445 bool CheckSurfaceRequest(wxMouseEvent &event);
446 void GetFrameRelativePosition(
int *x,
int *y);
447 void RestoreRelativePosition(
int x,
int y);
449 void SetGeometry(
bool bAvoid, wxRect rectAvoid);
450 void SetMinX(
int offset) { m_dock_min_x = offset; }
451 void SetMinY(
int offset) { m_dock_min_y = offset; }
452 long GetOrient() {
return m_orient; }
453 wxSize GetToolSize();
454 wxRect GetToolbarRect();
455 wxSize GetToolbarSize();
456 wxPoint GetToolbarPosition();
458 void SetAutoHideTimer(
int time);
459 void SetAutoHide(
bool hide) { m_bAutoHideToolbar = hide; }
461 size_t GetToolCount();
462 void SetToolShowMask(wxString mask);
463 wxString GetToolShowMask(
void) {
return m_toolShowMask; }
465 void SetToolShowCount(
int count);
466 int GetToolShowCount(
void);
471 int GetDockX() {
return m_dock_x; }
472 int GetDockY() {
return m_dock_y; }
473 void SetDockX(
int x) { m_dock_x = x; }
474 void SetDockY(
int y) { m_dock_y = y; }
476 void SetYAuxOffset(
int offset) { m_auxOffsetY = offset; }
478 void SetCanToggleOrientation(
bool enable) { b_canToggleOrientation = enable; }
479 bool GetCanToggleOrientation() {
return b_canToggleOrientation; }
481 bool toolbarConfigChanged;
483 wxMenu *m_FloatingToolbarConfigMenu;
485 wxString m_tblastAISiconName;
486 wxToolBarToolBase *m_pTBAISTool;
487 bool m_toolbar_scale_tools_shown;
488 void SetBackGroundColorString(wxString colorRef);
489 void SetULDockPosition(wxPoint position);
491 ArrayOfToolbarItemContainer m_Items;
494 int RebuildToolbar();
495 void EnableRolloverBitmaps(
bool bEnable);
496 bool GetEnableRolloverBitmaps() {
return m_enableRolloverBitmaps; }
502 void DoFade(
int value);
507 wxBoxSizer *m_topSizer;
510 wxTimer m_fade_timer;
523 bool m_marginsInvisible;
525 wxTimer m_destroyTimer;
526 wxSize m_recoversize;
528 bool m_bAutoHideToolbar;
529 int m_nAutoHideToolbar;
530 bool m_benableSubmerge;
532 wxString m_backcolorString;
534 wxString m_toolShowMask;
535 int n_toolbarHideMethod;
536 bool b_canToggleOrientation;
537 wxString m_configString;
538 bool m_enableRolloverBitmaps;
541 unsigned int m_texture;
542 wxImage m_toolbar_image;