OpenCPN Partial API docs
Loading...
Searching...
No Matches
iENCToolbar.h
1/****************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: OpenCPN iENCToolbar
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2017 by David S. Register *
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24 **************************************************************************/
25
26#include "toolbar.h"
27
28//----------------------------------------------------------------------------------------------------------
29// iENCToolbar Specification
30//----------------------------------------------------------------------------------------------------------
31
32#define ID_DENSITY 20000
33#define ID_RPLUS 20001
34#define ID_RMINUS 20002
35
36#define STATE_TIMER 3689
37
44public:
45 iENCToolbar(wxWindow *parent, wxPoint position, long orient,
46 float size_factor);
48
49 void LoadToolBitmaps();
50 void OnToolLeftClick(wxCommandEvent &event);
51 void SetDensityToolBitmap(int nDensity);
52 void SetRangeToolBitmap();
53
54 void StateTimerEvent(wxTimerEvent &event);
55 void SetColorScheme(ColorScheme cs);
56
57 wxBitmap m_bmMinimum, m_bmStandard, m_bmAll, m_bmUStd, m_bmRPlus, m_bmRMinus;
58 wxBitmap *m_pbmScratch;
59 wxBitmap m_bmTemplate;
60
61 wxToolBarToolBase *m_toolDensity;
62
63 int m_nDensity;
64 wxTimer m_state_timer;
65 double m_range;
66 wxFont *m_rangeFont;
67
68#if 0
69 void OnClose( wxCloseEvent& event );
70 void OnWindowCreate( wxWindowCreateEvent& event );
71 void OnToolLeftClick( wxCommandEvent& event );
72 void MouseEvent( wxMouseEvent& event );
73 void FadeTimerEvent( wxTimerEvent& event );
74 bool IsToolbarShown() { return ( m_ptoolbar != 0 ); }
75 float GetScaleFactor() { return m_sizefactor; }
76 void SetGrabber( wxString icon_name );
77 void DestroyTimerEvent( wxTimerEvent& event );
78
79 void Realize();
80 ocpnToolBarSimple *GetToolbar();
81 ocpnToolBarSimple *CreateNewToolbar();
82
83 void CreateConfigMenu();
84 bool _toolbarConfigMenuUtil( int toolid, wxString tipString );
85
86 void Submerge();
87 void SubmergeToGrabber();
88 bool isSubmergedToGrabber();
89 void Surface();
90 void SurfaceFromGrabber();
91 void HideTooltip();
92 void ShowTooltips();
93 void EnableTooltips() { if(m_ptoolbar) m_ptoolbar->EnableTooltips(); }
94 void DisableTooltips() { if(m_ptoolbar) m_ptoolbar->DisableTooltips(); }
95 void UpdateRecoveryWindow(bool b_toolbarEnable);
96 void EnableTool( int toolid, bool enable );
97 void SetToolShortHelp( int toolid, const wxString& helpString );
98
99 void DestroyToolBar();
100 void ToggleOrientation();
101 void MoveDialogInScreenCoords( wxPoint posn, wxPoint posn_old );
102 void RePosition();
103 void LockPosition(bool lock){ m_block = lock; }
104 void SetColorScheme( ColorScheme cs );
105 ColorScheme GetColorScheme(){ return m_cs; }
106 bool CheckSurfaceRequest( wxMouseEvent &event );
107
108 void SetGeometry(bool bAvoid, wxRect rectAvoid);
109 long GetOrient() {
110 return m_orient;
111 }
112 void RefreshFadeTimer();
113 void SetAutoHideTimer(int time);
114 void SetAutoHide( bool hide ){ m_bAutoHideToolbar = hide; }
115
116 int GetDockX() {
117 return m_dock_x;
118 }
119 int GetDockY() {
120 return m_dock_y;
121 }
122 bool toolbarConfigChanged;
123 GrabberWin *m_pRecoverwin;
124 bool m_bnavgrabber;
125
126 wxMenu *m_FloatingToolbarConfigMenu;
127#endif
128private:
129#if 0
130 void DoFade( int value );
131
132 bool m_bsubmerged;
133 bool m_bsubmergedToGrabber;
134
135 wxWindow *m_pparent;
136 ocpnToolBarSimple *m_ptoolbar;
137 wxBoxSizer *m_topSizer;
138
139 GrabberWin *m_pGrabberwin;
140
141 long m_orient;
142 wxTimer m_fade_timer;
143 int m_opacity;
144 ColorScheme m_cs;
145
146 wxPoint m_position;
147 int m_dock_x;
148 int m_dock_y;
149 ocpnStyle::Style* m_style;
150 bool m_block;
151
152 bool m_marginsInvisible;
153 float m_sizefactor;
154 wxTimer m_destroyTimer;
155 GrabberWin *m_destroyGrabber;
156 wxSize m_recoversize;
157
158 bool m_bAutoHideToolbar;
159 int m_nAutoHideToolbar;
160#endif
161};
Floating toolbar for iENC (International Electronic Navigational Chart) functionality.
Definition iENCToolbar.h:43
Floating toolbar dialog for OpenCPN.
Definition toolbar.h:386
Generic toolbar implementation in pure wxWidgets adapted from wxToolBarSimple (deprecated).
Definition toolbar.h:103