KiCad PCB EDA Suite
|
Functions | |
bool | IsDarkTheme () |
Determine if the desktop interface is currently using a dark theme or a light theme. | |
wxColour | GetDialogBGColour () |
void | ForceFocus (wxWindow *aWindow) |
Pass the current focus to the window. | |
bool | IsWindowActive (wxWindow *aWindow) |
Check to see if the given window is the currently active window (e.g. | |
void | ReparentModal (wxNonOwnedWindow *aWindow) |
Move a window's parent to be the top-level window and force the window to be on top. | |
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. | |
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. | |
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. | |
double | GetPixelScaleFactor (const wxWindow *aWindow) |
Tries to determine the pixel scaling factor currently in use for the window. | |
double | GetContentScaleFactor (const wxWindow *aWindow) |
Tries to determine the content scaling factor currently in use for the window. | |
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. | |
void | SetOverlayScrolling (const wxWindow *aWindow, bool overlay) |
Used to set overlay/non-overlay scrolling mode in a window. | |
bool | AllowIconsInMenus () |
If the user has disabled icons system-wide, we check that here. | |
wxPoint | GetMousePosition () |
Returns the mouse position in screen coordinates. | |
bool | WarpPointer (wxWindow *aWindow, int aX, int aY) |
Move the mouse cursor to a specific position relative to the window. | |
void | ImmControl (wxWindow *aWindow, bool aEnable) |
Configures the IME mode of a given control handle. | |
void | ImeNotifyCancelComposition (wxWindow *aWindow) |
Asks the IME to cancel. | |
bool | InfiniteDragPrepareWindow (wxWindow *aWindow) |
On Wayland, restricts the pointer movement to a rectangle slightly bigger than the given wxWindow . | |
void | InfiniteDragReleaseWindow () |
On Wayland, allows the cursor to freely move again after a drag (see InfiniteDragPrepareWindow ). | |
void | SetFloatLevel (wxWindow *aWindow) |
Intended to set the floating window level in macOS on a window. | |
bool KIPLATFORM::UI::AllowIconsInMenus | ( | ) |
If the user has disabled icons system-wide, we check that here.
Definition at line 209 of file wxgtk/ui.cpp.
Referenced by PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS().
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.
aChoice | is the choice box to ellipsize |
Definition at line 154 of file wxgtk/ui.cpp.
Referenced by DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL().
void KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision | ( | wxWindow * | aWindow | ) |
Definition at line 94 of file wxgtk/ui.cpp.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), SYMBOL_CHOOSER_FRAME::OnPaint(), FOOTPRINT_CHOOSER_FRAME::OnPaint(), and DIALOG_SHIM::OnPaint().
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.
aWindow | is the window to pass focus to |
Definition at line 67 of file wxgtk/ui.cpp.
Referenced by FILTER_COMBOPOPUP::doSetFocus(), SYMBOL_CHOOSER_FRAME::OnPaint(), FOOTPRINT_CHOOSER_FRAME::OnPaint(), DIALOG_SHIM::OnPaint(), DIALOG_DRC::OnRunDRCClick(), DIALOG_ERC::OnRunERCClick(), and EE_INSPECTION_TOOL::ShowERCDialog().
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 188 of file wxgtk/ui.cpp.
References GetPixelScaleFactor().
Referenced by DPI_SCALING_COMMON::GetContentScaleFactor(), and WX_AUI_TOOLBAR_ART::GetToolSize().
wxColour KIPLATFORM::UI::GetDialogBGColour | ( | ) |
Definition at line 61 of file wxgtk/ui.cpp.
Referenced by SCH_PIN_TABLE_DATA_MODEL::BuildAttrs(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), and DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES().
wxPoint KIPLATFORM::UI::GetMousePosition | ( | ) |
Returns the mouse position in screen coordinates.
If we've just warped the cursor, returns the new coordinates.
Definition at line 620 of file wxgtk/ui.cpp.
Referenced by EDIT_TOOL::doMoveSelection(), PAD_TOOL::EnumeratePads(), TOOL_MANAGER::GetCursorPosition(), TOOL_MANAGER::GetMousePosition(), KIGFX::WX_VIEW_CONTROLS::getMouseScreenPosition(), DRAWING_TOOL::InteractivePlaceWithPreview(), FILTER_COMBOPOPUP::onIdle(), KIGFX::WX_VIEW_CONTROLS::onMotion(), PCB_ONE_LAYER_SELECTOR::OnMouseMove(), ACTION_TOOLBAR::onTimerDone(), EDIT_TOOL::pickReferencePoint(), POSITION_RELATIVE_TOOL::PositionRelativeInteractively(), PCB_PICKER_TOOL::SelectItemInteractively(), PCB_PICKER_TOOL::SelectPointInteractively(), and SCH_DRAWING_TOOLS::TwoClickPlace().
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.
aWindow | pointer to the window to check |
Definition at line 175 of file wxgtk/ui.cpp.
Referenced by ACTION_TOOLBAR_PALETTE::AddAction(), WX_AUI_TOOLBAR_ART::DrawButton(), GetContentScaleFactor(), DPI_SCALING_COMMON::GetScaleFactor(), and BITMAP_BUTTON::OnPaint().
wxSize KIPLATFORM::UI::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.
aWindow | pointer to the scrollable widget to check |
Definition at line 195 of file wxgtk/ui.cpp.
Referenced by DIALOG_BOARD_STATISTICS::adjustDrillGridColumns(), DIALOG_SYMBOL_PROPERTIES::AdjustFieldsGridColumns(), DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns(), DIALOG_LIB_EDIT_PIN_TABLE::adjustGridColumns(), DIALOG_LIB_SYMBOL_PROPERTIES::adjustGridColumns(), DIALOG_PIN_PROPERTIES::adjustGridColumns(), DIALOG_SHEET_PROPERTIES::AdjustGridColumns(), DIALOG_FOOTPRINT_PROPERTIES::adjustGridColumns(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::adjustGridColumns(), DIALOG_SWAP_LAYERS::adjustGridColumns(), PANEL_FP_PROPERTIES_3D_MODEL::AdjustGridColumnWidths(), DIALOG_SYMBOL_PROPERTIES::AdjustPinsGridColumns(), DIALOG_SIM_MODEL< T >::onPinAssignmentsGridSize(), DIALOG_SYMBOL_FIELDS_TABLE::OnSizeFieldList(), and PANEL_PACKAGES_VIEW::OnSizeInfoBox().
void KIPLATFORM::UI::ImeNotifyCancelComposition | ( | wxWindow * | aWindow | ) |
Asks the IME to cancel.
Definition at line 324 of file wxgtk/ui.cpp.
Referenced by EDA_DRAW_PANEL_GAL::SetFocus().
void KIPLATFORM::UI::ImmControl | ( | wxWindow * | aWindow, |
bool | aEnable | ||
) |
Configures the IME mode of a given control handle.
Definition at line 319 of file wxgtk/ui.cpp.
Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().
bool KIPLATFORM::UI::InfiniteDragPrepareWindow | ( | wxWindow * | aWindow | ) |
On Wayland, restricts the pointer movement to a rectangle slightly bigger than the given wxWindow
.
This way, the cursor doesn't exit the (bigger) application window and we retain control on it. Required to make the infinite mouse-drag work with fast movement. See https://gitlab.com/kicad/code/kicad/-/issues/7207#note_1562089503
aWindow | Window in which to position to mouse cursor |
Definition at line 607 of file wxgtk/ui.cpp.
Referenced by KIGFX::WX_VIEW_CONTROLS::onButton().
void KIPLATFORM::UI::InfiniteDragReleaseWindow | ( | ) |
On Wayland, allows the cursor to freely move again after a drag (see InfiniteDragPrepareWindow
).
Definition at line 614 of file wxgtk/ui.cpp.
Referenced by KIGFX::WX_VIEW_CONTROLS::onButton().
bool KIPLATFORM::UI::IsDarkTheme | ( | ) |
Determine if the desktop interface is currently using a dark theme or a light theme.
Definition at line 48 of file wxgtk/ui.cpp.
Referenced by EDA_DRAW_FRAME::addApiPluginTools(), WX_AUI_TOOLBAR_ART::DrawButton(), WX_HTML_REPORT_PANEL::generateHtml(), ZONE_MANAGER_PREFERENCE::GetBoundBoundingFillColor(), ZONE_MANAGER_PREFERENCE::GetCanvasBackgroundColor(), BITMAP_STORE::GetDisabledBitmapBundle(), BITMAP_BUTTON::OnPaint(), SPLIT_BUTTON::OnPaint(), STD_BITMAP_BUTTON::OnPaint(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), LIB_TREE_RENDERER::Render(), ACTION_TOOLBAR::SetToolBitmap(), SYMBOLS_LISTBOX::SYMBOLS_LISTBOX(), BITMAP_STORE::ThemeChanged(), DIALOG_TABLE_PROPERTIES::TransferDataToWindow(), WX_GRID_ALT_ROW_COLOR_PROVIDER::UpdateColors(), NUMBER_BADGE::UpdateNumber(), and WX_INFOBAR::WX_INFOBAR().
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.
aCursor | is wxStockCursor we want to see if its acceptable |
Definition at line 100 of file wxgtk/ui.cpp.
Referenced by CURSOR_STORE::GetStockCursor().
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).
aWindow | is the window to check |
Definition at line 73 of file wxgtk/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().
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.
aChoice | is the choice box to modify |
Definition at line 136 of file wxgtk/ui.cpp.
References disable_area_apply_attributes_cb().
Referenced by FONT_CHOICE::FONT_CHOICE().
void KIPLATFORM::UI::ReparentModal | ( | 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.
aWindow | is the window to reparent |
Definition at line 88 of file wxgtk/ui.cpp.
Referenced by PCB_VIEWER_TOOLS::Show3DViewer(), FOOTPRINT_CHOOSER_FRAME::Show3DViewerFrame(), DIALOG_SHIM::ShowModal(), and DIALOG_SHIM::ShowQuasiModal().
void KIPLATFORM::UI::SetFloatLevel | ( | wxWindow * | aWindow | ) |
Intended to set the floating window level in macOS on a window.
Definition at line 338 of file wxgtk/ui.cpp.
Referenced by DIALOG_DRC::DIALOG_DRC(), DIALOG_ERC::DIALOG_ERC(), DIALOG_DRC::OnRunDRCClick(), and DIALOG_ERC::OnRunERCClick().
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 202 of file wxgtk/ui.cpp.
References overlay.
Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().
bool KIPLATFORM::UI::WarpPointer | ( | wxWindow * | aWindow, |
int | aX, | ||
int | aY | ||
) |
Move the mouse cursor to a specific position relative to the window.
aWindow | Window in which to position to mouse cursor |
aX | destination x position |
aY | destination y position |
Definition at line 253 of file wxgtk/ui.cpp.
References traceWayland.
Referenced by KIGFX::WX_VIEW_CONTROLS::CenterOnCursor(), KIGFX::WX_VIEW_CONTROLS::handleCursorCapture(), KIGFX::WX_VIEW_CONTROLS::onMotion(), and KIGFX::WX_VIEW_CONTROLS::WarpMouseCursor().