KiCad PCB EDA Suite
|
Functions | |
void | ValidatorTransferToWindowWithoutEvents (wxValidator &aValidator) |
Call a text validator's TransferDataToWindow method without firing a text change event. More... | |
void | SetControlsTabOrder (const std::vector< wxWindow * > &aControlsInTabOrder) |
Set a list of controls to have a defined sequential tab order. More... | |
int | GetStdMargin () |
Get the standard margin around a widget in the KiCad UI. More... | |
wxSize | GetTextSize (const wxString &aSingleLine, wxWindow *aWindow) |
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currently set in that window. More... | |
wxFont | GetMonospacedUIFont () |
wxFont | GetControlFont (wxWindow *aWindow) |
wxFont | GetInfoFont (wxWindow *aWindow) |
wxFont | GetDockedPaneFont (wxWindow *aWindow) |
wxFont | GetStatusFont (wxWindow *aWindow) |
bool | EnsureTextCtrlWidth (wxTextCtrl *aCtrl, const wxString *aString=nullptr) |
Set the minimum pixel width on a text control in order to make a text string be fully visible within it. More... | |
void | SelectReferenceNumber (wxTextEntry *aTextEntry) |
Select the number (or "?") in a reference for ease of editing. More... | |
wxString | EllipsizeStatusText (wxWindow *aWindow, const wxString &aString) |
Ellipsize text (at the end) to be no more than 1/3 of the window width. More... | |
wxString | EllipsizeMenuText (const wxString &aString) |
Ellipsize text (at the end) to be no more than 36 characters. More... | |
bool | IsInputControlFocused (wxWindow *aFocus=nullptr) |
Check if a input control has focus. More... | |
bool | IsInputControlEditable (wxWindow *aControl) |
Check if a input control has focus. More... | |
bool | IsModalDialogFocused () |
void | Disable (wxWindow *aWindow) |
Makes a window read-only. More... | |
Variables | |
const wxString | s_FocusStealableInputName = wxS( "KI_NOFOCUS") |
void KIUI::Disable | ( | wxWindow * | aWindow | ) |
Makes a window read-only.
Does some extra work over wxWindow::Disable() to make sure you can still scroll around in sub-windows.
Definition at line 329 of file ui_common.cpp.
References Disable(), and grid.
Referenced by Disable(), DIALOG_SCHEMATIC_SETUP::onPageChanged(), and DIALOG_BOARD_SETUP::onPageChanged().
wxString KIUI::EllipsizeMenuText | ( | const wxString & | aString | ) |
Ellipsize text (at the end) to be no more than 36 characters.
Definition at line 219 of file ui_common.cpp.
References UnescapeString().
Referenced by LIB_FIELD::GetItemDescription(), LIB_TEXT::GetItemDescription(), SCH_FIELD::GetItemDescription(), SCH_LABEL::GetItemDescription(), SCH_DIRECTIVE_LABEL::GetItemDescription(), SCH_GLOBALLABEL::GetItemDescription(), SCH_HIERLABEL::GetItemDescription(), SCH_SHEET::GetItemDescription(), SCH_SHEET_PIN::GetItemDescription(), SCH_SYMBOL::GetItemDescription(), SCH_TEXT::GetItemDescription(), DS_DRAW_ITEM_TEXT::GetItemDescription(), PCB_DIMENSION_BASE::GetItemDescription(), PCB_FIELD::GetItemDescription(), and PCB_TEXT::GetItemDescription().
wxString KIUI::EllipsizeStatusText | ( | wxWindow * | aWindow, |
const wxString & | aString | ||
) |
Ellipsize text (at the end) to be no more than 1/3 of the window width.
Definition at line 201 of file ui_common.cpp.
References UnescapeString().
Referenced by LIB_FIELD::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), LIB_TEXTBOX::GetMsgPanelInfo(), SCH_FIELD::GetMsgPanelInfo(), SCH_SHEET::GetMsgPanelInfo(), SCH_SYMBOL::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_TEXTBOX::GetMsgPanelInfo(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), and PCB_TEXTBOX::GetMsgPanelInfo().
bool KIUI::EnsureTextCtrlWidth | ( | wxTextCtrl * | aCtrl, |
const wxString * | aString = nullptr |
||
) |
Set the minimum pixel width on a text control in order to make a text string be fully visible within it.
The current font within the text control is considered. The text can come either from the control or be given as an argument. If the text control is larger than needed, then nothing is done.
aCtrl | the text control to potentially make wider. |
aString | the text that is used in sizing the control's pixel width. If NULL, then the text already within the control is used. |
Definition at line 172 of file ui_common.cpp.
References GetTextSize().
Referenced by GERBVIEW_FRAME::UpdateTitleAndInfo().
wxFont KIUI::GetControlFont | ( | wxWindow * | aWindow | ) |
Definition at line 166 of file ui_common.cpp.
References getGUIFont().
Referenced by EDA_MSG_PANEL::GetRequiredHeight(), EDA_MSG_PANEL::OnPaint(), PAGED_DIALOG::PAGED_DIALOG(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), PROJECT_TREE::PROJECT_TREE(), WX_GRID::SetLabelFont(), SIM_NOPLOT_TAB::SIM_NOPLOT_TAB(), and WX_GRID::WX_GRID().
wxFont KIUI::GetDockedPaneFont | ( | wxWindow * | aWindow | ) |
Definition at line 148 of file ui_common.cpp.
References getGUIFont(), and scale.
Referenced by PCB_SEARCH_PANE::PCB_SEARCH_PANE(), PROPERTIES_PANEL::PROPERTIES_PANEL(), and SCH_SEARCH_PANE::SCH_SEARCH_PANE().
wxFont KIUI::GetInfoFont | ( | wxWindow * | aWindow | ) |
Definition at line 160 of file ui_common.cpp.
References getGUIFont().
Referenced by APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D(), APPEARANCE_CONTROLS::createControls(), DIALOG_ASSIGN_NETCLASS::DIALOG_ASSIGN_NETCLASS(), DIALOG_CLEANUP_GRAPHICS::DIALOG_CLEANUP_GRAPHICS(), DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_GET_FOOTPRINT_BY_NAME::DIALOG_GET_FOOTPRINT_BY_NAME(), DIALOG_GLOBAL_EDIT_TEARDROPS::DIALOG_GLOBAL_EDIT_TEARDROPS(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES(), DIALOG_LINE_PROPERTIES::DIALOG_LINE_PROPERTIES(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PRINT_PCBNEW::DIALOG_PRINT_PCBNEW(), DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SIM_MODEL< T_symbol, T_field >::DIALOG_SIM_MODEL(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_WIRE_BUS_PROPERTIES::DIALOG_WIRE_BUS_PROPERTIES(), PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS(), PANEL_EESCHEMA_EDITING_OPTIONS::PANEL_EESCHEMA_EDITING_OPTIONS(), PANEL_FP_EDITOR_DEFAULTS::PANEL_FP_EDITOR_DEFAULTS(), PANEL_GERBVIEW_EXCELLON_SETTINGS::PANEL_GERBVIEW_EXCELLON_SETTINGS(), PANEL_RF_ATTENUATORS::PANEL_RF_ATTENUATORS(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), PANEL_SETUP_BUSES::PANEL_SETUP_BUSES(), PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS(), PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING(), PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TEARDROPS::PANEL_SETUP_TEARDROPS(), PANEL_SYM_EDITING_OPTIONS::PANEL_SYM_EDITING_OPTIONS(), PROPERTIES_FRAME::PROPERTIES_FRAME(), TEMPLATE_WIDGET::SetTemplate(), PANEL_RF_ATTENUATORS::ThemeChanged(), and WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL().
wxFont KIUI::GetMonospacedUIFont | ( | ) |
Definition at line 89 of file ui_common.cpp.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), NETLIST_VIEW_DIALOG::NETLIST_VIEW_DIALOG(), and SCINTILLA_TRICKS::setupStyles().
wxFont KIUI::GetStatusFont | ( | wxWindow * | aWindow | ) |
Definition at line 136 of file ui_common.cpp.
References getGUIFont(), and scale.
Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_FOOTPRINT_ASSOCIATIONS::DIALOG_FOOTPRINT_ASSOCIATIONS(), EDA_DRAW_FRAME::EDA_DRAW_FRAME(), EDA_MSG_PANEL::EDA_MSG_PANEL(), EVT_MENU_RANGE(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), SIMULATOR_FRAME_UI::SIMULATOR_FRAME_UI(), and SIM_PLOT_TAB::updateAxes().
int KIUI::GetStdMargin | ( | ) |
Get the standard margin around a widget in the KiCad UI.
Definition at line 45 of file ui_common.cpp.
Referenced by BUTTON_ROW_PANEL::addButtons(), BUTTON_ROW_PANEL::BUTTON_ROW_PANEL(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), and PANEL_HOTKEYS_EDITOR::installButtons().
wxSize KIUI::GetTextSize | ( | const wxString & | aSingleLine, |
wxWindow * | aWindow | ||
) |
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currently set in that window.
Definition at line 74 of file ui_common.cpp.
Referenced by DIALOG_EDIT_SYMBOLS_LIBID::AdjustGridColumns(), DIALOG_PLOT::DIALOG_PLOT(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), LIB_TREE_MODEL_ADAPTER::doAddColumn(), WX_ELLIPSIZED_STATIC_TEXT::DoGetBestSize(), EDA_DRAW_FRAME::EDA_DRAW_FRAME(), EnsureTextCtrlWidth(), FIELDS_EDITOR_GRID_DATA_MODEL::GetDataWidth(), PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), PANEL_SETUP_PINMAP::reBuildMatrixPanel(), DIALOG_FP_CONFLICT_ASSIGNMENT_SELECTOR::recalculateColumns(), PL_EDITOR_FRAME::ReCreateHToolbar(), ZONE_SETTINGS::SetupLayersList(), and NET_SELECTOR_COMBOPOPUP::updateSize().
bool KIUI::IsInputControlEditable | ( | wxWindow * | aControl | ) |
Check if a input control has focus.
aFocus | Control that test if editable |
Definition at line 306 of file ui_common.cpp.
Referenced by TOOL_DISPATCHER::DispatchWxEvent().
bool KIUI::IsInputControlFocused | ( | wxWindow * | aFocus = nullptr | ) |
Check if a input control has focus.
aFocus | Control that has focus, if null, wxWidgets will be queried |
Definition at line 269 of file ui_common.cpp.
References s_FocusStealableInputName.
Referenced by TOOL_DISPATCHER::DispatchWxEvent(), EDA_DRAW_PANEL_GAL::onEnter(), KIGFX::WX_VIEW_CONTROLS::onEnter(), and EDA_DRAW_PANEL_GAL::OnEvent().
bool KIUI::IsModalDialogFocused | ( | ) |
Definition at line 323 of file ui_common.cpp.
References Pgm().
Referenced by EDA_DRAW_PANEL_GAL::onEnter(), and EDA_DRAW_PANEL_GAL::OnEvent().
void KIUI::SelectReferenceNumber | ( | wxTextEntry * | aTextEntry | ) |
Select the number (or "?") in a reference for ease of editing.
Definition at line 234 of file ui_common.cpp.
Referenced by DIALOG_SYMBOL_PROPERTIES::HandleDelayedSelection(), DIALOG_FIELD_PROPERTIES::OnSetFocusText(), DIALOG_TEXT_PROPERTIES::OnSetFocusText(), and DIALOG_FOOTPRINT_PROPERTIES::OnUpdateUI().
void KIUI::SetControlsTabOrder | ( | const std::vector< wxWindow * > & | aControlsInTabOrder | ) |
Set a list of controls to have a defined sequential tab order.
Each control in the list will come after the previous one. The first control will keep its current position. The end result will be that the given control will be sequential when tabbed though.
This can be slightly clearer than manually calling MoveAfterInTabOrder on each control in turn.
aControlsInTabOrder | list of controls (wxWindows) in desired tab order |
void KIUI::ValidatorTransferToWindowWithoutEvents | ( | wxValidator & | aValidator | ) |
Call a text validator's TransferDataToWindow method without firing a text change event.
This is useful when you want to keep a validator in sync with other data, but the act of changing it should not trigger other updates. It is the validator equivalent of ChangeValue() compared to SetValue().
This function blocks all events, but the same technique can be used to selectively block events.
aValidator | the validator to update the control of |
Definition at line 329 of file validators.cpp.
|
extern |
Definition at line 42 of file ui_common.cpp.
Referenced by HOTKEY_CYCLE_POPUP::HOTKEY_CYCLE_POPUP(), and IsInputControlFocused().