KiCad PCB EDA Suite
KICAD_MANAGER_FRAME::TERMINATE_HANDLER Class Reference

#include <kicad.h>

Inheritance diagram for KICAD_MANAGER_FRAME::TERMINATE_HANDLER:

Public Member Functions

 TERMINATE_HANDLER (const wxString &appName)
 
void OnTerminate (int pid, int status) override
 

Private Attributes

wxString m_appName
 

Detailed Description

Definition at line 245 of file kicad.h.

Constructor & Destructor Documentation

KICAD_MANAGER_FRAME::TERMINATE_HANDLER::TERMINATE_HANDLER ( const wxString &  appName)
inline

Definition at line 251 of file kicad.h.

251  :
252  m_appName(appName)
253  {
254  }

Member Function Documentation

void KICAD_MANAGER_FRAME::TERMINATE_HANDLER::OnTerminate ( int  pid,
int  status 
)
override

Definition at line 246 of file mainframe.cpp.

References Format(), GetChars(), KICAD_MANAGER_FRAME_NAME, m_appName, and KICAD_MANAGER_FRAME::PrintMsg().

247 {
248  wxString msg = wxString::Format( _( "%s closed [pid=%d]\n" ),
249  GetChars( m_appName ), pid );
250 
251  wxWindow* window = wxWindow::FindWindowByName( KICAD_MANAGER_FRAME_NAME );
252 
253  if( window ) // Should always happen.
254  {
255  // Be sure the kicad frame manager is found
256  // This dynamic cast is not really mandatory, but ...
257  KICAD_MANAGER_FRAME* frame = dynamic_cast<KICAD_MANAGER_FRAME*> (window);
258 
259  if( frame )
260  frame->PrintMsg( msg );
261  }
262 
263  delete this;
264 }
void PrintMsg(const wxString &aText)
Function PrintMsg displays aText in the text panel.
Definition: mainframe.cpp:197
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
Class KICAD_MANAGER_FRAME is the main KiCad project manager frame.
Definition: kicad.h:137
#define KICAD_MANAGER_FRAME_NAME
Definition: kicad.h:40

Member Data Documentation

wxString KICAD_MANAGER_FRAME::TERMINATE_HANDLER::m_appName
private

Definition at line 248 of file kicad.h.

Referenced by OnTerminate().


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