KiCad PCB EDA Suite
STATUS_TEXT_POPUP Class Reference

Extension of STATUS_POPUP for displaying a single line text. More...

#include <status_popup.h>

Inheritance diagram for STATUS_TEXT_POPUP:
STATUS_POPUP PNS_TUNE_STATUS_POPUP

Public Member Functions

 STATUS_TEXT_POPUP (wxWindow *aParent)
 
virtual ~STATUS_TEXT_POPUP ()
 
void SetText (const wxString &aText)
 Display a text. More...
 
void SetTextColor (const wxColour &aColor)
 Change text color. More...
 
virtual void Popup (wxWindow *aFocus=nullptr)
 
virtual void PopupFor (int aMsecs)
 
virtual void Move (const wxPoint &aWhere)
 
virtual void Move (const VECTOR2I &aWhere)
 
void Expire (int aMsecs)
 Hide the popup after a specified time. More...
 
wxWindow * GetPanel ()
 

Protected Member Functions

void updateSize ()
 
void onCharHook (wxKeyEvent &aEvent)
 Expire timer even handler. More...
 
void onExpire (wxTimerEvent &aEvent)
 

Protected Attributes

wxStaticText * m_statusLine
 
wxPanel * m_panel
 
wxBoxSizer * m_topSizer
 
wxTimer m_expireTimer
 

Detailed Description

Extension of STATUS_POPUP for displaying a single line text.

Definition at line 82 of file status_popup.h.

Constructor & Destructor Documentation

◆ STATUS_TEXT_POPUP()

STATUS_TEXT_POPUP::STATUS_TEXT_POPUP ( wxWindow *  aParent)

Definition at line 116 of file status_popup.cpp.

116 :
117 STATUS_POPUP( aParent )
118{
119 m_panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNSHADOW ) );
120 m_panel->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ) );
121
122 m_statusLine = new wxStaticText( m_panel, wxID_ANY, wxEmptyString ) ;
123 m_topSizer->Add( m_statusLine, 1, wxALL | wxEXPAND, 5 );
124}
wxBoxSizer * m_topSizer
Definition: status_popup.h:74
STATUS_POPUP(wxWindow *aParent)
Transient mouse following popup window implementation.
wxPanel * m_panel
Definition: status_popup.h:73
wxStaticText * m_statusLine
Definition: status_popup.h:103

References STATUS_POPUP::m_panel, m_statusLine, and STATUS_POPUP::m_topSizer.

◆ ~STATUS_TEXT_POPUP()

virtual STATUS_TEXT_POPUP::~STATUS_TEXT_POPUP ( )
inlinevirtual

Definition at line 86 of file status_popup.h.

86{}

Member Function Documentation

◆ Expire()

void STATUS_POPUP::Expire ( int  aMsecs)
inherited

Hide the popup after a specified time.

Parameters
aMsecsis the time expressed in milliseconds

Definition at line 97 of file status_popup.cpp.

98{
99 m_expireTimer.StartOnce( aMsecs );
100}
wxTimer m_expireTimer
Definition: status_popup.h:75

References STATUS_POPUP::m_expireTimer.

Referenced by STATUS_POPUP::PopupFor().

◆ GetPanel()

wxWindow * STATUS_POPUP::GetPanel ( )
inlineinherited

◆ Move() [1/2]

void STATUS_POPUP::Move ( const VECTOR2I aWhere)
virtualinherited

Definition at line 85 of file status_popup.cpp.

