OpenCPN Partial API docs
Loading...
Searching...
No Matches
mui_bar.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2018 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef muibar_H_
25#define muibar_H_
26
27#include <cstdint>
28
29#include "canvas_options.h"
30#include "chcanv.h"
31
32//----------------------------------------------------------------------------
33// constants
34//----------------------------------------------------------------------------
35
36enum { ID_MUI_MENU = 21500 };
37
41enum {
49 CO_PUSH
50};
51
52class MUIButton; // forward in mui_bar.cpp
53class MUITextButton; // forward in mui_bar.cpp
54
60class MUIBar : public wxEvtHandler {
61public:
62 MUIBar();
63 MUIBar(ChartCanvas *parent, int orientation = wxHORIZONTAL,
64 float size_factor = 1.0, wxWindowID id = wxID_ANY,
65 const wxPoint &pos = wxDefaultPosition,
66 const wxSize &size = wxDefaultSize, long style = 0,
67 const wxString &name = wxPanelNameStr);
68
69 ~MUIBar();
70
71 void onCanvasOptionsAnimationTimerEvent(wxTimerEvent &event);
72
73 void SetBestPosition();
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 void DrawGL(ocpnDC &gldc, double displayScale);
83 void DrawDC(ocpnDC &dc, double displayScale);
84 wxRect GetRect() { return wxRect(m_screenPos, m_size); }
85
86 bool MouseEvent(wxMouseEvent &event);
87 void PushCanvasOptions();
88
89 wxPoint m_screenPos;
90 wxSize m_size;
91
92private:
93 void Init();
94 void CreateControls();
95 void PullCanvasOptions();
96 void HandleMenuClick();
97 wxBitmap &CreateBitmap(double displayScale);
98 void InvalidateBitmap();
99 wxColor &GetBackgroundColor() { return m_backcolor; }
100 void CaptureCanvasOptionsBitmap();
101 void CaptureCanvasOptionsBitmapChain(wxTimerEvent &event);
102
103 ChartCanvas *m_parentCanvas;
104 int m_orientation;
105 float m_scaleFactor;
106
107 MUIButton *m_zinButton;
108 MUIButton *m_zoutButton;
109 MUIButton *m_menuButton;
110 MUIButton *m_followButton;
111 MUITextButton *m_scaleButton;
112
113 CanvasOptions *m_canvasOptions;
114 wxPoint m_targetCOPos;
115 wxPoint m_currentCOPos;
116 wxPoint m_startCOPos;
117 int m_COTopOffset;
118
119 wxSize m_canvasOptionsFullSize;
120
121 wxTimer m_canvasOptionsAnimationTimer;
122 int m_animateStep;
123 int m_animateSteps;
124 int m_animationType;
125 int m_animationTotalTime;
126 int m_pushPull;
127
128 wxColor m_backcolor;
129 wxBitmap m_animateBitmap;
130 wxBitmap m_backingBitmap;
131 wxTimer CanvasOptionTimer;
132 int m_coSequence;
133 int m_capture_size_y;
134 wxPoint m_capturePoint;
135 wxPoint m_backingPoint;
136 bool m_coAnimateByBitmaps;
137 ColorScheme m_cs;
138 bool m_CanvasENCAvail;
139 bool m_bEffects;
140
141 uint32_t m_texture;
142 int m_end_margin;
143 wxBitmap m_bitmap;
144 int m_scale;
145};
146
147#endif
Class CanvasOptions and helpers – Canvas options Window/Dialog.
Generic Chart canvas base.
Represents the Canvas Options dialog.
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:173
Modern User Interface Control Bar for OpenCPN.
Definition mui_bar.h:60
Device context class that can use either wxDC or OpenGL for drawing.
Definition ocpndc.h:60
@ CO_ANIMATION_CUBIC_REVERSE
Reversed cubic animation.
Definition mui_bar.h:47
@ CO_PULL
Pull animation.
Definition mui_bar.h:48
@ CO_ANIMATION_CUBIC_BACK_IN
Cubic animation with back-in effect.
Definition mui_bar.h:46
@ CO_ANIMATION_CUBIC
Cubic animation.
Definition mui_bar.h:44
@ CO_PUSH
Push animation.
Definition mui_bar.h:49
@ CO_ANIMATION_QUADRATIC
Quadratic animation.
Definition mui_bar.h:43
@ CO_ANIMATION_CUBIC_BOUNCE_IN
Cubic animation with bounce-in effect.
Definition mui_bar.h:45
@ CO_ANIMATION_LINEAR
Linear animation.
Definition mui_bar.h:42