KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EDA_MSG_PANEL Class Reference

A panel to display various information messages. More...

#include <msgpanel.h>

Inheritance diagram for EDA_MSG_PANEL:

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 OnDPIChanged (wxDPIChangedEvent &aEvent)
 
void EraseMsgBox ()
 
wxSize DoGetBestSize () const override
 
wxSize DoGetBestClientSize () const override
 
void SetMessage (int aXPosition, const wxString &aUpperText, const wxString &aLowerText)
 Set a message at aXPosition to aUpperText and aLowerText in the message panel.
 
void AppendMessage (const wxString &aUpperText, const wxString &aLowerText, int aPadding=6)
 Append a message to the message panel.
 
void AppendMessage (const MSG_PANEL_ITEM &aMessageItem)
 Append aMessageItem to the message panel.
 

Protected Member Functions

void updateFontSize ()
 
void showItem (wxDC &dc, const MSG_PANEL_ITEM &aItem)
 
void erase (wxDC *DC)
 

Protected Attributes

std::vector< MSG_PANEL_ITEMm_Items
 
int m_last_x
 the last used x coordinate
 
wxSize m_fontSize
 

Detailed Description

A panel to display various information messages.

Definition at line 100 of file msgpanel.h.

Constructor & Destructor Documentation

◆ EDA_MSG_PANEL()

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 42 of file msgpanel.cpp.

References KIUI::GetStatusFont().

◆ ~EDA_MSG_PANEL()

EDA_MSG_PANEL::~EDA_MSG_PANEL ( )

Definition at line 60 of file msgpanel.cpp.

Member Function Documentation

◆ AppendMessage() [1/2]

void EDA_MSG_PANEL::AppendMessage ( const MSG_PANEL_ITEM aMessageItem)
inline

Append aMessageItem to the message panel.

Parameters
aMessageItemis a reference to an MSG_PANEL_ITEM containing the message to append to the panel.

Definition at line 145 of file msgpanel.h.

References AppendMessage(), MSG_PANEL_ITEM::GetLowerText(), MSG_PANEL_ITEM::GetPadding(), and MSG_PANEL_ITEM::GetUpperText().

◆ AppendMessage() [2/2]

void EDA_MSG_PANEL::AppendMessage ( const wxString &  aUpperText,
const wxString &  aLowerText,
int  aPadding = 6 
)

Append 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.

Parameters
aUpperTextThe message upper text.
aLowerTextThe message lower text.
aPaddingNumber of spaces to pad between messages (default = 4).

Definition at line 111 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, Refresh(), and text.

Referenced by AppendMessage(), EDA_DRAW_FRAME::AppendMsgPanel(), and EDA_DRAW_FRAME::SetMsgPanel().

◆ DoGetBestClientSize()

wxSize EDA_MSG_PANEL::DoGetBestClientSize ( ) const
override

Definition at line 78 of file msgpanel.cpp.

◆ DoGetBestSize()

wxSize EDA_MSG_PANEL::DoGetBestSize ( ) const
override

Definition at line 72 of file msgpanel.cpp.

References m_fontSize.

◆ erase()

void EDA_MSG_PANEL::erase ( wxDC *  DC)
protected

Definition at line 223 of file msgpanel.cpp.

References color.

Referenced by OnPaint().

◆ EraseMsgBox()

void EDA_MSG_PANEL::EraseMsgBox ( )

◆ OnDPIChanged()

void EDA_MSG_PANEL::OnDPIChanged ( wxDPIChangedEvent &  aEvent)

Definition at line 84 of file msgpanel.cpp.

References updateFontSize().

◆ OnPaint()

void EDA_MSG_PANEL::OnPaint ( wxPaintEvent &  aEvent)

Definition at line 93 of file msgpanel.cpp.

References erase(), KIUI::GetControlFont(), m_Items, and showItem().

◆ SetMessage()

void EDA_MSG_PANEL::SetMessage ( int  aXPosition,
const wxString &  aUpperText,
const wxString &  aLowerText 
)

Set a message at aXPosition to aUpperText and aLowerText in the message panel.

Parameters
aXPositionThe horizontal position to display the message or less than zero to set the message using the last message position.
aUpperTextThe text to be displayed in top line.
aLowerTextThe text to be displayed in bottom line.

Definition at line 144 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().

◆ showItem()

void EDA_MSG_PANEL::showItem ( wxDC &  dc,
const MSG_PANEL_ITEM aItem 
)
protected

◆ updateFontSize()

void EDA_MSG_PANEL::updateFontSize ( )
protected

Definition at line 65 of file msgpanel.cpp.

References KIUI::GetControlFont(), and m_fontSize.

Referenced by OnDPIChanged().

Member Data Documentation

◆ m_fontSize

wxSize EDA_MSG_PANEL::m_fontSize
protected

Definition at line 163 of file msgpanel.h.

Referenced by AppendMessage(), DoGetBestSize(), SetMessage(), and updateFontSize().

◆ m_Items

std::vector<MSG_PANEL_ITEM> EDA_MSG_PANEL::m_Items
protected

Definition at line 161 of file msgpanel.h.

Referenced by AppendMessage(), EraseMsgBox(), OnPaint(), and SetMessage().

◆ m_last_x

int EDA_MSG_PANEL::m_last_x
protected

the last used x coordinate

Definition at line 162 of file msgpanel.h.

Referenced by AppendMessage(), EraseMsgBox(), and SetMessage().


The documentation for this class was generated from the following files: