OpenCPN Partial API docs
Loading...
Searching...
No Matches
gui_lib.h File Reference

General purpose GUI support. More...

#include <wx/font.h>
#include <wx/html/htmlwin.h>
#include <wx/msgdlg.h>
#include <wx/textctrl.h>
#include <wx/timer.h>
#include <wx/window.h>
#include <wx/utils.h>

Go to the source code of this file.

Classes

class  CopyableText
 Non-editable TextCtrl, used like wxStaticText but is copyable. More...
 
class  OCPNMessageDialog
 
class  TimedMessageBox
 
class  OCPN_TimedHTMLMessageDialog
 
class  TimedPopupWin
 

Functions

wxFont * GetOCPNScaledFont (wxString item, int default_size=0)
 Retrieves a font from FontMgr, optionally scaled for physical readability.
 
wxFont GetOCPNGUIScaledFont (wxString item)
 Retrieves a font optimized for touch and high-resolution interfaces.
 
int OCPNMessageBox (wxWindow *parent, const wxString &message, const wxString &caption=_T("Message"), int style=wxOK, int timout_sec=-1, int x=-1, int y=-1)
 

Detailed Description

General purpose GUI support.

Definition in file gui_lib.h.

Function Documentation

◆ GetOCPNGUIScaledFont()

wxFont GetOCPNGUIScaledFont ( wxString  item)

Retrieves a font optimized for touch and high-resolution interfaces.

Generates a font specifically tuned for responsive and touch-friendly interfaces, with more aggressive scaling than standard font methods.

Parameters
itemUI element identifier (e.g., "AISTargetAlert", "StatusBar")
Returns
A wxFont object scaled for touch and high-resolution interfaces
Note
Ensures minimum physical font size for improved readability
Particularly suitable for toolbars, buttons, and touch controls

Definition at line 83 of file gui_lib.cpp.

◆ GetOCPNScaledFont()

wxFont * GetOCPNScaledFont ( wxString  item,
int  default_size = 0 
)

Retrieves a font from FontMgr, optionally scaled for physical readability.

Returns a font configured for a specific UI context, scaling based on system settings and preserving readability across different displays.

Parameters
itemUI element identifier (e.g., "AISTargetAlert", "StatusBar")
default_sizeOptional base font size in points. 0 uses platform default.
Returns
Pointer to a dynamically scaled wxFont
Note
Font is managed by OpenCPN's central font cache
Pointer is shared and should not be deleted by caller

Definition at line 54 of file gui_lib.cpp.

◆ OCPNMessageBox()

int OCPNMessageBox ( wxWindow *  parent,
const wxString &  message,
const wxString &  caption = _T("Message"),
int  style = wxOK,
int  timout_sec = -1,
int  x = -1,
int  y = -1 
)
extern

Definition at line 110 of file gui_lib.cpp.