Browse CVS Repository
Contents of /malonnote/main.cpp
Parent Directory
| Revision Log
| Revision Graph
Revision 1.1.1.1.2.1 -
( show annotations)
( download)
( as text)
(vendor branch)
Fri Jul 29 06:12:42 2005 UTC
(18 years, 7 months ago)
by maloninc
Branch: dev-0_9_1-0001
CVS Tags: rel-0_9_1, dev-0_9_1-0002-merged-01, dev-0_9_1-0003, dev-0_9_1-0002, dev-0_9_1-merged-02
Changes since 1.1.1.1: +2 -2 lines
File MIME type: text/x-c++src
0.9.1
| 1 |
// -*- C++ -*- generated by wxGlade 0.3.5.1 on Wed Jun 29 12:57:38 2005 |
| 2 |
|
| 3 |
#include <wx/wx.h> |
| 4 |
#include <wx/image.h> |
| 5 |
#include <wx/snglinst.h> |
| 6 |
#include "mnDef.h" |
| 7 |
#include "mnFrame.h" |
| 8 |
#include "mnController.h" |
| 9 |
|
| 10 |
|
| 11 |
class mnApp: public wxApp { |
| 12 |
public: |
| 13 |
bool OnInit(); |
| 14 |
int OnExit(); |
| 15 |
|
| 16 |
private: |
| 17 |
mnFrame* mainFrame; |
| 18 |
wxSingleInstanceChecker* m_checker; |
| 19 |
}; |
| 20 |
|
| 21 |
IMPLEMENT_APP(mnApp) |
| 22 |
|
| 23 |
static wxLocale locale(wxLANGUAGE_DEFAULT); |
| 24 |
|
| 25 |
bool mnApp::OnInit() |
| 26 |
{ |
| 27 |
|
| 28 |
const wxString appName = wxString::Format(wxT(MN_APP_NAME) wxT("-%s"), wxGetUserId().c_str()); |
| 29 |
|
| 30 |
m_checker = new wxSingleInstanceChecker(appName); |
| 31 |
if ( m_checker->IsAnotherRunning() ){ |
| 32 |
wxMessageBox(wxT("Another program instance is already running, aborting.")); |
| 33 |
delete m_checker; |
| 34 |
exit(0); |
| 35 |
} |
| 36 |
|
| 37 |
wxInitAllImageHandlers(); |
| 38 |
mainFrame = new mnFrame(0, -1, wxT("")); |
| 39 |
|
| 40 |
/* set controller object as event handler */ |
| 41 |
mnController* controller = new mnController(mainFrame); |
| 42 |
mainFrame->PushEventHandler(controller); |
| 43 |
|
| 44 |
SetTopWindow(mainFrame); |
| 45 |
mainFrame->Show(); |
| 46 |
|
| 47 |
return true; |
| 48 |
} |
| 49 |
|
| 50 |
int mnApp::OnExit() |
| 51 |
{ |
| 52 |
delete m_checker; |
| 53 |
} |
|