Develop and Download Open Source Software

Browse CVS Repository

Contents of /malonnote/main.cpp

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


Revision 1.2 - (show annotations) (download) (as text)
Fri Jul 29 03:07:53 2005 UTC (18 years, 7 months ago) by maloninc
Branch: MAIN
CVS Tags: dev-0_9-0001-merged-01, release-0_9_1, dev-1_0-0003-wxHtmlWindow, dev-1_0-0001, dev-1_0-0005, dev-1_0-0004, dev-1_0-0002-textctrl, dev-0_9-merged-02
Changes since 1.1: +2 -2 lines
File MIME type: text/x-c++src
*for support request ID:6431
 not re-search memo data, when new memo's subject has change.

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 }

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