OpenCPN Partial API docs
NMEALogWindow.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 
25 #ifndef __NMEALOGWINDOW_H__
26 #define __NMEALOGWINDOW_H__
27 
28 #include <wx/gdicmn.h>
29 #include <wx/string.h>
30 #include <wx/window.h>
31 
32 #include "model/nmea_log.h"
33 
34 #include "WindowDestroyListener.h"
35 #include "TTYWindow.h"
36 
49 public:
50  static NMEALogWindow &GetInstance();
51  NMEALogWindow(const NMEALogWindow &) = delete;
52  NMEALogWindow &operator=(const NMEALogWindow &) = delete;
53  bool Active() const;
54  void Create(wxWindow *parent, int num_lines = 35);
55  void Add(const wxString &s);
56  void Refresh(bool do_refresh = false);
57  int GetSizeW();
58  int GetSizeH();
59  int GetPosX();
60  int GetPosY();
61  void SetSize(int w, int h);
62  void SetSize(const wxSize &size);
63  void SetPos(int x, int y);
64  void SetPos(const wxPoint &pos);
65  void CheckPos(int display_width, int display_height);
66  void Move();
67  virtual void DestroyWindow();
68  static void Shutdown();
69  wxWindow *GetTTYWindow(void) { return static_cast<wxWindow*>(m_window); }
70 
71 private:
72  NMEALogWindow();
73  virtual ~NMEALogWindow(){};
74  void UpdateGeometry();
75 
76  static NMEALogWindow *instance;
77  TTYWindow *m_window;
78  int m_width;
79  int m_height;
80  int m_pos_x;
81  int m_pos_y;
82 };
83 
84 #endif
This class provides access to the NMEA log/debug window.
Definition: NMEALogWindow.h:48
bool Active() const
Return true if log is visible i.
void Add(const wxString &s)
Add an formatted string to log output.