KiCad PCB EDA Suite
KIUI Namespace Reference

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...
 

Function Documentation

◆ GetStdMargin()

int KIUI::GetStdMargin ( )

Get the standard margin around a widget in the KiCad UI.

Returns
margin in pixels

Definition at line 23 of file ui_common.cpp.

24 {
25  // This is the value used in (most) wxFB dialogs
26  return 5;
27 }

Referenced by BUTTON_ROW_PANEL::addButtons(), BUTTON_ROW_PANEL::BUTTON_ROW_PANEL(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), PANEL_HOTKEYS_EDITOR::installButtons(), and PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR().

◆ SetControlsTabOrder()

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.

Parameters
aControlsInTabOrderlist of controls (wxWindows) in desired tab order

◆ ValidatorTransferToWindowWithoutEvents()

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.

Parameters
aValidatorthe validator to update the control of

Definition at line 319 of file validators.cpp.

320 {
321  wxWindow* ctrl = aValidator.GetWindow();
322 
323  wxCHECK_RET( ctrl != nullptr, "Transferring validator data without a control" );
324 
325  wxEventBlocker orient_update_blocker( ctrl, wxEVT_ANY );
326  aValidator.TransferToWindow();
327 }

Referenced by DIALOG_FOOTPRINT_BOARD_EDITOR::updateOrientationControl().