OpenCPN Partial API docs
Loading...
Searching...
No Matches
rollover_win.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2013 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 ROLLOVERWIN_H_
25#define ROLLOVERWIN_H_
26
27#include <wx/bitmap.h>
28#include <wx/font.h>
29#include <wx/gdicmn.h>
30#include <wx/string.h>
31#include <wx/timer.h>
32#include <wx/window.h>
33
34#include "model/ocpn_types.h"
35#include "color_types.h"
36#include "ocpndc.h"
37
38// constants for rollovers fonts
39enum { AIS_ROLLOVER = 1, LEG_ROLLOVER = 2, TC_ROLLOVER = 3 };
40
41class RolloverWin : public wxWindow {
42public:
43 RolloverWin(wxWindow *parent, int timeout = -1, bool maincanvas = true);
45
46 void OnPaint(wxPaintEvent &event);
47 void Draw(ocpnDC &dc);
48
49 void SetColorScheme(ColorScheme cs);
50 void SetString(const wxString &s) { m_string = s; }
51 void SetPosition(wxPoint pt) { m_position = pt; }
52 void SetBitmap(int rollover);
53 wxBitmap *GetBitmap() { return m_pbm; }
54 void SetBestPosition(int x, int y, int off_x, int off_y, int rollover,
55 wxSize parent_size);
56 void OnTimer(wxTimerEvent &event);
57 void OnMouseEvent(wxMouseEvent &event);
58 void SetMousePropogation(int level) { m_mmouse_propogate = level; }
59 bool IsActive() { return isActive; }
60 void IsActive(bool state) { isActive = state; }
61
62private:
63 wxString m_string;
64 wxSize m_size;
65 wxPoint m_position;
66 wxBitmap *m_pbm;
67 wxTimer m_timer_timeout;
68 int m_timeout_sec;
69 int m_mmouse_propogate;
70 unsigned int m_texture;
71 bool isActive;
72 wxFont *m_plabelFont;
73 bool m_bmaincanvas;
74
75 DECLARE_EVENT_TABLE()
76};
77
78#endif // ROLLOVERWIN_H_
Device context class that can use either wxDC or OpenGL for drawing.
Definition ocpndc.h:60
Navigation data types.
Layer to use wxDC or opengl.