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
38class iENCToolbar; // forward
39extern iENCToolbar *g_iENCToolbar;
46public:
47 iENCToolbar(wxWindow *parent, wxPoint position, long orient,
48 float size_factor);
50
51 void LoadToolBitmaps();
52 void OnToolLeftClick(wxCommandEvent &event);
53 void SetDensityToolBitmap(int nDensity);
54 void SetRangeToolBitmap();
55
56 void StateTimerEvent(wxTimerEvent &event);
57 void SetColorScheme(ColorScheme cs);
58
59 wxBitmap m_bmMinimum, m_bmStandard, m_bmAll, m_bmUStd, m_bmRPlus, m_bmRMinus;
60 wxBitmap *m_pbmScratch;
61 wxBitmap m_bmTemplate;
62
63 wxToolBarToolBase *m_toolDensity;
64
65 int m_nDensity;
66 wxTimer m_state_timer;
67 double m_range;
68 wxFont *m_rangeFont;
69
70#if 0
71 void OnClose( wxCloseEvent& event );
72 void OnWindowCreate( wxWindowCreateEvent& event );
73 void OnToolLeftClick( wxCommandEvent& event );
74 void MouseEvent( wxMouseEvent& event );
75 void FadeTimerEvent( wxTimerEvent& event );
76 bool IsToolbarShown() { return ( m_ptoolbar != 0 ); }
77 float GetScaleFactor() { return m_sizefactor; }
78 void SetGrabber( wxString icon_name );
79 void DestroyTimerEvent( wxTimerEvent& event );
80
81 void Realize();
82 ocpnToolBarSimple *GetToolbar();
83 ocpnToolBarSimple *CreateNewToolbar();
84
85 void CreateConfigMenu();
86 bool _toolbarConfigMenuUtil( int toolid, wxString tipString );
87
88 void Submerge();
89 void SubmergeToGrabber();
90 bool isSubmergedToGrabber();
91 void Surface();
92 void SurfaceFromGrabber();
93 void HideTooltip();
94 void ShowTooltips();
95 void EnableTooltips() { if(m_ptoolbar) m_ptoolbar->EnableTooltips(); }
96 void DisableTooltips() { if(m_ptoolbar) m_ptoolbar->DisableTooltips(); }
97 void UpdateRecoveryWindow(bool b_toolbarEnable);
98 void EnableTool( int toolid, bool enable );
99 void SetToolShortHelp( int toolid, const wxString& helpString );
100
101 void DestroyToolBar();
102 void ToggleOrientation();
103 void MoveDialogInScreenCoords( wxPoint posn, wxPoint posn_old );
104 void RePosition();
105 void LockPosition(bool lock){ m_block = lock; }
106 void SetColorScheme( ColorScheme cs );
107 ColorScheme GetColorScheme(){ return m_cs; }
108 bool CheckSurfaceRequest( wxMouseEvent &event );
109
110 void SetGeometry(bool bAvoid, wxRect rectAvoid);
111 long GetOrient() {
112 return m_orient;
113 }
114 void RefreshFadeTimer();
115 void SetAutoHideTimer(int time);
116 void SetAutoHide( bool hide ){ m_bAutoHideToolbar = hide; }
117
118 int GetDockX() {
119 return m_dock_x;
120 }
121 int GetDockY() {
122 return m_dock_y;
123 }
124 bool toolbarConfigChanged;
125 GrabberWin *m_pRecoverwin;
126 bool m_bnavgrabber;
127
128 wxMenu *m_FloatingToolbarConfigMenu;
129#endif
130private:
131#if 0
132 void DoFade( int value );
133
134 bool m_bsubmerged;
135 bool m_bsubmergedToGrabber;
136
137 wxWindow *m_pparent;
138 ocpnToolBarSimple *m_ptoolbar;
139 wxBoxSizer *m_topSizer;
140
141 GrabberWin *m_pGrabberwin;
142
143 long m_orient;
144 wxTimer m_fade_timer;
145 int m_opacity;
146 ColorScheme m_cs;
147
148 wxPoint m_position;
149 int m_dock_x;
150 int m_dock_y;
151 ocpnStyle::Style* m_style;
152 bool m_block;
153
154 bool m_marginsInvisible;
155 float m_sizefactor;
156 wxTimer m_destroyTimer;
157 GrabberWin *m_destroyGrabber;
158 wxSize m_recoversize;
159
160 bool m_bAutoHideToolbar;
161 int m_nAutoHideToolbar;
162#endif
163};
Floating toolbar for iENC (International Electronic Navigational Chart) functionality.
Definition iENCToolbar.h:45
Floating toolbar dialog for OpenCPN.
Definition toolbar.h:386
Generic toolbar implementation in pure wxWidgets adapted from wxToolBarSimple (deprecated).
Definition toolbar.h:103