forked from OpenCPN/OpenCPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RolloverWin.h
77 lines (67 loc) · 2.76 KB
/
RolloverWin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
*
* Project: OpenCPN
*
***************************************************************************
* Copyright (C) 2013 by David S. Register *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
**************************************************************************/
#ifndef __ROLLOVERWIN_H__
#define __ROLLOVERWIN_H__
#include <wx/window.h>
#include <wx/timer.h>
#include "ocpn_types.h"
//constants for rollovers fonts
enum
{
AIS_ROLLOVER =1,
LEG_ROLLOVER =2,
TC_ROLLOVER =3
};
class RolloverWin: public wxWindow
{
public:
RolloverWin( wxWindow *parent, int timeout = -1, bool maincanvas = true );
~RolloverWin();
void OnPaint( wxPaintEvent& event );
void Draw(ocpnDC &dc);
void SetColorScheme( ColorScheme cs );
void SetString(const wxString &s) { m_string = s; }
void SetPosition( wxPoint pt ) { m_position = pt; }
void SetBitmap( int rollover );
wxBitmap* GetBitmap() { return m_pbm; }
void SetBestPosition( int x, int y, int off_x, int off_y, int rollover, wxSize parent_size );
void OnTimer( wxTimerEvent& event );
void OnMouseEvent( wxMouseEvent& event );
void SetMousePropogation( int level ) { m_mmouse_propogate = level; }
bool IsActive() { return isActive; }
void IsActive( bool state ) { isActive = state; }
private:
wxString m_string;
wxSize m_size;
wxPoint m_position;
wxBitmap *m_pbm;
wxTimer m_timer_timeout;
int m_timeout_sec;
int m_mmouse_propogate;
unsigned int m_texture;
bool isActive;
wxFont *m_plabelFont;
bool m_bmaincanvas;
DECLARE_EVENT_TABLE()
};
#endif