KiCad PCB EDA Suite
PNS_TUNE_STATUS_POPUP Class Reference

#include <pns_tune_status_popup.h>

Inheritance diagram for PNS_TUNE_STATUS_POPUP:
STATUS_TEXT_POPUP STATUS_POPUP

Public Member Functions

 PNS_TUNE_STATUS_POPUP (EDA_DRAW_FRAME *aParent)
 
void UpdateStatus (PNS::ROUTER *aRouter)
 
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 Move (const wxPoint &aWhere)
 
virtual void Move (const VECTOR2I &aWhere)
 
void Expire (int aMsecs)
 Hides the popup after a specified time. More...
 

Protected Member Functions

void updateSize ()
 
void onCharHook (wxKeyEvent &aEvent)
 
void onExpire (wxTimerEvent &aEvent)
 

Expire timer even handler

More...
 

Protected Attributes

wxStaticText * m_statusLine
 
EDA_DRAW_FRAMEm_frame
 
wxPanel * m_panel
 
wxBoxSizer * m_topSizer
 
wxTimer m_expireTimer
 

Detailed Description

Definition at line 37 of file pns_tune_status_popup.h.

Constructor & Destructor Documentation

◆ PNS_TUNE_STATUS_POPUP()

PNS_TUNE_STATUS_POPUP::PNS_TUNE_STATUS_POPUP ( EDA_DRAW_FRAME aParent)
inline

Definition at line 40 of file pns_tune_status_popup.h.

40  :
41  STATUS_TEXT_POPUP( aParent )
42  { }
STATUS_TEXT_POPUP(EDA_DRAW_FRAME *aParent)

Member Function Documentation

◆ Expire()

void STATUS_POPUP::Expire ( int  aMsecs)
inherited

Hides the popup after a specified time.

Parameters
aMsecsis the time expressed in milliseconds

Definition at line 88 of file status_popup.cpp.

References STATUS_POPUP::m_expireTimer.

Referenced by DRAWING_TOOL::drawZone(), EDIT_TOOL::pickCopyReferencePoint(), and EDIT_TOOL::Remove().

89 {
90  m_expireTimer.StartOnce( aMsecs );
91 }
wxTimer m_expireTimer
Definition: status_popup.h:70

◆ Move() [1/2]

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

Definition at line 82 of file status_popup.cpp.

References PCAD2KICAD::SetPosition().

Referenced by DRAWING_TOOL::drawZone(), MODULE_EDITOR_TOOLS::EnumeratePads(), EDIT_TOOL::pickCopyReferencePoint(), EDIT_TOOL::Remove(), and LENGTH_TUNER_TOOL::updateStatusPopup().

83 {
84  SetPosition( aWhere );
85 }
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)

◆ Move() [2/2]

void STATUS_POPUP::Move ( const VECTOR2I aWhere)
virtualinherited

Definition at line 76 of file status_popup.cpp.

References PCAD2KICAD::SetPosition(), VECTOR2< T >::x, and VECTOR2< T >::y.

77 {
78  SetPosition( wxPoint( aWhere.x, aWhere.y ) );
79 }
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)

◆ onCharHook()

void STATUS_POPUP::onCharHook ( wxKeyEvent &  aEvent)
protectedinherited

Definition at line 55 of file status_popup.cpp.

References EDA_DRAW_FRAME::GetGalCanvas(), EDA_DRAW_FRAME::IsGalCanvasActive(), STATUS_POPUP::m_frame, EDA_DRAW_PANEL_GAL::OnEvent(), and EDA_BASE_FRAME::ProcessEvent().

Referenced by STATUS_POPUP::STATUS_POPUP().

56 {
57  // Key events from popups don't get put through the wxWidgets event system on OSX,
58  // 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  if( m_frame->IsGalCanvasActive() )
63  m_frame->GetGalCanvas()->OnEvent( aEvent );
64  else
65  m_frame->ProcessEvent( aEvent );
66 }
EDA_DRAW_FRAME * m_frame
Definition: status_popup.h:67
void OnEvent(wxEvent &aEvent)
Used to forward events to the canvas from popups, etc.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:934
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:927
bool ProcessEvent(wxEvent &aEvent) override
Function ProcessEvent overrides the default process event handler to implement the auto save feature...

◆ onExpire()

void STATUS_POPUP::onExpire ( wxTimerEvent &  aEvent)
protectedinherited

Expire timer even handler

Definition at line 101 of file status_popup.cpp.

Referenced by STATUS_POPUP::STATUS_POPUP().

102 {
103  Hide();
104 }

