KiCad PCB EDA Suite
APP_KICAD Struct Reference

Struct APP_KICAD is not publicly visible because most of the action is in PGM_KICAD these days. More...

Inheritance diagram for APP_KICAD:

Public Member Functions

bool OnInit () override
 
int OnExit () override
 
int OnRun () override
 
void MacOpenFile (const wxString &aFileName)
 Set MacOS file associations. More...
 

Detailed Description

Struct APP_KICAD is not publicly visible because most of the action is in PGM_KICAD these days.

Definition at line 218 of file kicad.cpp.

Member Function Documentation

◆ MacOpenFile()

void APP_KICAD::MacOpenFile ( const wxString &  aFileName)
inline

Set MacOS file associations.

See also
http://wiki.wxwidgets.org/WxMac-specific_topics

Definition at line 292 of file kicad.cpp.

293  {
294  Pgm().MacOpenFile( aFileName );
295  }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
VTBL_ENTRY void MacOpenFile(const wxString &aFileName)=0
Function MacOpenFile is specific to MacOSX (not used under Linux or Windows).

References PGM_BASE::MacOpenFile(), and Pgm().

◆ OnExit()

int APP_KICAD::OnExit ( )
inlineoverride

Definition at line 251 of file kicad.cpp.

252  {
253  program.OnPgmExit();
254 
255 #if defined(__FreeBSD__)
256  /* Avoid wxLog crashing when used in destructors. */
257  wxLog::EnableLogging( false );
258 #endif
259 
260  return wxApp::OnExit();
261  }
static PGM_KICAD program
Definition: kicad.cpp:63
void OnPgmExit()
Definition: kicad.cpp:174

References PGM_KICAD::OnPgmExit(), and program.

◆ OnInit()

bool APP_KICAD::OnInit ( )
inlineoverride

Definition at line 246 of file kicad.cpp.

247  {
248  return program.OnPgmInit();
249  }
bool OnPgmInit()
Definition: kicad.cpp:78
static PGM_KICAD program
Definition: kicad.cpp:63

References PGM_KICAD::OnPgmInit(), and program.

◆ OnRun()

int APP_KICAD::OnRun ( )
inlineoverride

Definition at line 263 of file kicad.cpp.

264  {
265  try
266  {
267  return wxApp::OnRun();
268  }
269  catch( const std::exception& e )
270  {
271  wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
272  GetChars( FROM_UTF8( typeid(e).name() )),
273  GetChars( FROM_UTF8( e.what() ) ) );
274  }
275  catch( const IO_ERROR& ioe )
276  {
277  wxLogError( GetChars( ioe.What() ) );
278  }
279  catch(...)
280  {
281  wxLogError( wxT( "Unhandled exception of unknown type" ) );
282  }
283 
284  return -1;
285  }
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:61
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
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:100
const char * name
Definition: DXF_plotter.cpp:61
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76

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


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