|
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 | ReparentWindow (wxNonOwnedWindow *aWindow, wxTopLevelWindow *aParent) |
| 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. | |
| void | GetInfoBarColours (wxColour &aFGColour, wxColour &aBGColour) |
| Return the background and foreground colors for info bars in the current scheme. | |
| 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 | EnsureVisible (wxWindow *aWindow) |
| Ensure that a window is visible on the screen. | |
| void | SetFloatLevel (wxWindow *aWindow) |
| Intended to set the floating window level in macOS on a window. | |
| void | ReleaseChildWindow (wxNonOwnedWindow *aWindow) |
| Release a modal window's parent-child relationship with its parent window. | |
| void | AllowNetworkFileSystems (wxDialog *aDialog) |
| Configure a file dialog to show network and virtual file systems. | |
| bool KIPLATFORM::UI::AllowIconsInMenus | ( | ) |
If the user has disabled icons system-wide, we check that here.
Definition at line 295 of file wxgtk/ui.cpp.
Referenced by PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS().
| void KIPLATFORM::UI::AllowNetworkFileSystems | ( | wxDialog * | aDialog | ) |
Configure a file dialog to show network and virtual file systems.
On GTK, file dialogs default to showing only local files, which excludes GVFS-mounted filesystems like Google Drive, SMB shares, SFTP connections, and removable media mounted through GVFS. This function configures the dialog to also show these non-local filesystems.
This function must be called after creating the dialog but before calling ShowModal().
This is a NOP on Windows and macOS where network filesystems are shown by default.
| aDialog | is the file dialog to configure |
Definition at line 717 of file wxgtk/ui.cpp.
Referenced by PL_EDITOR_FRAME::AddDrawingSheetItem(), KICAD_MANAGER_CONTROL::ArchiveProject(), AskLoadBoardFileName(), AskSaveBoardFileName(), PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), BOARD_EDITOR_CONTROL::ExportCmpFile(), BITMAP2CMP_FRAME::ExportDrawingSheetFormat(), BITMAP2CMP_FRAME::ExportEeschemaFormat(), FOOTPRINT_EDIT_FRAME::ExportFootprint(), BOARD_EDITOR_CONTROL::ExportHyperlynx(), BOARD_EDITOR_CONTROL::ExportNetlist(), BITMAP2CMP_FRAME::ExportPcbnewFormat(), SIMULATOR_CONTROL::ExportPlotAsCSV(), SIMULATOR_CONTROL::ExportPlotAsPNG(), BITMAP2CMP_FRAME::ExportPostScriptFormat(), SYMBOL_EDIT_FRAME::ExportSymbol(), PCB_EDIT_TABLE_TOOL::ExportTableToCSV(), SCH_EDIT_TABLE_TOOL::ExportTableToCSV(), GERBVIEW_CONTROL::ExportToPcbnew(), SYMBOL_EDITOR_CONTROL::ExportView(), PL_EDITOR_FRAME::Files_io(), BOARD_EDITOR_CONTROL::GenBOMFileFromBoard(), BOARD_EDITOR_CONTROL::GenD356File(), PCB_NET_INSPECTOR_PANEL::generateReport(), EDA_3D_VIEWER_FRAME::getExportFileName(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), SCH_EDITOR_CONTROL::ImportFPAssignments(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), SCH_DRAWING_TOOLS::ImportSheet(), SYMBOL_EDIT_FRAME::ImportSymbol(), EDA_DRAW_FRAME::LibraryFileBrowser(), GERBVIEW_FRAME::LoadFileOrShowDialog(), GERBVIEW_FRAME::LoadGerberJobFile(), SCH_EDIT_FRAME::LoadProject(), GERBVIEW_FRAME::LoadZipArchiveFile(), KICAD_MANAGER_CONTROL::NewJobsetFile(), KICAD_MANAGER_CONTROL::NewProject(), SCH_EDIT_FRAME::NewProject(), KICAD_MANAGER_CONTROL::newProjectDirectory(), PANEL_EMBEDDED_FILES::onAddEmbeddedFiles(), DIALOG_CONFIG_EQUFILES::OnAddFiles(), DIALOG_SIM_MODEL< T >::onBrowseButtonClick(), DIALOG_IMPORT_SETTINGS::OnBrowseClicked(), DIALOG_SCH_IMPORT_SETTINGS::OnBrowseClicked(), DIALOG_EXPORT_2581::onBrowseClicked(), DIALOG_EXPORT_ODBPP::onBrowseClicked(), DIALOG_EXPORT_STEP::onBrowseClicked(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowseClicked(), DIALOG_IMPORT_GFX_SCH::onBrowseFiles(), DIALOG_IMPORT_GRAPHICS::onBrowseFiles(), DIALOG_IMPORT_NETLIST::onBrowseNetlistFiles(), WX_HTML_REPORT_PANEL::onBtnSaveToFile(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), TEXT_BUTTON_URL::OnButtonClick(), PANEL_REGULATOR::OnDataFileSelection(), PANEL_PACKAGES_VIEW::OnDownloadVersionClicked(), PG_URL_EDITOR::OnEvent(), DIALOG_LIB_EDIT_PIN_TABLE::OnExportButtonClick(), DIALOG_GENDRILL::onGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_PCM::OnInstallFromFileClicked(), BITMAP2CMP_FRAME::OnLoadFile(), PNS_LOG_VIEWER_FRAME::onOpen(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_SYMBOL_FIELDS_TABLE::OnOutputFileBrowseClicked(), DIALOG_DESTINATION::onOutputPathBrowseClicked(), PANEL_COMMON_SETTINGS::OnPDFViewerClick(), PNS_LOG_VIEWER_FRAME::onSaveAs(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_DRC::OnSaveReport(), DIALOG_ERC::OnSaveReport(), DIALOG_PAGES_SETTINGS::OnWksFileSelection(), KICAD_MANAGER_CONTROL::OpenJobsetFile(), KICAD_MANAGER_CONTROL::openProject(), SIMULATOR_CONTROL::OpenWorkbook(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceReferenceImage(), PIN_TABLE_IMPORT::promptForFile(), SCH_EDITOR_CONTROL::SaveCurrSheetCopyAs(), SYMBOL_EDIT_FRAME::saveLibrary(), SCH_EDIT_FRAME::SaveProject(), KICAD_MANAGER_CONTROL::SaveProjectAs(), DIALOG_BOARD_STATISTICS::saveReportClicked(), ROUTER_TOOL::saveRouterDebugLog(), SIMULATOR_CONTROL::SaveWorkbook(), DIALOG_EXPORT_NETLIST::TransferDataFromWindow(), and KICAD_MANAGER_FRAME::UnarchiveFiles().
| 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 240 of file wxgtk/ui.cpp.
Referenced by DIALOG_SELECT_3DMODEL::DIALOG_SELECT_3DMODEL().
| void KIPLATFORM::UI::EnsureVisible | ( | wxWindow * | aWindow | ) |
Ensure that a window is visible on the screen.
On MacOS, this will make it visible in all Spaces. Other platforms are nops.
| aWindow | window to make visible |
Definition at line 162 of file wxgtk/ui.cpp.
Referenced by DIALOG_SHIM::Show().
| void KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision | ( | wxWindow * | aWindow | ) |
Definition at line 180 of file wxgtk/ui.cpp.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_SHIM::OnPaint(), FOOTPRINT_CHOOSER_FRAME::OnPaint(), and SYMBOL_CHOOSER_FRAME::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 125 of file wxgtk/ui.cpp.
Referenced by FILTER_COMBOPOPUP::doSetFocus(), DIALOG_SHIM::OnPaint(), FOOTPRINT_CHOOSER_FRAME::OnPaint(), SYMBOL_CHOOSER_FRAME::OnPaint(), DIALOG_DRC::OnRunDRCClick(), DIALOG_ERC::OnRunERCClick(), SCH_INSPECTION_TOOL::ShowERCDialog(), and NOTIFICATIONS_MANAGER::ShowList().
| 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 274 of file wxgtk/ui.cpp.
References GetPixelScaleFactor().
Referenced by DPI_SCALING_COMMON::GetContentScaleFactor().
| wxColour KIPLATFORM::UI::GetDialogBGColour | ( | ) |
Definition at line 62 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().
| void KIPLATFORM::UI::GetInfoBarColours | ( | wxColour & | aFGColour, |
| wxColour & | aBGColour ) |
Return the background and foreground colors for info bars in the current scheme.
Definition at line 68 of file wxgtk/ui.cpp.
References path.
Referenced by NOTIFICATION_PANEL::NOTIFICATION_PANEL(), NOTIFICATIONS_LIST::NOTIFICATIONS_LIST(), WX_INFOBAR::onThemeChange(), and WX_INFOBAR::WX_INFOBAR().
| 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 706 of file wxgtk/ui.cpp.
Referenced by SCH_DRAWING_TOOLS::AutoPlaceAllSheetPins(), EDIT_TOOL::doMoveSelection(), PAD_TOOL::EnumeratePads(), TOOL_MANAGER::GetCursorPosition(), TOOL_MANAGER::GetMousePosition(), KIGFX::WX_VIEW_CONTROLS::getMouseScreenPosition(), PCB_CONTROL::InteractiveDelete(), POSITION_RELATIVE_TOOL::InteractiveOffset(), FILTER_COMBOPOPUP::onIdle(), KIGFX::WX_VIEW_CONTROLS::onMotion(), PCB_ONE_LAYER_SELECTOR::OnMouseMove(), ACTION_TOOLBAR::onTimerDone(), BOARD_INSPECTION_TOOL::pickItemForInspection(), PCB_GROUP_TOOL::PickNewMember(), SCH_GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), 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 261 of file wxgtk/ui.cpp.
Referenced by GRID_CELL_ICON_TEXT_RENDERER::Draw(), GRID_CELL_TEXT_RENDERER::Draw(), GRID_CELL_TEXT_RENDERER::GetBestSize(), GetContentScaleFactor(), and DPI_SCALING_COMMON::GetScaleFactor().
| 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 281 of file wxgtk/ui.cpp.
Referenced by DIALOG_BOARD_STATISTICS::adjustDrillGridColumns(), DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns(), DIALOG_LIB_EDIT_PIN_TABLE::adjustGridColumns(), DIALOG_PIN_PROPERTIES::adjustGridColumns(), DIALOG_SWAP_LAYERS::adjustGridColumns(), DIALOG_SYMBOL_PROPERTIES::AdjustPinsGridColumns(), DIALOG_SIM_MODEL< T >::onPinAssignmentsGridSize(), and PANEL_PACKAGES_VIEW::OnSizeInfoBox().
| void KIPLATFORM::UI::ImeNotifyCancelComposition | ( | wxWindow * | aWindow | ) |
Asks the IME to cancel.
Definition at line 410 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 405 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 693 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 700 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 49 of file wxgtk/ui.cpp.
Referenced by EDA_DRAW_FRAME::AddApiPluginTools(), WX_AUI_TOOLBAR_ART::DrawButton(), FILTER_COMBOBOX::FILTER_COMBOBOX(), WX_HTML_REPORT_PANEL::generateHtml(), getBoundBoundingFillColor(), getCanvasBackgroundColor(), BITMAP_STORE::GetDisabledBitmapBundle(), BITMAP_STORE::GetDisabledBitmapBundleDef(), DIALOG_TEMPLATE_SELECTOR::LoadTemplatePreview(), BITMAP_BUTTON::OnPaint(), SPLIT_BUTTON::OnPaint(), STD_BITMAP_BUTTON::OnPaint(), DIALOG_TEMPLATE_SELECTOR::OnWebViewLoaded(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), LIB_TREE_RENDERER::Render(), ACTION_TOOLBAR::SetToolBitmap(), DIALOG_TEMPLATE_SELECTOR::ShowWelcomeHtml(), SYMBOLS_LISTBOX::SYMBOLS_LISTBOX(), BITMAP_STORE::ThemeChanged(), DIALOG_TABLE_PROPERTIES::TransferDataToWindow(), PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow(), WX_GRID_ALT_ROW_COLOR_PROVIDER::UpdateColors(), and NUMBER_BADGE::UpdateNumber().
| 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 186 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 147 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 222 of file wxgtk/ui.cpp.
References disable_area_apply_attributes_cb().
| void KIPLATFORM::UI::ReleaseChildWindow | ( | wxNonOwnedWindow * | aWindow | ) |
Release a modal window's parent-child relationship with its parent window.
This only has an effect on macOS, it is a NOP for GTK and MSW.
On macOS, modal dialogs are attached as child windows using addChildWindow, which causes them to disappear when dragged to a different monitor. This function removes that child relationship and sets the window to a floating level, allowing it to be freely moved across monitors while still staying above other windows.
Definition at line 711 of file wxgtk/ui.cpp.
Referenced by DIALOG_SHIM::OnMove().
| 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 168 of file wxgtk/ui.cpp.
Referenced by DIALOG_SHIM::OnMove(), PCB_VIEWER_TOOLS::Show3DViewer(), FOOTPRINT_CHOOSER_FRAME::Show3DViewerFrame(), DIALOG_SHIM::ShowModal(), and DIALOG_SHIM::ShowQuasiModal().
| void KIPLATFORM::UI::ReparentWindow | ( | wxNonOwnedWindow * | aWindow, |
| wxTopLevelWindow * | aParent ) |
Definition at line 174 of file wxgtk/ui.cpp.
Referenced by BOARD_INSPECTION_TOOL::DiffFootprint(), and BOARD_INSPECTION_TOOL::InspectDRCError().
| void KIPLATFORM::UI::SetFloatLevel | ( | wxWindow * | aWindow | ) |
Intended to set the floating window level in macOS on a window.
Definition at line 424 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 288 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 339 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().