KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIPLATFORM::UI Namespace Reference

Functions

bool IsDarkTheme ()
 Determine if the desktop interface is currently using a dark theme or a light theme. More...
 
void ForceFocus (wxWindow *aWindow)
 Pass the current focus to the window. More...
 
bool IsWindowActive (wxWindow *aWindow)
 Check to see if the given window is the currently active window (e.g. More...
 
void ReparentQuasiModal (wxNonOwnedWindow *aWindow)
 Move a window's parent to be the top-level window and force the window to be on top. More...
 
void FixupCancelButtonCmdKeyCollision (wxWindow *aWindow)
 
bool IsStockCursorOk (wxStockCursor aCursor)
 Checks if we designated a stock cursor for this OS as "OK" or else we may need to load a custom one. More...
 
void LargeChoiceBoxHack (wxChoice *aChoice)
 Configure a wxChoice control to support a lot of entries by disabling functionality that makes adding new items become very expensive. More...
 
void EllipsizeChoiceBox (wxChoice *aChoice)
 Configure a wxChoice control to ellipsize the shown text in the button with the ellipses placed at the end of the string. More...
 
double GetPixelScaleFactor (const wxWindow *aWindow)
 Tries to determine the pixel scaling factor currently in use for the window. More...
 
double GetContentScaleFactor (const wxWindow *aWindow)
 Tries to determine the content scaling factor currently in use for the window. More...
 
wxSize GetUnobscuredSize (const wxWindow *aWindow)
 Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl, wxGrid) that won't be obscured by scrollbars. More...
 
void SetOverlayScrolling (const wxWindow *aWindow, bool overlay)
 Used to set overlay/non-overlay scrolling mode in a window. More...
 
bool AllowIconsInMenus ()
 If the user has disabled icons system-wide, we check that here. More...
 
void WarpPointer (wxWindow *aWindow, int aX, int aY)
 Move the mouse cursor to a specific position relative to the window. More...
 
void ImmControl (wxWindow *aWindow, bool aEnable)
 Configures the IME mode of a given control handle. More...
 

Function Documentation

◆ AllowIconsInMenus()

bool KIPLATFORM::UI::AllowIconsInMenus ( )

If the user has disabled icons system-wide, we check that here.

Definition at line 186 of file gtk/ui.cpp.

Referenced by PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS().

◆ EllipsizeChoiceBox()

void KIPLATFORM::UI::EllipsizeChoiceBox ( wxChoice *  aChoice)

Configure a wxChoice control to ellipsize the shown text in the button with the ellipses placed at the end of the string.

Parameters
aChoiceis the choice box to ellipsize

Definition at line 131 of file gtk/ui.cpp.

Referenced by DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL().

◆ FixupCancelButtonCmdKeyCollision()

void KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision ( wxWindow *  aWindow)

Definition at line 71 of file gtk/ui.cpp.

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), and DIALOG_SHIM::OnPaint().

◆ ForceFocus()

void KIPLATFORM::UI::ForceFocus ( wxWindow *  aWindow)

Pass the current focus to the window.

On OSX this will forcefully give the focus to the desired window, while on MSW and GTK it will simply call the wxWidgets SetFocus() function.

Parameters
aWindowis the window to pass focus to

Definition at line 44 of file gtk/ui.cpp.

Referenced by NET_SELECTOR_COMBOPOPUP::doSetFocus(), DIALOG_SHIM::OnPaint(), DIALOG_DRC::OnRunDRCClick(), and DIALOG_ERC::OnRunERCClick().

◆ GetContentScaleFactor()

double KIPLATFORM::UI::GetContentScaleFactor ( const wxWindow *  aWindow)

Tries to determine the content scaling factor currently in use for the window.

The content scaling factor is typically settable by the user and may differ from the pixel scaling factor.

Definition at line 165 of file gtk/ui.cpp.

References GetPixelScaleFactor().

Referenced by DPI_SCALING::GetContentScaleFactor().

◆ GetPixelScaleFactor()

