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 260 of file kicad.cpp.

Constructor & Destructor Documentation

◆ APP_KICAD()

APP_KICAD::APP_KICAD ( )
inline

Definition at line 262 of file kicad.cpp.

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

References KIPLATFORM::ENV::Init().

Member Function Documentation

◆ FilterEvent()

int APP_KICAD::FilterEvent ( wxEvent &  aEvent)
inlineoverride

Definition at line 319 of file kicad.cpp.

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

References PGM_BASE::m_ModalDialogCount, and Pgm().

◆ OnExit()

int APP_KICAD::OnExit ( )
inlineoverride

Definition at line 284 of file kicad.cpp.

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

References PGM_KICAD::OnPgmExit(), and program.

◆ OnInit()

bool APP_KICAD::OnInit ( )
inlineoverride

Definition at line 269 of file kicad.cpp.

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

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

◆ OnRun()

int APP_KICAD::OnRun ( )
inlineoverride

Definition at line 296 of file kicad.cpp.

297  {
298  try
299  {
300  return wxApp::OnRun();
301  }
302  catch( const std::exception& e )
303  {
304  wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
305  FROM_UTF8( typeid( e ).name() ), FROM_UTF8( e.what() ) );
306  }
307  catch( const IO_ERROR& ioe )
308  {
309  wxLogError( ioe.What() );
310  }
311  catch(...)
312  {
313  wxLogError( wxT( "Unhandled exception of unknown type" ) );
314  }
315 
316  return -1;
317  }
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:30
const char * name
Definition: DXF_plotter.cpp:56
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: