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#include "ocpn_frame.h"
32
33//----------------------------------------------------------------------------
34// constants
35//----------------------------------------------------------------------------
36
37enum { ID_MUI_MENU = 21500 };
38
42enum {
50 CO_PUSH
51};
52
53class MUIButton; // forward in mui_bar.cpp
54class MUITextButton; // forward in mui_bar.cpp
55
61class MUIBar : public wxEvtHandler {
62public:
63 MUIBar();
64 MUIBar(ChartCanvas *parent, int orientation = wxHORIZONTAL,
65 float size_factor = 1.0, wxWindowID id = wxID_ANY,
66 const wxPoint &pos = wxDefaultPosition,
67 const wxSize &size = wxDefaultSize, long style = 0,
68 const wxString &name = wxPanelNameStr);
69
70 ~MUIBar();
71
72 void onCanvasOptionsAnimationTimerEvent(wxTimerEvent &event);
73
74 void SetBestPosition();
75 void UpdateDynamicValues();
76 int GetOrientation() { return m_orientation; }
77 void ResetCanvasOptions();
78 void SetFollowButtonState(int state);
79 CanvasOptions *GetCanvasOptions() { return m_canvasOptions; }
80 void SetColorScheme(ColorScheme cs);
81 void SetCanvasENCAvailable(bool avail);
82 void OnScaleSelected(wxMouseEvent &event);
83 void DrawGL(ocpnDC &gldc, double displayScale);
84 void DrawDC(ocpnDC &dc, double displayScale);
85 wxRect GetRect() { return wxRect(m_screenPos, m_size); }
86
87 bool MouseEvent(wxMouseEvent &event);
88 void PushCanvasOptions();
89
90 wxPoint m_screenPos;
91 wxSize m_size;
92
93private:
94 void Init();
95 void CreateControls();
96 void PullCanvasOptions();
97 void HandleMenuClick();
98 wxBitmap &CreateBitmap(double displayScale);
99 void InvalidateBitmap();
100 wxColor &GetBackgroundColor() { return m_backcolor; }
101 void CaptureCanvasOptionsBitmap();
102 void CaptureCanvasOptionsBitmapChain(wxTimerEvent &event);
103
104 ChartCanvas *m_parentCanvas;
105 int m_orientation;
106 float m_scaleFactor;
107
108 MUIButton *m_zinButton;
109 MUIButton *m_zoutButton;
110 MUIButton *m_menuButton;
111 MUIButton *m_followButton;
112 MUITextButton *m_scaleButton;
113
114 CanvasOptions *m_canvasOptions;
115 wxPoint m_targetCOPos;
116 wxPoint m_currentCOPos;
117 wxPoint m_startCOPos;
118 int m_COTopOffset;
119
120 wxSize m_canvasOptionsFullSize;
121
122 wxTimer m_canvasOptionsAnimationTimer;
123 int m_animateStep;
124 int m_animateSteps;
125 int m_animationType;
126 int m_animationTotalTime;
127 int m_pushPull;
128
129 wxColor m_backcolor;
130 wxBitmap m_animateBitmap;
131 wxBitmap m_backingBitmap;
132 wxTimer CanvasOptionTimer;
133 int m_coSequence;
134 int m_capture_size_y;
135 wxPoint m_capturePoint;
136 wxPoint m_backingPoint;
137 bool m_coAnimateByBitmaps;
138 ColorScheme m_cs;
139 bool m_CanvasENCAvail;
140 bool m_bEffects;
141
142 uint32_t m_texture;
143 int m_end_margin;
144 wxBitmap m_bitmap;
145 int m_scale;
146};
147
148#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:157
Modern User Interface Control Bar for OpenCPN.
Definition mui_bar.h:61
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:48
@ CO_PULL
Pull animation.
Definition mui_bar.h:49
@ CO_ANIMATION_CUBIC_BACK_IN
Cubic animation with back-in effect.
Definition mui_bar.h:47
@ CO_ANIMATION_CUBIC
Cubic animation.
Definition mui_bar.h:45
@ CO_PUSH
Push animation.
Definition mui_bar.h:50
@ CO_ANIMATION_QUADRATIC
Quadratic animation.
Definition mui_bar.h:44
@ CO_ANIMATION_CUBIC_BOUNCE_IN
Cubic animation with bounce-in effect.
Definition mui_bar.h:46
@ CO_ANIMATION_LINEAR
Linear animation.
Definition mui_bar.h:43
OpenCPN top window.