◆ Popup()

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

◆ SetText()

void STATUS_TEXT_POPUP::SetText ( const wxString &  aText)
inherited

Display a text.

Parameters
aTextis the text to be displayed.

Definition at line 118 of file status_popup.cpp.

References STATUS_TEXT_POPUP::m_statusLine, and STATUS_POPUP::updateSize().

Referenced by DRAWING_TOOL::drawZone(), MODULE_EDITOR_TOOLS::EnumeratePads(), EDIT_TOOL::pickCopyReferencePoint(), EDIT_TOOL::Remove(), and UpdateStatus().

119 {
120  m_statusLine->SetLabel( aText );
121  updateSize();
122 }
wxStaticText * m_statusLine
Definition: status_popup.h:98
void updateSize()

◆ SetTextColor()

void STATUS_TEXT_POPUP::SetTextColor ( const wxColour &  aColor)
inherited

Change text color.

Parameters
aColoris the new text color.

Definition at line 125 of file status_popup.cpp.

References STATUS_TEXT_POPUP::m_statusLine.

Referenced by DRAWING_TOOL::drawZone(), and UpdateStatus().

126 {
127  m_statusLine->SetForegroundColour( aColor );
128 }
wxStaticText * m_statusLine
Definition: status_popup.h:98

◆ updateSize()

void STATUS_POPUP::updateSize ( )
protectedinherited

Definition at line 94 of file status_popup.cpp.

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

Referenced by STATUS_TEXT_POPUP::SetText().

95 {
96  m_topSizer->Fit( m_panel );
97  SetClientSize( m_panel->GetSize() );
98 }
wxPanel * m_panel
Definition: status_popup.h:68
wxBoxSizer * m_topSizer
Definition: status_popup.h:69

◆ UpdateStatus()

void PNS_TUNE_STATUS_POPUP::UpdateStatus ( PNS::ROUTER aRouter)

Definition at line 27 of file pns_tune_status_popup.cpp.

References EDA_DRAW_FRAME::GetUserUnits(), STATUS_POPUP::m_frame, PNS::ROUTER::Placer(), STATUS_TEXT_POPUP::SetText(), STATUS_TEXT_POPUP::SetTextColor(), PNS::MEANDER_PLACER_BASE::TOO_LONG, PNS::MEANDER_PLACER_BASE::TOO_SHORT, PNS::MEANDER_PLACER_BASE::TUNED, PNS::MEANDER_PLACER_BASE::TuningInfo(), and PNS::MEANDER_PLACER_BASE::TuningStatus().

Referenced by LENGTH_TUNER_TOOL::updateStatusPopup().

28 {
29  PNS::MEANDER_PLACER_BASE* placer = dynamic_cast<PNS::MEANDER_PLACER_BASE*>( aRouter->Placer() );
30 
31  if( !placer )
32  return;
33 
34  SetText( placer->TuningInfo( m_frame->GetUserUnits() ) );
35 
36  switch( placer->TuningStatus() )
37  {
39  SetTextColor( wxColour( 0, 255, 0 ) );
40  break;
42  SetTextColor( wxColour( 255, 128, 128 ) );
43  break;
45  SetTextColor( wxColour( 128, 128, 255 ) );
46  break;
47  }
48 }
EDA_DRAW_FRAME * m_frame
Definition: status_popup.h:67
Class MEANDER_PLACER_BASE.
void SetTextColor(const wxColour &aColor)
Change text color.
PLACEMENT_ALGO * Placer()
Definition: pns_router.h:216
virtual TUNING_STATUS TuningStatus() const =0
Function TuningStatus()
virtual const wxString TuningInfo(EDA_UNITS_T aUnits) const =0
Function TuningInfo()
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:290
void SetText(const wxString &aText)
Display a text.

Member Data Documentation

◆ m_expireTimer

wxTimer STATUS_POPUP::m_expireTimer
protectedinherited

Definition at line 70 of file status_popup.h.

Referenced by STATUS_POPUP::Expire().

◆ m_frame

EDA_DRAW_FRAME* STATUS_POPUP::m_frame
protectedinherited

Definition at line 67 of file status_popup.h.

Referenced by STATUS_POPUP::onCharHook(), and UpdateStatus().

◆ m_panel

wxPanel* STATUS_POPUP::m_panel
protectedinherited

◆ m_statusLine

wxStaticText* STATUS_TEXT_POPUP::m_statusLine
protectedinherited

◆ m_topSizer

wxBoxSizer* STATUS_POPUP::m_topSizer
protectedinherited

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