33 #include <wx/dcscreen.h> 34 #include <wx/dcclient.h> 35 #include <wx/settings.h> 36 #include <wx/toplevel.h> 45 const wxPoint& aPosition, const wxSize& aSize,
46 long style, const wxString &
name ) :
47 wxPanel( aParent, aId, aPosition, aSize, style,
name )
49 SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) );
50 SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
53 SetBackgroundStyle( wxBG_STYLE_PAINT );
57 m_fontSize = computeFontSize();
69 wxSize fontSizeInPixels;
73 dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) );
74 dc.GetTextExtent( wxT(
"W" ), &fontSizeInPixels.x, &fontSizeInPixels.y );
76 return fontSizeInPixels;
90 wxSize textSizeInPixels;
94 dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) );
95 dc.GetTextExtent( aText, &textSizeInPixels.x, &textSizeInPixels.y );
97 return textSizeInPixels;
103 wxPaintDC dc(
this );
107 dc.SetBackground( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
108 dc.SetBackgroundMode( wxSOLID );
109 dc.SetTextBackground( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
110 dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) );
123 wxSize drawSize = GetClientSize();
125 text = ( aUpperText.Len() > aLowerText.Len() ) ? aUpperText : aLowerText;
126 text.Append(
' ', aPadding );
153 const wxString& aLowerText )
156 wxSize drawSize = GetClientSize();
158 if( aXPosition >= 0 )
178 for( ndx=0; ndx<limit; ++ndx )
206 wxTopLevelWindow* tlw = dynamic_cast<wxTopLevelWindow*>( wxGetTopLevelParent(
this ) );
208 if( tlw && !tlw->IsActive() )
209 color = wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT );
211 color = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
213 aDC.SetTextForeground(
color.ToColour() );
236 wxSize size = GetClientSize();
237 wxColour
color = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
239 pen.SetColour(
color );
241 brush.SetColour(
color );
242 brush.SetStyle( wxBRUSHSTYLE_SOLID );
245 aDC->SetBrush( brush );
246 aDC->DrawRectangle( 0, 0, size.x, size.y );
void showItem(wxDC &dc, const MSG_PANEL_ITEM &aItem)
void SetMessage(int aXPosition, const wxString &aUpperText, const wxString &aLowerText)
Function SetMessage sets a message at aXPosition to aUpperText and aLowerText in the message panel.
EDA_MSG_PANEL is a panel to display various information messages.
void OnPaint(wxPaintEvent &aEvent)
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
wxSize computeTextSize(const wxString &text) const
Calculate the width and height of a text string using the system UI font.
int m_last_x
the last used x coordinate
static wxSize computeFontSize()
Function getFontSize computes the height and width of a 'W' in the system font.
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
void AppendMessage(const wxString &aUpperText, const wxString &aLowerText, int aPadding=6)
Function AppendMessage appends a message to the message panel.
Message panel definition file.
static int GetRequiredHeight()
Function GetRequiredHeight returns the required height (in pixels) of a EDA_MSG_PANEL.
A color representation with 4 components: red, green, blue, alpha.