86{
87 SetPosition( ToWxPoint( aWhere ) );
88}
void SetPosition(const wxString &aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
wxPoint ToWxPoint(const VECTOR2I &aSize)
Definition: vector2wx.h:50

References PCAD2KICAD::SetPosition(), and ToWxPoint().

◆ Move() [2/2]

void STATUS_POPUP::Move ( const wxPoint &  aWhere)
virtualinherited

◆ onCharHook()

void STATUS_POPUP::onCharHook ( wxKeyEvent &  aEvent)
protectedinherited

Expire timer even handler.

Definition at line 55 of file status_popup.cpp.

56{
57 // Key events from the status popup don't get put through the wxWidgets event system on
58 // OSX, so we have to fall back to the CHAR_HOOK to forward hotkeys from the popup to
59 // the canvas / frame.
60 aEvent.SetEventType( wxEVT_CHAR );
61
62 EDA_DRAW_FRAME* frame = dynamic_cast<EDA_DRAW_FRAME*>( GetParent() );
63
64 if( frame )
65 frame->GetCanvas()->OnEvent( aEvent );
66 else
67 GetParent()->GetEventHandler()->ProcessEvent( aEvent );
68}
The base class for create windows for drawing purpose.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void OnEvent(wxEvent &aEvent)
Used to forward events to the canvas from popups, etc.

References EDA_DRAW_FRAME::GetCanvas(), and EDA_DRAW_PANEL_GAL::OnEvent().

Referenced by STATUS_POPUP::STATUS_POPUP().

◆ onExpire()

void STATUS_POPUP::onExpire ( wxTimerEvent &  aEvent)
protectedinherited

Definition at line 110 of file status_popup.cpp.

111{
112 Hide();
113}

Referenced by STATUS_POPUP::STATUS_POPUP().

◆ Popup()

void STATUS_POPUP::Popup ( wxWindow *  aFocus = nullptr)
virtualinherited

Definition at line 71 of file status_popup.cpp.

72{
73 Show( true );
74 Raise();
75}

Referenced by EDIT_TOOL::doMoveSelection(), PAD_TOOL::EnumeratePads(), LENGTH_TUNER_TOOL::performTuning(), and STATUS_POPUP::PopupFor().

◆ PopupFor()

void STATUS_POPUP::PopupFor ( int  aMsecs)
virtualinherited

Definition at line 78 of file status_popup.cpp.

79{
80 Popup();
81 Expire( aMsecs );
82}
void Expire(int aMsecs)
Hide the popup after a specified time.
virtual void Popup(wxWindow *aFocus=nullptr)

References STATUS_POPUP::Expire(), and STATUS_POPUP::Popup().

◆ SetText()

void STATUS_TEXT_POPUP::SetText ( const wxString &  aText)

Display a text.

Parameters
aTextis the text to be displayed.

Definition at line 127 of file status_popup.cpp.

128{
129 m_statusLine->SetLabel( aText );
130 updateSize();
131}

References m_statusLine, and STATUS_POPUP::updateSize().

Referenced by EDIT_TOOL::doMoveSelection(), PAD_TOOL::EnumeratePads(), and PNS_TUNE_STATUS_POPUP::UpdateStatus().

◆ SetTextColor()

void STATUS_TEXT_POPUP::SetTextColor ( const wxColour &  aColor)

Change text color.

Parameters
aColoris the new text color.

Definition at line 134 of file status_popup.cpp.

135{
136 m_statusLine->SetForegroundColour( aColor );
137}

References m_statusLine.

Referenced by PNS_TUNE_STATUS_POPUP::UpdateStatus().

◆ updateSize()

void STATUS_POPUP::updateSize ( )
protectedinherited

Definition at line 103 of file status_popup.cpp.

104{
105 m_topSizer->Fit( m_panel );
106 SetClientSize( m_panel->GetSize() );
107}

References STATUS_POPUP::m_panel, and STATUS_POPUP::m_topSizer.

Referenced by SetText().

Member Data Documentation

◆ m_expireTimer

wxTimer STATUS_POPUP::m_expireTimer
protectedinherited

Definition at line 75 of file status_popup.h.

Referenced by STATUS_POPUP::Expire().

◆ m_panel

wxPanel* STATUS_POPUP::m_panel
protectedinherited

◆ m_statusLine

wxStaticText* STATUS_TEXT_POPUP::m_statusLine
protected

Definition at line 103 of file status_popup.h.

Referenced by SetText(), SetTextColor(), and STATUS_TEXT_POPUP().

◆ m_topSizer

wxBoxSizer* STATUS_POPUP::m_topSizer
protectedinherited

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