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

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

Set MacOS file associations.

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

Definition at line 281 of file kicad.cpp.

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

282  {
283  Pgm().MacOpenFile( aFileName );
284  }
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).
int APP_KICAD::OnExit ( )
inlineoverride

Definition at line 240 of file kicad.cpp.

References PGM_KICAD::OnPgmExit().

241  {
242  program.OnPgmExit();
243 
244 #if defined(__FreeBSD__)
245  /* Avoid wxLog crashing when used in destructors. */
246  wxLog::EnableLogging( false );
247 #endif
248 
249  return wxApp::OnExit();
250  }
static PGM_KICAD program
Definition: kicad.cpp:63
void OnPgmExit()
Definition: kicad.cpp:174
bool APP_KICAD::OnInit ( )
inlineoverride

Definition at line 235 of file kicad.cpp.

References PGM_KICAD::OnPgmInit().

236  {
237  return program.OnPgmInit();
238  }
bool OnPgmInit()
Definition: kicad.cpp:78
static PGM_KICAD program
Definition: kicad.cpp:63
int APP_KICAD::OnRun ( )
inlineoverride

Definition at line 252 of file kicad.cpp.

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

253  {
254  try
255  {
256  return wxApp::OnRun();
257  }
258  catch( const std::exception& e )
259  {
260  wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
261  GetChars( FROM_UTF8( typeid(e).name() )),
262  GetChars( FROM_UTF8( e.what() ) ) );
263  }
264  catch( const IO_ERROR& ioe )
265  {
266  wxLogError( GetChars( ioe.What() ) );
267  }
268  catch(...)
269  {
270  wxLogError( wxT( "Unhandled exception of unknown type" ) );
271  }
272 
273  return -1;
274  }
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:53
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:92
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

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