24#include <wx/dcclient.h>
30#include "OCPNPlatform.h"
33#include "androidUTIL.h"
37EVT_PAINT(ChInfoWin::OnPaint)
38EVT_ERASE_BACKGROUND(ChInfoWin::OnEraseBackground)
39EVT_MOUSE_EVENTS(ChInfoWin::MouseEvent)
44 long style = wxSIMPLE_BORDER | wxCLIP_CHILDREN | wxFRAME_FLOAT_ON_PARENT;
46 wxPanel::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style);
48 wxFont* dFont = FontMgr::Get().
GetFont(_(
"Dialog"));
51 int ststyle = wxALIGN_LEFT | wxST_NO_AUTORESIZE;
52 m_pInfoTextCtl =
new wxStaticText(
this, -1, _T (
"" ), wxDefaultPosition,
53 wxDefaultSize, ststyle);
59ChInfoWin::~ChInfoWin() {
delete m_pInfoTextCtl; }
61void ChInfoWin::OnEraseBackground(wxEraseEvent& event) {}
63void ChInfoWin::MouseEvent(wxMouseEvent& event) {
65 if (event.LeftDown()) {
69 androidForceFullRepaint();
75void ChInfoWin::OnPaint(wxPaintEvent& event) {
77 GetClientSize(&width, &height);
80 dc.SetBrush(wxBrush(GetGlobalColor(_T (
"UIBCK" ))));
81 dc.SetPen(wxPen(GetGlobalColor(_T (
"UITX1" ))));
82 dc.DrawRectangle(0, 0, width, height);
85void ChInfoWin::SetBitmap() {
86 SetBackgroundColour(GetGlobalColor(_T (
"UIBCK" )));
88 m_pInfoTextCtl->SetBackgroundColour(GetGlobalColor(_T (
"UIBCK" )));
89 m_pInfoTextCtl->SetForegroundColour(GetGlobalColor(_T (
"UITX1" )));
91 m_pInfoTextCtl->SetSize(GetCharWidth(), 1, m_size.x - 2 * GetCharWidth(),
93 m_pInfoTextCtl->SetLabel(m_string);
95 wxPoint top_position =
97 SetSize(top_position.x, top_position.y, m_size.x, m_size.y);
98 SetClientSize(m_size.x, m_size.y);
101void ChInfoWin::FitToChars(
int char_width,
int char_height) {
114 size.x = GetCharWidth() * char_width;
115 size.y = GetCharHeight() * (char_height + adjust);
A custom panel for displaying chart information.
wxFont * GetFont(const wxString &TextElement, int requested_font_size=0)
Gets a font object for a UI element.
Global color handling by name.
Global variables stored in configuration file.