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

289  {
290  Pgm().MacOpenFile( aFileName );
291  }
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 247 of file kicad.cpp.

248  {
249  program.OnPgmExit();
250 
251 #if defined(__FreeBSD__)
252  /* Avoid wxLog crashing when used in destructors. */
253  wxLog::EnableLogging( false );
254 #endif
255 
256  return wxApp::OnExit();
257  }
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 242 of file kicad.cpp.

243  {
244  return program.OnPgmInit();
245  }
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 259 of file kicad.cpp.

260  {
261  try
262  {
263  return wxApp::OnRun();
264  }
265  catch( const std::exception& e )
266  {
267  wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
268  GetChars( FROM_UTF8( typeid(e).name() )),
269  GetChars( FROM_UTF8( e.what() ) ) );
270  }
271  catch( const IO_ERROR& ioe )
272  {
273  wxLogError( GetChars( ioe.What() ) );
274  }
275  catch(...)
276  {
277  wxLogError( wxT( "Unhandled exception of unknown type" ) );
278  }
279 
280  return -1;
281  }
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

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


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