KiCad PCB EDA Suite
APP_KICAD Struct Reference

Not publicly visible because most of the action is in PGM_KICAD these days. More...

Inheritance diagram for APP_KICAD:

Public Member Functions

 APP_KICAD ()
 
bool OnInit () override
 
int OnExit () override
 
int OnRun () override
 
int FilterEvent (wxEvent &aEvent) override
 

Detailed Description

Not publicly visible because most of the action is in PGM_KICAD these days.

Definition at line 258 of file kicad.cpp.

Constructor & Destructor Documentation

◆ APP_KICAD()

APP_KICAD::APP_KICAD ( )
inline

Definition at line 260 of file kicad.cpp.

260  : wxApp()
261  {
262  // Init the environment each platform wants
264  }
void Init()
Perform environment initialization tasks.

References KIPLATFORM::ENV::Init().

Member Function Documentation

◆ FilterEvent()

int APP_KICAD::FilterEvent ( wxEvent &  aEvent)
inlineoverride

Definition at line 317 of file kicad.cpp.

318  {
319  if( aEvent.GetEventType() == wxEVT_SHOW )
320  {
321  wxShowEvent& event = static_cast<wxShowEvent&>( aEvent );
322  wxDialog* dialog = dynamic_cast<wxDialog*>( event.GetEventObject() );
323 
324  if( dialog && dialog->IsModal() )
325  Pgm().m_ModalDialogCount += event.IsShown() ? 1 : -1;
326  }
327 
328  return Event_Skip;
329  }
int m_ModalDialogCount
Definition: pgm_base.h:332
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:72

References PGM_BASE::m_ModalDialogCount, and Pgm().

◆ OnExit()

int APP_KICAD::OnExit ( )
inlineoverride

Definition at line 282 of file kicad.cpp.

283  {
284  program.OnPgmExit();
285 
286 #if defined(__FreeBSD__)
287  // Avoid wxLog crashing when used in destructors.
288  wxLog::EnableLogging( false );
289 #endif
290 
291  return wxApp::OnExit();
292  }
static PGM_KICAD program
Definition: kicad.cpp:69
void OnPgmExit()
Definition: kicad.cpp:211

References PGM_KICAD::OnPgmExit(), and program.

◆ OnInit()

bool APP_KICAD::OnInit ( )
inlineoverride

Definition at line 267 of file kicad.cpp.

268  {
269  // Perform platform-specific init tasks
270  if( !KIPLATFORM::APP::Init() )
271  return false;
272 
273  if( !program.OnPgmInit() )
274  {
275  program.OnPgmExit();
276  return false;
277  }
278 
279  return true;
280  }
bool OnPgmInit()
Definition: kicad.cpp:91
static PGM_KICAD program
Definition: kicad.cpp:69
bool Init()
Perform application-specific initialization tasks.
Definition: gtk/app.cpp:40
void OnPgmExit()
Definition: kicad.cpp:211

References KIPLATFORM::APP::Init(), PGM_KICAD::OnPgmExit(), PGM_KICAD::OnPgmInit(), and program.

◆ OnRun()

int APP_KICAD::OnRun ( )
inlineoverride

Definition at line 294 of file kicad.cpp.

295  {
296  try
297  {
298  return wxApp::OnRun();
299  }
300  catch( const std::exception& e )
301  {
302  wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
303  FROM_UTF8( typeid( e ).name() ), FROM_UTF8( e.what() ) );
304  }
305  catch( const IO_ERROR& ioe )
306  {
307  wxLogError( ioe.What() );
308  }
309  catch(...)
310  {
311  wxLogError( wxT( "Unhandled exception of unknown type" ) );
312  }
313 
314  return -1;
315  }
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:110
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
const char * name
Definition: DXF_plotter.cpp:59
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75

References FROM_UTF8(), name, and IO_ERROR::What().


The documentation for this struct was generated from the following file: