KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ui_common.h File Reference

Functions to provide common constants and other functions to assist in making a consistent UI. More...

#include <kicommon.h>
#include "report_severity.h"
#include <wx/string.h>
#include <wx/font.h>

Go to the source code of this file.

Namespaces

namespace  KIUI
 

Macros

#define INDETERMINATE_STATE   _( "-- mixed values --" )
 Used for holding indeterminate values, such as with multiple selections holding different values or controls which do not wish to set a value. More...
 
#define INDETERMINATE_ACTION   _( "-- leave unchanged --" )
 

Functions

KICOMMON_API int KIUI::GetStdMargin ()
 Get the standard margin around a widget in the KiCad UI. More...
 
KICOMMON_API 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. More...
 
KICOMMON_API wxFont KIUI::GetMonospacedUIFont ()
 
KICOMMON_API wxFont KIUI::GetControlFont (wxWindow *aWindow)
 
KICOMMON_API wxFont KIUI::GetInfoFont (wxWindow *aWindow)
 
KICOMMON_API wxFont KIUI::GetDockedPaneFont (wxWindow *aWindow)
 
KICOMMON_API wxFont KIUI::GetStatusFont (wxWindow *aWindow)
 
KICOMMON_API 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. More...
 
KICOMMON_API void KIUI::SelectReferenceNumber (wxTextEntry *aTextEntry)
 Select the number (or "?") in a reference for ease of editing. More...
 
KICOMMON_API wxString KIUI::EllipsizeStatusText (wxWindow *aWindow, const wxString &aString)
 Ellipsize text (at the end) to be no more than 1/3 of the window width. More...
 
KICOMMON_API wxString KIUI::EllipsizeMenuText (const wxString &aString)
 Ellipsize text (at the end) to be no more than 36 characters. More...
 
KICOMMON_API bool KIUI::IsInputControlFocused (wxWindow *aFocus=nullptr)
 Check if a input control has focus. More...
 
KICOMMON_API bool KIUI::IsInputControlEditable (wxWindow *aControl)
 Check if a input control has focus. More...
 
KICOMMON_API bool KIUI::IsModalDialogFocused ()
 
KICOMMON_API void KIUI::Disable (wxWindow *aWindow)
 Makes a window read-only. More...
 
KICOMMON_API void KIUI::AddBitmapToMenuItem (wxMenuItem *aMenu, const wxBitmap &aImage)
 Add a bitmap to a menuitem. More...
 
KICOMMON_API wxMenuItem * KIUI::AddMenuItem (wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
 Create and insert a menu item with an icon into aMenu. More...
 
KICOMMON_API wxMenuItem * KIUI::AddMenuItem (wxMenu *aMenu, int aId, const wxString &aText, const wxString &aHelpText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
 Create and insert a menu item with an icon and a help message string into aMenu. More...
 
KICOMMON_API wxMenuItem * KIUI::AddMenuItem (wxMenu *aMenu, wxMenu *aSubMenu, int aId, const wxString &aText, const wxBitmap &aImage)
 Create and insert a menu item with an icon into aSubMenu in aMenu. More...
 
KICOMMON_API wxMenuItem * KIUI::AddMenuItem (wxMenu *aMenu, wxMenu *aSubMenu, int aId, const wxString &aText, const wxString &aHelpText, const wxBitmap &aImage)
 Create and insert a menu item with an icon and a help message string into aSubMenu in aMenu. More...
 
KICOMMON_API SEVERITY SeverityFromString (const wxString &aSeverity)
 
KICOMMON_API wxString SeverityToString (const SEVERITY &aSeverity)
 

Variables

KICOMMON_API const wxString KIUI::s_FocusStealableInputName = wxS( "KI_NOFOCUS")
 

Detailed Description

Functions to provide common constants and other functions to assist in making a consistent UI.

Definition in file ui_common.h.

Macro Definition Documentation

◆ INDETERMINATE_ACTION

#define INDETERMINATE_ACTION   _( "-- leave unchanged --" )

Definition at line 46 of file ui_common.h.

◆ INDETERMINATE_STATE

#define INDETERMINATE_STATE   _( "-- mixed values --" )

Used for holding indeterminate values, such as with multiple selections holding different values or controls which do not wish to set a value.

Definition at line 45 of file ui_common.h.

Function Documentation

◆ SeverityFromString()

KICOMMON_API SEVERITY SeverityFromString ( const wxString &  aSeverity)

Definition at line 52 of file ui_common.cpp.

References RPT_SEVERITY_ERROR, RPT_SEVERITY_IGNORE, and RPT_SEVERITY_WARNING.

◆ SeverityToString()

KICOMMON_API wxString SeverityToString ( const SEVERITY aSeverity)