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 void 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 void DisableTooltips() {
441 if (m_ptoolbar) m_ptoolbar->DisableTooltips();
443 void UpdateRecoveryWindow(
bool b_toolbarEnable);
444 void EnableTool(
int toolid,
bool enable);
445 void SetToolShortHelp(
int toolid,
const wxString &helpString);
447 void DestroyToolBar();
448 void ToggleOrientation();
449 void MoveDialogInScreenCoords(wxPoint posn, wxPoint posn_old);
450 void SetDefaultPosition();
451 void LockPosition(
bool lock) { m_block = lock; }
452 virtual void SetColorScheme(ColorScheme cs);
453 ColorScheme GetColorScheme() {
return m_cs; }
454 bool CheckSurfaceRequest(wxMouseEvent &event);
455 void GetFrameRelativePosition(
int *x,
int *y);
456 void RestoreRelativePosition(
int x,
int y);
458 void SetGeometry(
bool bAvoid, wxRect rectAvoid);
459 void SetMinX(
int offset) { m_dock_min_x = offset; }
460 void SetMinY(
int offset) { m_dock_min_y = offset; }
461 long GetOrient() {
return m_orient; }
462 wxSize GetToolSize();
463 wxRect GetToolbarRect();
464 wxSize GetToolbarSize();
465 wxPoint GetToolbarPosition();
467 void SetAutoHideTimer(
int time);
468 void SetAutoHide(
bool hide) { m_bAutoHideToolbar = hide; }
470 size_t GetToolCount();
471 void SetToolShowMask(wxString mask);
472 wxString GetToolShowMask() {
return m_toolShowMask; }
474 void SetToolShowCount(
int count);
475 int GetToolShowCount();
480 int GetDockX() {
return m_dock_x; }
481 int GetDockY() {
return m_dock_y; }
482 void SetDockX(
int x) { m_dock_x = x; }
483 void SetDockY(
int y) { m_dock_y = y; }
485 void SetYAuxOffset(
int offset) { m_auxOffsetY = offset; }
487 void SetCanToggleOrientation(
bool enable) { b_canToggleOrientation = enable; }
488 bool GetCanToggleOrientation() {
return b_canToggleOrientation; }
490 bool toolbarConfigChanged;
492 wxMenu *m_FloatingToolbarConfigMenu;
494 wxString m_tblastAISiconName;
495 wxToolBarToolBase *m_pTBAISTool;
496 bool m_toolbar_scale_tools_shown;
497 void SetBackGroundColorString(wxString colorRef);
498 void SetULDockPosition(wxPoint position);
500 ArrayOfToolbarItemContainer m_Items;
503 int RebuildToolbar();
504 void EnableRolloverBitmaps(
bool bEnable);
505 bool GetEnableRolloverBitmaps() {
return m_enableRolloverBitmaps; }
511 void DoFade(
int value);
516 wxBoxSizer *m_topSizer;
520 wxTimer m_fade_timer;
533 bool m_marginsInvisible;
535 wxTimer m_destroyTimer;
536 wxSize m_recoversize;
538 bool m_bAutoHideToolbar;
539 int m_nAutoHideToolbar;
540 bool m_benableSubmerge;
542 wxString m_backcolorString;
544 wxString m_toolShowMask;
545 int n_toolbarHideMethod;
546 bool b_canToggleOrientation;
547 wxString m_configString;
548 bool m_enableRolloverBitmaps;
551 unsigned int m_texture;
552 wxImage m_toolbar_image;