25#include <wx/dcclient.h>
36#include "androidUTIL.h"
40EVT_PAINT(ChInfoWin::OnPaint)
41EVT_ERASE_BACKGROUND(ChInfoWin::OnEraseBackground)
42EVT_MOUSE_EVENTS(ChInfoWin::MouseEvent)
47 long style = wxSIMPLE_BORDER | wxCLIP_CHILDREN | wxFRAME_FLOAT_ON_PARENT;
49 wxPanel::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style);
51 wxFont* dFont = FontMgr::Get().
GetFont(_(
"Dialog"));
54 int ststyle = wxALIGN_LEFT | wxST_NO_AUTORESIZE;
56 new wxStaticText(
this, -1,
"", wxDefaultPosition, wxDefaultSize, ststyle);
62ChInfoWin::~ChInfoWin() {
delete m_pInfoTextCtl; }
64void ChInfoWin::OnEraseBackground(wxEraseEvent& event) {}
66void ChInfoWin::MouseEvent(wxMouseEvent& event) {
68 if (event.LeftDown()) {
72 androidForceFullRepaint();
78void ChInfoWin::OnPaint(wxPaintEvent& event) {
80 GetClientSize(&width, &height);
83 dc.SetBrush(wxBrush(GetGlobalColor(
"UIBCK")));
84 dc.SetPen(wxPen(GetGlobalColor(
"UITX1")));
85 dc.DrawRectangle(0, 0, width, height);
88void ChInfoWin::SetBitmap() {
89 SetBackgroundColour(GetGlobalColor(
"UIBCK"));
91 m_pInfoTextCtl->SetBackgroundColour(GetGlobalColor(
"UIBCK"));
92 m_pInfoTextCtl->SetForegroundColour(GetGlobalColor(
"UITX1"));
94 m_pInfoTextCtl->SetSize(GetCharWidth(), 1, m_size.x - 2 * GetCharWidth(),
96 m_pInfoTextCtl->SetLabel(m_string);
98 wxPoint top_position =
100 SetSize(top_position.x, top_position.y, m_size.x, m_size.y);
101 SetClientSize(m_size.x, m_size.y);
104void ChInfoWin::FitToChars(
int char_width,
int char_height) {
117 size.x = GetCharWidth() * char_width;
118 size.y = GetCharHeight() * (char_height + adjust);
A custom panel for displaying chart information.
wxFont * GetFont(const wxString &TextElement, int requested_font_size=0)
Get a font object for a UI element.
Global color handling by name.
Global variables stored in configuration file.