Develop and Download Open Source Software

Browse CVS Repository

Annotation of /malonnote/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download) (as text)
Sun Jul 31 02:40:05 2005 UTC (18 years, 8 months ago) by maloninc
Branch: MAIN
CVS Tags: dev-1_0-0010, dev-1_0-0011, dev-1_0-0012, dev-1_0-0013, dev-1_0-0014, dev-1_0-0015, dev-1_0-0016, dev-1_0-0017, rel_1_3, dev-1_0-0009, dev_1_3-0008, dev_1_3-0004, dev_1_3-0005, dev_1_3-0006, dev_1_3-0007, dev_1_3-0001, dev_1_3-0002, dev_1_3-0003, rel-1_1, dev-1_0-0008, dev-1_0-0007, dev-1_0-0006, dev_1_4-0001, rel-1_0, dev-1_1-0005, dev-1_1-0006, dev-1_1-0007, dev-1_1-0001, dev-1_1-0002, dev-1_1-0003, dev-1_2-0001, dev-1_1-0009, dev-1_1-0008
Changes since 1.2: +1 -1 lines
File MIME type: text/x-c++src
for wxMac-carbon-unicode

1 maloninc 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 maloninc 1.2 #include "mnDef.h"
7 maloninc 1.1 #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 maloninc 1.3 //static wxLocale locale(wxLANGUAGE_DEFAULT);
24 maloninc 1.1
25     bool mnApp::OnInit()
26     {
27    
28 maloninc 1.2 const wxString appName = wxString::Format(wxT(MN_APP_NAME) wxT("-%s"), wxGetUserId().c_str());
29 maloninc 1.1
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     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26