| 3 |
#include <wx/wx.h> |
#include <wx/wx.h> |
| 4 |
#include <wx/image.h> |
#include <wx/image.h> |
| 5 |
#include <wx/snglinst.h> |
#include <wx/snglinst.h> |
| 6 |
|
#include <wx/xrc/xmlres.h> |
| 7 |
|
#include "mnDef.h" |
| 8 |
#include "mnFrame.h" |
#include "mnFrame.h" |
| 9 |
#include "mnController.h" |
#include "mnFrameController.h" |
| 10 |
|
|
| 11 |
#define MY_APP "MalonNote" |
extern void InitXmlResource(); // defined in mnResource.cpp generated by wxrc |
| 12 |
|
|
| 13 |
class mnApp: public wxApp { |
class mnApp: public wxApp { |
| 14 |
public: |
public: |
| 22 |
|
|
| 23 |
IMPLEMENT_APP(mnApp) |
IMPLEMENT_APP(mnApp) |
| 24 |
|
|
| 25 |
static wxLocale locale(wxLANGUAGE_DEFAULT); |
//static wxLocale locale(wxLANGUAGE_DEFAULT); |
| 26 |
|
|
| 27 |
bool mnApp::OnInit() |
bool mnApp::OnInit() |
| 28 |
{ |
{ |
| 29 |
|
|
| 30 |
const wxString appName = wxString::Format(wxT(MY_APP) wxT("-%s"), wxGetUserId().c_str()); |
const wxString appName = wxString::Format(wxT(MN_APP_NAME) wxT("-%s"), wxGetUserId().c_str()); |
| 31 |
|
|
| 32 |
m_checker = new wxSingleInstanceChecker(appName); |
m_checker = new wxSingleInstanceChecker(appName); |
| 33 |
if ( m_checker->IsAnotherRunning() ){ |
if ( m_checker->IsAnotherRunning() ){ |
| 37 |
} |
} |
| 38 |
|
|
| 39 |
wxInitAllImageHandlers(); |
wxInitAllImageHandlers(); |
| 40 |
mainFrame = new mnFrame(0, -1, wxT("")); |
wxXmlResource::Get()->InitAllHandlers(); |
| 41 |
|
InitXmlResource(); |
| 42 |
|
|
| 43 |
|
mainFrame = new mnFrame(0); |
| 44 |
|
|
| 45 |
/* set controller object as event handler */ |
/* set controller object as event handler */ |
| 46 |
mnController* controller = new mnController(mainFrame); |
mnFrameController* controller = new mnFrameController(mainFrame); |
| 47 |
mainFrame->PushEventHandler(controller); |
mainFrame->PushEventHandler(controller); |
| 48 |
|
|
| 49 |
SetTopWindow(mainFrame); |
SetTopWindow(mainFrame); |