KiCad PCB EDA Suite
ui_common.h File Reference

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

#include <wx/string.h>

Go to the source code of this file.

Namespaces

 KIUI
 

Enumerations

enum  SEVERITY {
  RPT_SEVERITY_UNDEFINED = 0x00, RPT_SEVERITY_INFO = 0x01, RPT_SEVERITY_EXCLUSION = 0x02, RPT_SEVERITY_ACTION = 0x04,
  RPT_SEVERITY_WARNING = 0x08, RPT_SEVERITY_ERROR = 0x10, RPT_SEVERITY_IGNORE = 0x20
}
 

Functions

int KIUI::GetStdMargin ()
 Get the standard margin around a widget in the KiCad UI. More...
 
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...
 
bool KIUI::EnsureTextCtrlWidth (wxTextCtrl *aCtrl, const wxString *aString=NULL)
 Set the minimum pixel width on a text control in order to make a text string be fully visible within it. More...
 
void KIUI::SelectReferenceNumber (wxTextEntry *aTextEntry)
 Select the number (or "?") in a reference for ease of editing. More...
 
SEVERITY SeverityFromString (const wxString &aSeverity)
 
wxString SeverityToString (const SEVERITY &aSeverity)
 

Detailed Description

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

Definition in file ui_common.h.

Enumeration Type Documentation

◆ SEVERITY

enum SEVERITY
Enumerator
RPT_SEVERITY_UNDEFINED 
RPT_SEVERITY_INFO 
RPT_SEVERITY_EXCLUSION 
RPT_SEVERITY_ACTION 
RPT_SEVERITY_WARNING 
RPT_SEVERITY_ERROR 
RPT_SEVERITY_IGNORE 

Definition at line 76 of file ui_common.h.

Function Documentation

◆ SeverityFromString()

SEVERITY SeverityFromString ( const wxString &  aSeverity)

Definition at line 33 of file ui_common.cpp.

34 {
35  if( aSeverity == wxT( "warning" ) )
36  return RPT_SEVERITY_WARNING;
37  else if( aSeverity == wxT( "ignore" ) )
38  return RPT_SEVERITY_IGNORE;
39  else
40  return RPT_SEVERITY_ERROR;
41 }

References RPT_SEVERITY_ERROR, RPT_SEVERITY_IGNORE, and RPT_SEVERITY_WARNING.

Referenced by BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), and ERC_SETTINGS::ERC_SETTINGS().

◆ SeverityToString()

wxString SeverityToString ( const SEVERITY aSeverity)

Definition at line 44 of file ui_common.cpp.

45 {
46  if( aSeverity == RPT_SEVERITY_IGNORE )
47  return wxT( "ignore" );
48  else if( aSeverity == RPT_SEVERITY_WARNING )
49  return wxT( "warning" );
50  else
51  return wxT( "error" );
52 }

References RPT_SEVERITY_IGNORE, and RPT_SEVERITY_WARNING.

Referenced by BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS(), and ERC_SETTINGS::ERC_SETTINGS().