KiCad PCB EDA Suite
ui_common.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
26 #ifndef UI_COMMON_H
27 #define UI_COMMON_H
28 
29 #include <wx/string.h>
30 
31 class wxSize;
32 class wxTextCtrl;
33 class wxTextEntry;
34 class wxWindow;
35 
36 namespace KIUI
37 {
38 
43 int GetStdMargin();
44 
49 wxSize GetTextSize( const wxString& aSingleLine, wxWindow* aWindow );
50 
65 bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString = NULL );
66 
70 void SelectReferenceNumber( wxTextEntry* aTextEntry );
71 
72 }
73 
74 // Note: On windows, SEVERITY_ERROR collides with a system declaration,
75 // so we used RPT_SEVERITY _xxx instead of SEVERITY _xxx
76 enum SEVERITY {
84 };
85 
86 SEVERITY SeverityFromString( const wxString& aSeverity );
87 
88 wxString SeverityToString( const SEVERITY& aSeverity );
89 
90 #endif // UI_COMMON_H
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
Definition: ui_common.cpp:99
SEVERITY
Definition: ui_common.h:76
int GetStdMargin()
Get the standard margin around a widget in the KiCad UI.
Definition: ui_common.cpp:26
SEVERITY SeverityFromString(const wxString &aSeverity)
Definition: ui_common.cpp:33
#define NULL
wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
Definition: ui_common.cpp:55
bool 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 ...
Definition: ui_common.cpp:70
wxString SeverityToString(const SEVERITY &aSeverity)
Definition: ui_common.cpp:44