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)
 
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 ( 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

void STATUS_POPUP::Expire ( int  aMsecs)
inherited

Hides the popup after a specified time.

Parameters
aMsecsis the time expressed in milliseconds

Definition at line 82 of file status_popup.cpp.

References STATUS_POPUP::m_expireTimer.

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

83 {
84  m_expireTimer.StartOnce( aMsecs );
85 }
wxTimer m_expireTimer
Definition: status_popup.h:68
void STATUS_POPUP::Move ( const wxPoint aWhere)
virtualinherited

Definition at line 76 of file status_popup.cpp.

References PCAD2KICAD::SetPosition().

Referenced by DRAWING_TOOL::drawZone(), EDIT_TOOL::pickCopyReferencePoint(), LENGTH_TUNER_TOOL::updateStatusPopup(), and STATUS_POPUP::~STATUS_POPUP().

77 {
78  SetPosition( aWhere );
79 }
void SetPosition(wxString aStr, const wxString &aDefaultMeasurementUnit, int *aX, int *aY, const wxString &aActualConversion)
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(), and 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:65
void OnEvent(wxEvent &aEvent)
Used to forward events to the canvas from popups, etc.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:901
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:908
bool ProcessEvent(wxEvent &aEvent) override
Function ProcessEvent overrides the default process event handler to implement the auto save feature...
void STATUS_POPUP::onExpire ( wxTimerEvent &  aEvent)
protectedinherited

Expire timer even handler

Definition at line 95 of file status_popup.cpp.

Referenced by STATUS_POPUP::STATUS_POPUP(), and STATUS_POPUP::~STATUS_POPUP().

96 {
97  Hide();
98 }
void STATUS_POPUP::Popup ( wxWindow *  aFocus = nullptr)
virtualinherited

Definition at line 69 of file status_popup.cpp.

Referenced by DRAWING_TOOL::drawZone(), LENGTH_TUNER_TOOL::performTuning(), EDIT_TOOL::pickCopyReferencePoint(), and STATUS_POPUP::~STATUS_POPUP().

70 {
71  Show( true );
72  Raise();
73 }
void STATUS_TEXT_POPUP::SetText ( const wxString &  aText)
inherited

Display a text.

Parameters
aTextis the text to be displayed.

Definition at line 111 of file status_popup.cpp.

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

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

112 {
113  m_statusLine->SetLabel( aText );
114  updateSize();
115 }
wxStaticText * m_statusLine
Definition: status_popup.h:96
void updateSize()
void STATUS_TEXT_POPUP::SetTextColor ( const wxColour &  aColor)
inherited

Change text color.

Parameters
aColoris the new text color.

Definition at line 118 of file status_popup.cpp.

References STATUS_TEXT_POPUP::m_statusLine.

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

119 {
120  m_statusLine->SetForegroundColour( aColor );
121 }
wxStaticText * m_statusLine
Definition: status_popup.h:96
void STATUS_POPUP::updateSize ( )
protectedinherited

Definition at line 88 of file status_popup.cpp.

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

Referenced by STATUS_TEXT_POPUP::SetText(), and STATUS_POPUP::~STATUS_POPUP().

89 {
90  m_topSizer->Fit( m_panel );
91  SetClientSize( m_panel->GetSize() );
92 }
wxPanel * m_panel
Definition: status_popup.h:66
wxBoxSizer * m_topSizer
Definition: status_popup.h:67
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:65
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:284
void SetText(const wxString &aText)
Display a text.

Member Data Documentation

wxTimer STATUS_POPUP::m_expireTimer
protectedinherited

Definition at line 68 of file status_popup.h.

Referenced by STATUS_POPUP::Expire().

EDA_DRAW_FRAME* STATUS_POPUP::m_frame
protectedinherited

Definition at line 65 of file status_popup.h.

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

wxPanel* STATUS_POPUP::m_panel
protectedinherited
wxStaticText* STATUS_TEXT_POPUP::m_statusLine
protectedinherited
wxBoxSizer* STATUS_POPUP::m_topSizer
protectedinherited

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