OpenCPN Partial API docs
|
Tooltip with color scheme support and high-visibility mode. More...
#include <tooltip.h>
Public Member Functions | |
Tooltip (wxWindow *parent, TooltipCallback on_destroy) | |
void | SetString (const wxString &text) |
Set the tooltip text to display. | |
void | SetRelativePosition (const wxRect &windowRect, int offsetX=2, int offsetY=0) |
Position tooltip relative to a window rectangle with automatic screen boundary detection. | |
void | SetHiviz (bool hiviz) |
Enable/disable high visibility mode. | |
void | SetColorScheme (ColorScheme cs) |
Set the color scheme for tooltip appearance. | |
void | SetAbsolutePosition (const wxPoint &pt) |
Set the tooltip position in absolute screen coordinates (physical pixels). | |
void | SetBitmap () |
Create the tooltip bitmap. | |
wxSize | GetRenderedSize () const |
Get the rendered size of the tooltip. | |
void | ShowTooltip (int delay_ms=0) |
Show the tooltip with optional delay in milliseconds. | |
void | HideTooltip () |
Hide the tooltip immediately. | |
bool | Destroy () override |
void | OnPaint (wxPaintEvent &event) |
void | OnTimer (wxTimerEvent &event) |
Tooltip with color scheme support and high-visibility mode.
This class is typically not instantiated directly by developers. Use TooltipManager::Get().ShowTooltip()
Tooltip::Tooltip | ( | wxWindow * | parent, |
TooltipCallback | on_destroy | ||
) |
Definition at line 44 of file tooltip.cpp.
Tooltip::~Tooltip | ( | ) |
Definition at line 61 of file tooltip.cpp.
|
override |
Definition at line 67 of file tooltip.cpp.
wxSize Tooltip::GetRenderedSize | ( | ) | const |
Get the rendered size of the tooltip.
Definition at line 141 of file tooltip.cpp.
void Tooltip::HideTooltip | ( | ) |
Hide the tooltip immediately.
Definition at line 260 of file tooltip.cpp.
void Tooltip::OnPaint | ( | wxPaintEvent & | event | ) |
Definition at line 266 of file tooltip.cpp.
void Tooltip::OnTimer | ( | wxTimerEvent & | event | ) |
Definition at line 278 of file tooltip.cpp.
void Tooltip::SetAbsolutePosition | ( | const wxPoint & | pt | ) |
Set the tooltip position in absolute screen coordinates (physical pixels).
Position (0,0) represents the top-left corner of the primary display. All coordinates are in physical pixels, which may differ from logical pixels on high-DPI displays.
Definition at line 74 of file tooltip.cpp.
void Tooltip::SetBitmap | ( | ) |
Create the tooltip bitmap.
Definition at line 217 of file tooltip.cpp.
void Tooltip::SetColorScheme | ( | ColorScheme | cs | ) |
Set the color scheme for tooltip appearance.
Definition at line 81 of file tooltip.cpp.
void Tooltip::SetHiviz | ( | bool | hiviz | ) |
Enable/disable high visibility mode.
Definition at line 79 of file tooltip.cpp.
void Tooltip::SetRelativePosition | ( | const wxRect & | windowRect, |
int | offsetX = 2 , |
||
int | offsetY = 0 |
||
) |
Position tooltip relative to a window rectangle with automatic screen boundary detection.
The window rectangle should be in the same coordinate system as the tooltip's parent. The tooltip position is automatically adjusted to stay within screen bounds.
windowRect | Rectangle of the window in parent's client coordinates (physical pixels) |
offsetX | Horizontal offset from window's right edge in physical pixels |
offsetY | Vertical offset from window's top edge in physical pixels |
Definition at line 88 of file tooltip.cpp.
void Tooltip::SetString | ( | const wxString & | text | ) |
Set the tooltip text to display.
Definition at line 72 of file tooltip.cpp.
void Tooltip::ShowTooltip | ( | int | delay_ms = 0 | ) |
Show the tooltip with optional delay in milliseconds.
The tooltip is positioned according to the previously set position (via SetAbsolutePosition or SetRelativePosition).
delay_ms | Delay in milliseconds before showing the tooltip (0 = immediate) |
Definition at line 245 of file tooltip.cpp.