double KIPLATFORM::UI::GetPixelScaleFactor ( const wxWindow *  aWindow)

Tries to determine the pixel scaling factor currently in use for the window.

Under wx3.0, GTK fails to properly detect the scale factor.

Parameters
aWindowpointer to the window to check
Returns
Pixel scale factor in use, defaulting to the wxWidgets method

Definition at line 152 of file gtk/ui.cpp.

Referenced by GetContentScaleFactor(), and DPI_SCALING::GetScaleFactor().

◆ GetUnobscuredSize()

◆ ImmControl()

void KIPLATFORM::UI::ImmControl ( wxWindow *  aWindow,
bool  aEnable 
)

Configures the IME mode of a given control handle.

Definition at line 221 of file gtk/ui.cpp.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ IsDarkTheme()

bool KIPLATFORM::UI::IsDarkTheme ( )

◆ IsStockCursorOk()

bool KIPLATFORM::UI::IsStockCursorOk ( wxStockCursor  aCursor)

Checks if we designated a stock cursor for this OS as "OK" or else we may need to load a custom one.

Parameters
aCursoris wxStockCursor we want to see if its acceptable

Definition at line 77 of file gtk/ui.cpp.

Referenced by CURSOR_STORE::GetStockCursor().

◆ IsWindowActive()

bool KIPLATFORM::UI::IsWindowActive ( wxWindow *  aWindow)

Check to see if the given window is the currently active window (e.g.

the window in the foreground the user is interacting with).

Parameters
aWindowis the window to check

Definition at line 50 of file gtk/ui.cpp.

Referenced by TOOL_DISPATCHER::DispatchWxEvent(), EDA_DRAW_PANEL_GAL::onEnter(), KIGFX::WX_VIEW_CONTROLS::onEnter(), EDA_DRAW_PANEL_GAL::OnEvent(), and KIGFX::WX_VIEW_CONTROLS::onMotion().

◆ LargeChoiceBoxHack()

void KIPLATFORM::UI::LargeChoiceBoxHack ( wxChoice *  aChoice)

Configure a wxChoice control to support a lot of entries by disabling functionality that makes adding new items become very expensive.

Parameters
aChoiceis the choice box to modify

Definition at line 113 of file gtk/ui.cpp.

References disable_area_apply_attributes_cb().

Referenced by FONT_CHOICE::FONT_CHOICE().

◆ ReparentQuasiModal()

void KIPLATFORM::UI::ReparentQuasiModal ( wxNonOwnedWindow *  aWindow)

Move a window's parent to be the top-level window and force the window to be on top.

This only has an affect for OSX, it is a NOP for GTK and MSW.

Apple in its infinite wisdom will raise a disabled window before even passing us the event, so we have no way to stop it. Instead, we must set an order on the windows so that the quasi-modal will be pushed in front of the disabled window when it is raised.

Parameters
aWindowis the window to reparent

Definition at line 65 of file gtk/ui.cpp.

Referenced by PCB_VIEWER_TOOLS::Show3DViewer(), and DIALOG_SHIM::ShowQuasiModal().

◆ SetOverlayScrolling()

void KIPLATFORM::UI::SetOverlayScrolling ( const wxWindow *  aWindow,
bool  overlay 
)

Used to set overlay/non-overlay scrolling mode in a window.

Implemented only on GTK.

Definition at line 179 of file gtk/ui.cpp.

References overlay.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ WarpPointer()

void KIPLATFORM::UI::WarpPointer ( wxWindow *  aWindow,
int  aX,
int  aY 
)

Move the mouse cursor to a specific position relative to the window.

Parameters
aWindowWindow in which to position to mouse cursor
aXdestination x position
aYdestination y position

Definition at line 196 of file gtk/ui.cpp.

Referenced by KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), KIGFX::WX_VIEW_CONTROLS::handleCursorCapture(), KIGFX::WX_VIEW_CONTROLS::onMotion(), and KIGFX::WX_VIEW_CONTROLS::WarpMouseCursor().