OpenCPN Partial API docs
Loading...
Searching...
No Matches
MUIBar.h
1/******************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: MUI Control Bar
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2018 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
27#ifndef __muibar_H__
28#define __muibar_H__
29
30
31//----------------------------------------------------------------------------
32// constants
33//----------------------------------------------------------------------------
34
35enum { ID_MUI_MENU = 21500 };
36
37enum {
38 CO_ANIMATION_LINEAR = 0,
39 CO_ANIMATION_QUADRATIC,
40 CO_ANIMATION_CUBIC,
41 CO_ANIMATION_CUBIC_BOUNCE_IN,
42 CO_ANIMATION_CUBIC_BACK_IN,
43 CO_ANIMATION_CUBIC_REVERSE,
44 CO_PULL,
45 CO_PUSH
46};
47
48class MyFrame;
49class ChartCanvas;
50class MUIButton;
51class CanvasOptions;
52
53//----------------------------------------------------------------------------
54// MUIBar
55//----------------------------------------------------------------------------
56class MUIBar : public wxFrame {
57public:
58 MUIBar();
59 MUIBar(ChartCanvas *parent, int orientation = wxHORIZONTAL,
60 float size_factor = 1.0, wxWindowID id = wxID_ANY,
61 const wxPoint &pos = wxDefaultPosition,
62 const wxSize &size = wxDefaultSize, long style = 0,
63 const wxString &name = wxPanelNameStr);
64
65 ~MUIBar();
66
67 void OnSize(wxSizeEvent &event);
68 void OnPaint(wxPaintEvent &event);
69 void OnToolLeftClick(wxCommandEvent &event);
70 void OnEraseBackground(wxEraseEvent &event);
71 void onCanvasOptionsAnimationTimerEvent(wxTimerEvent &event);
72
73 void SetBestPosition(void);
74 void UpdateDynamicValues();
75 int GetOrientation() { return m_orientation; }
76 void ResetCanvasOptions();
77 void SetFollowButtonState(int state);
78 CanvasOptions *GetCanvasOptions() { return m_canvasOptions; }
79 void SetColorScheme(ColorScheme cs);
80 void SetCanvasENCAvailable(bool avail);
81 void OnScaleSelected(wxMouseEvent &event);
82
83private:
84 void Init(void);
85 void CreateControls();
86 void PullCanvasOptions();
87 void PushCanvasOptions();
88
89 void CaptureCanvasOptionsBitmap();
90 void CaptureCanvasOptionsBitmapChain(wxTimerEvent &event);
91
92 ChartCanvas *m_parentCanvas;
93 int m_orientation;
94 float m_scaleFactor;
95
96 MUIButton *m_zinButton;
97 MUIButton *m_zoutButton;
98 MUIButton *m_menuButton;
99 MUIButton *m_followButton;
100 wxStaticText *m_scaleTextBox;
101
102 CanvasOptions *m_canvasOptions;
103 wxPoint m_targetCOPos;
104 wxPoint m_currentCOPos;
105 wxPoint m_startCOPos;
106 int m_COTopOffset;
107
108 wxSize m_canvasOptionsFullSize;
109
110 wxTimer m_canvasOptionsAnimationTimer;
111 int m_animateStep;
112 int m_animateSteps;
113 int m_animationType;
114 int m_animationTotalTime;
115 int m_pushPull;
116
117 wxString m_backcolorString;
118 wxBitmap m_animateBitmap;
119 wxBitmap m_backingBitmap;
120 wxTimer CanvasOptionTimer;
121 int m_coSequence;
122 int m_capture_size_y;
123 wxPoint m_capturePoint;
124 wxPoint m_backingPoint;
125 bool m_coAnimateByBitmaps;
126 ColorScheme m_cs;
127 bool m_CanvasENCAvail;
128 bool m_bEffects;
129
130 DECLARE_EVENT_TABLE()
131};
132
133#endif
Definition: MUIBar.h:56