![]() |
KiCad PCB EDA Suite
|
EDA_MSG_PANEL is a panel to display various information messages. More...
#include <msgpanel.h>
Public Member Functions | |
EDA_MSG_PANEL (wxWindow *aParent, int aId, const wxPoint &aPosition, const wxSize &aSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxPanelNameStr) | |
~EDA_MSG_PANEL () | |
void | OnPaint (wxPaintEvent &aEvent) |
void | EraseMsgBox () |
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. More... | |
void | AppendMessage (const wxString &aUpperText, const wxString &aLowerText, int aPadding=6) |
Function AppendMessage appends a message to the message panel. More... | |
void | AppendMessage (const MSG_PANEL_ITEM &aMessageItem) |
Function AppendMessage appends aMessageItem to the message panel. More... | |
Static Public Member Functions | |
static int | GetRequiredHeight () |
Function GetRequiredHeight returns the required height (in pixels) of a EDA_MSG_PANEL. More... | |
Protected Member Functions | |
void | showItem (wxDC &dc, const MSG_PANEL_ITEM &aItem) |
void | erase (wxDC *DC) |
wxSize | computeTextSize (const wxString &text) const |
Calculate the width and height of a text string using the system UI font. More... | |
Static Protected Member Functions | |
static wxSize | computeFontSize () |
Function getFontSize computes the height and width of a 'W' in the system font. More... | |
Protected Attributes | |
MSG_PANEL_ITEMS | m_Items |
int | m_last_x |
the last used x coordinate More... | |
wxSize | m_fontSize |
EDA_MSG_PANEL is a panel to display various information messages.
Definition at line 104 of file msgpanel.h.
EDA_MSG_PANEL::EDA_MSG_PANEL | ( | wxWindow * | aParent, |
int | aId, | ||
const wxPoint & | aPosition, | ||
const wxSize & | aSize, | ||
long | style = wxTAB_TRAVERSAL , |
||
const wxString & | name = wxPanelNameStr |
||
) |
Definition at line 44 of file msgpanel.cpp.
EDA_MSG_PANEL::~EDA_MSG_PANEL | ( | ) |
Definition at line 61 of file msgpanel.cpp.
void EDA_MSG_PANEL::AppendMessage | ( | const wxString & | aUpperText, |
const wxString & | aLowerText, | ||
int | aPadding = 6 |
||
) |
Function AppendMessage appends a message to the message panel.
This method automatically adjusts for the width of the text string. Making consecutive calls to AppendMessage will append each message to the right of the last message. This message is not compatible with Affiche_1_Parametre.
aUpperText | The message upper text. |
aLowerText | The message lower text. |
aPadding | Number of spaces to pad between messages (default = 4). |
Definition at line 119 of file msgpanel.cpp.
References computeTextSize(), m_fontSize, m_Items, m_last_x, MSG_PANEL_ITEM::m_LowerText, MSG_PANEL_ITEM::m_LowerY, MSG_PANEL_ITEM::m_UpperText, MSG_PANEL_ITEM::m_UpperY, MSG_PANEL_ITEM::m_X, Refresh(), and text.
Referenced by AppendMessage(), EDA_DRAW_FRAME::AppendMsgPanel(), and EDA_DRAW_FRAME::SetMsgPanel().
|
inline |
Function AppendMessage appends aMessageItem to the message panel.
aMessageItem | is a reference to an MSG_PANEL_ITEM containing the message to append to the panel. |
Definition at line 175 of file msgpanel.h.
References AppendMessage(), MSG_PANEL_ITEM::GetLowerText(), MSG_PANEL_ITEM::GetPadding(), and MSG_PANEL_ITEM::GetUpperText().
|
staticprotected |
Function getFontSize computes the height and width of a 'W' in the system font.
Definition at line 66 of file msgpanel.cpp.
Referenced by GetRequiredHeight().
|
protected |
Calculate the width and height of a text string using the system UI font.
Definition at line 87 of file msgpanel.cpp.
Referenced by AppendMessage().
|
protected |
void EDA_MSG_PANEL::EraseMsgBox | ( | ) |
Definition at line 223 of file msgpanel.cpp.
References m_Items, m_last_x, and Refresh().
Referenced by EDA_DRAW_FRAME::ClearMsgPanel(), EDA_DRAW_FRAME::EraseMsgBox(), and EDA_DRAW_FRAME::SetMsgPanel().
|
static |
Function GetRequiredHeight returns the required height (in pixels) of a EDA_MSG_PANEL.
This takes into consideration the system gui font, wxSYS_DEFAULT_GUI_FONT.
Definition at line 80 of file msgpanel.cpp.
References computeFontSize().
Referenced by EDA_DRAW_FRAME::EDA_DRAW_FRAME().
void EDA_MSG_PANEL::OnPaint | ( | wxPaintEvent & | aEvent | ) |
Definition at line 101 of file msgpanel.cpp.
References erase(), m_Items, and showItem().
void EDA_MSG_PANEL::SetMessage | ( | int | aXPosition, |
const wxString & | aUpperText, | ||
const wxString & | aLowerText | ||
) |
Function SetMessage sets a message at aXPosition to aUpperText and aLowerText in the message panel.
aXPosition | The horizontal position to display the message or less than zero to set the message using the last message position. |
aUpperText | The text to be displayed in top line. |
aLowerText | The text to be displayed in bottom line. |
Definition at line 152 of file msgpanel.cpp.
References m_fontSize, m_Items, m_last_x, MSG_PANEL_ITEM::m_LowerText, MSG_PANEL_ITEM::m_LowerY, MSG_PANEL_ITEM::m_UpperText, MSG_PANEL_ITEM::m_UpperY, MSG_PANEL_ITEM::m_X, and Refresh().
|
protected |
Definition at line 201 of file msgpanel.cpp.
References color, MSG_PANEL_ITEM::m_LowerText, MSG_PANEL_ITEM::m_LowerY, MSG_PANEL_ITEM::m_UpperText, MSG_PANEL_ITEM::m_UpperY, and MSG_PANEL_ITEM::m_X.
Referenced by OnPaint().
|
protected |
Definition at line 109 of file msgpanel.h.
Referenced by AppendMessage(), and SetMessage().
|
protected |
Definition at line 107 of file msgpanel.h.
Referenced by AppendMessage(), EraseMsgBox(), OnPaint(), and SetMessage().
|
protected |
the last used x coordinate
Definition at line 108 of file msgpanel.h.
Referenced by AppendMessage(), EraseMsgBox(), and SetMessage().