OpenCPN Partial API docs
Loading...
Searching...
No Matches
Tooltip Class Reference

Tooltip with color scheme support and high-visibility mode. More...

#include <tooltip.h>

Inheritance diagram for Tooltip:

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)
 

Detailed Description

Tooltip with color scheme support and high-visibility mode.

This class is typically not instantiated directly by developers. Use TooltipManager::Get().ShowTooltip()

Definition at line 39 of file tooltip.h.

Constructor & Destructor Documentation

◆ Tooltip()

Tooltip::Tooltip ( wxWindow *  parent,
TooltipCallback  on_destroy 
)

Definition at line 44 of file tooltip.cpp.

◆ ~Tooltip()

Tooltip::~Tooltip ( )

Definition at line 61 of file tooltip.cpp.

Member Function Documentation

◆ Destroy()

bool Tooltip::Destroy ( )
override

Definition at line 67 of file tooltip.cpp.

◆ GetRenderedSize()

wxSize Tooltip::GetRenderedSize ( ) const

Get the rendered size of the tooltip.

Definition at line 141 of file tooltip.cpp.

◆ HideTooltip()

void Tooltip::HideTooltip ( )

Hide the tooltip immediately.

Definition at line 260 of file tooltip.cpp.

◆ OnPaint()

void Tooltip::OnPaint ( wxPaintEvent &  event)

Definition at line 266 of file tooltip.cpp.

◆ OnTimer()

void Tooltip::OnTimer ( wxTimerEvent &  event)

Definition at line 278 of file tooltip.cpp.

◆ SetAbsolutePosition()

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.

◆ SetBitmap()

void Tooltip::SetBitmap ( )

Create the tooltip bitmap.

Definition at line 217 of file tooltip.cpp.

◆ SetColorScheme()

void Tooltip::SetColorScheme ( ColorScheme  cs)

Set the color scheme for tooltip appearance.

Definition at line 81 of file tooltip.cpp.

◆ SetHiviz()

void Tooltip::SetHiviz ( bool  hiviz)

Enable/disable high visibility mode.

Definition at line 79 of file tooltip.cpp.

◆ SetRelativePosition()

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.

Parameters
windowRectRectangle of the window in parent's client coordinates (physical pixels)
offsetXHorizontal offset from window's right edge in physical pixels
offsetYVertical offset from window's top edge in physical pixels

Definition at line 88 of file tooltip.cpp.

◆ SetString()

void Tooltip::SetString ( const wxString &  text)

Set the tooltip text to display.

Definition at line 72 of file tooltip.cpp.

◆ ShowTooltip()

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).

Parameters
delay_msDelay in milliseconds before showing the tooltip (0 = immediate)

Definition at line 245 of file tooltip.cpp.


The documentation for this class was generated from the following files: