KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CURSOR_STORE Class Reference

Simple class to construct and store cursors against unique ID keys. More...

#include <cursors.h>

Classes

struct  CURSOR_DEF
 Definition of a cursor. More...
 

Static Public Member Functions

static const WX_CURSOR_TYPE GetCursor (KICURSOR aCursorType, bool aHiDPI=false)
 Get a cursor bundle (wx 3.3+) or appropriate cursor (older versions)
 
static wxStockCursor GetStockCursor (KICURSOR aCursorType)
 Get stock cursor type for the given cursor.
 

Private Member Functions

 CURSOR_STORE ()
 Construct a store with cursors for all defined types.
 
const wxCursor & storeGetCursor (KICURSOR aIdKey, bool aHiDPI=false) const
 Get a cursor by its ID, automatically selecting the appropriate resolution.
 

Private Attributes

std::map< KICURSOR, wxCursor > m_standardCursorMap
 
std::map< KICURSOR, wxCursor > m_hidpiCursorMap
 

Detailed Description

Simple class to construct and store cursors against unique ID keys.

This can be used to lazily construct cursors as needed for specific applications.

Definition at line 106 of file cursors.h.

Constructor & Destructor Documentation

◆ CURSOR_STORE()

CURSOR_STORE::CURSOR_STORE ( )
private

Construct a store with cursors for all defined types.

The store will automatically contain both standard and HiDPI cursors.

Definition at line 288 of file cursors.cpp.

References cursors_defs, m_hidpiCursorMap, and m_standardCursorMap.

Member Function Documentation

◆ GetCursor()

const WX_CURSOR_TYPE CURSOR_STORE::GetCursor ( KICURSOR  aCursorType,
bool  aHiDPI = false 
)
static

Get a cursor bundle (wx 3.3+) or appropriate cursor (older versions)

Parameters
aCursorTypethe cursor type to get
aHiDPIwhether to prefer HiDPI version for older wx versions
Returns
the cursor bundle or cursor

Definition at line 363 of file cursors.cpp.

References GetStockCursor(), and storeGetCursor().

Referenced by KIGFX::CAIRO_GAL::SetNativeCursorStyle(), and KIGFX::OPENGL_GAL::SetNativeCursorStyle().

◆ GetStockCursor()

wxStockCursor CURSOR_STORE::GetStockCursor ( KICURSOR  aCursorType)
static

Get stock cursor type for the given cursor.

Parameters
aCursorTypethe cursor type
Returns
stock cursor type, or wxCURSOR_MAX if not a stock cursor

Definition at line 382 of file cursors.cpp.

References KIPLATFORM::UI::IsStockCursorOk().

Referenced by GetCursor().

◆ storeGetCursor()

const wxCursor & CURSOR_STORE::storeGetCursor ( KICURSOR  aIdKey,
bool  aHiDPI = false 
) const
private

Get a cursor by its ID, automatically selecting the appropriate resolution.

Parameters
aIdKeythe ID key to look up
aHiDPIwhether to prefer HiDPI version if available
Returns
the cursor, if found, else wxNullCursor

Definition at line 348 of file cursors.cpp.

References m_hidpiCursorMap, and m_standardCursorMap.

Referenced by GetCursor().

Member Data Documentation

◆ m_hidpiCursorMap

std::map<KICURSOR, wxCursor> CURSOR_STORE::m_hidpiCursorMap
private

Definition at line 164 of file cursors.h.

Referenced by CURSOR_STORE(), and storeGetCursor().

◆ m_standardCursorMap

std::map<KICURSOR, wxCursor> CURSOR_STORE::m_standardCursorMap
private

Definition at line 163 of file cursors.h.

Referenced by CURSOR_STORE(), and storeGetCursor().


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