OpenCPN Partial API docs
ChInfoWin.h
1 /***************************************************************************
2  *
3  * Project: OpenCPN
4  *
5  ***************************************************************************
6  * Copyright (C) 2013 by David S. Register *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22  **************************************************************************/
23 
24 #ifndef __CHINFOWIN_H__
25 #define __CHINFOWIN_H__
26 
27 #include <wx/window.h>
28 #include <wx/stattext.h>
29 #include <wx/panel.h>
30 
31 class ChInfoWin : public wxPanel {
32 public:
33  ChInfoWin(wxWindow* parent);
34  ~ChInfoWin();
35 
36  void SetString(const wxString& s) { m_string = s; }
37  const wxString& GetString(void) { return m_string; }
38  void MouseEvent(wxMouseEvent& event);
39 
40  void SetPosition(wxPoint pt) { m_position = pt; }
41  void SetWinSize(wxSize sz) { m_size = sz; }
42  void SetBitmap(void);
43  void FitToChars(int char_width, int char_height);
44  wxSize GetWinSize(void) { return m_size; }
45  void OnPaint(wxPaintEvent& event);
46  void OnEraseBackground(wxEraseEvent& event);
47 
48  wxStaticText* m_pInfoTextCtl;
49  int dbIndex;
50  int chart_scale;
51 private:
52  wxString m_string;
53  wxSize m_size;
54  wxPoint m_position;
55 
56  DECLARE_EVENT_TABLE()
57 };
58 
59 #endif