Tyro/src/TyroApp.cpp

60 lines
915 B
C++
Raw Normal View History

/**
* Main application file
*/
2015-03-30 14:50:10 -04:00
2015-04-22 10:09:43 -04:00
#include "wx_common.h"
2015-05-08 16:01:36 -04:00
#include "widgets/widget.h"
2015-04-22 10:09:43 -04:00
#include <wx/app.h>
#include <wx/debug.h>
// Some global stuff
2015-05-08 16:01:36 -04:00
wxConfigBase *Config;
TyroMenu *mbar;
MainFrame *main_frame;
/**
* Class with main method
*/
class TyroApp : public wxApp
2015-03-30 14:50:10 -04:00
{
public:
/**
* Start the event loop and create the main window
*
* @return bool
*/
bool OnInit()
{
this->SetAppName(APP_NAME);
this->SetVendorName(APP_VENDOR);
Config = wxConfigBase::Get();
mbar = new TyroMenu();
main_frame = new MainFrame(0L, APP_NAME);
SetTopWindow(main_frame);
main_frame->Layout();
main_frame->CenterOnScreen();
main_frame->Show(true);
return true;
}
/**
* Exit handler
*
* @return int
*/
int OnExit()
{
// Deallocate config object
delete wxConfigBase::Set((wxConfigBase *) NULL);
return close(true);
}
};
2015-03-30 16:01:24 -04:00
IMPLEMENT_APP(TyroApp);