Develop and Download Open Source Software

Browse CVS Repository

Contents of /satellite/neuromanager/neuromanager/NeuroManager.cpp

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


Revision 1.3 - (show annotations) (download) (as text)
Mon Mar 20 07:24:14 2006 UTC (18 years ago) by orrisroot
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -12 lines
File MIME type: text/x-c++src
added menubar update samples.

1 /* --------------------------------------------------------------------- */
2 /* NeuroManager - A spike train analysis tool */
3 /* Copyright (c) 2005-2006 RIKEN, Japan. All rights reserved. */
4 /* http://satellite.sourceforge.jp/ */
5 /* --------------------------------------------------------------------- */
6 /* This program is free software; you can redistribute it and/or */
7 /* modify it under the terms of the GNU General Public License */
8 /* as published by the Free Software Foundation; either version 2 */
9 /* of the License, or (at your option) any later version. */
10 /* */
11 /* This program is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU General Public License */
17 /* along with this program; see the file COPYING.txt. If not, write */
18 /* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth */
19 /* Floor, Boston, MA 02110-1301, USA. */
20 /* --------------------------------------------------------------------- */
21
22 /* $Id: NeuroManager.cpp,v 1.2 2006/03/14 13:17:47 orrisroot Exp $ */
23
24 // NeuroManager.cpp : Defines the class behaviors for the application.
25 //
26
27 #include "stdafx.h"
28 #include "NeuroManager.h"
29 #include "DataViewSplitter.h"
30 #include "DataViewBar.h"
31 #include "SpikeViewSplitter.h"
32 #include "SpikeViewBar.h"
33 #include "MainFrm.h"
34
35 #include "NeuroManagerDoc.h"
36 #include "NeuroManagerView.h"
37 #include "SpikeViewProperties.h"
38 #include ".\neuromanager.h"
39
40 #ifdef _DEBUG
41 #define new DEBUG_NEW
42 #endif
43
44
45 // CNeuroManagerApp
46
47 BEGIN_MESSAGE_MAP( CNeuroManagerApp, CWinApp )
48 ON_COMMAND( ID_APP_ABOUT, OnAppAbout )
49 // Standard file based document commands
50 ON_COMMAND( ID_FILE_NEW, CWinApp::OnFileNew )
51 ON_COMMAND( ID_FILE_OPEN, CWinApp::OnFileOpen )
52 // Standard print setup command
53 ON_COMMAND( ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup )
54 END_MESSAGE_MAP()
55
56
57 // CNeuroManagerApp construction
58
59 CNeuroManagerApp::CNeuroManagerApp()
60 {
61 // TODO: add construction code here,
62 // Place all significant initialization in InitInstance
63 }
64
65
66 // The one and only CNeuroManagerApp object
67
68 CNeuroManagerApp theApp;
69
70 // CNeuroManagerApp initialization
71
72 BOOL CNeuroManagerApp::InitInstance()
73 {
74 AfxOleInit();
75 // InitCommonControls() is required on Windows XP if an application
76 // manifest specifies use of ComCtl32.dll version 6 or later to enable
77 // visual styles. Otherwise, any window creation will fail.
78 InitCommonControls();
79
80 CWinApp::InitInstance();
81
82 // Standard initialization
83 // If you are not using these features and wish to reduce the size
84 // of your final executable, you should remove from the following
85 // the specific initialization routines you do not need
86 // Change the registry key under which our settings are stored
87 // TODO: You should modify this string to be something appropriate
88 // such as the name of your company or organization
89 SetRegistryKey( _T( "Neuroinformatics Laboratory" ) );
90 LoadStdProfileSettings( 4 ); // Load standard INI file options (including MRU)
91 // Register the application's document templates. Document templates
92 // serve as the connection between documents, frame windows and views
93 CSingleDocTemplate* pDocTemplate;
94 pDocTemplate = new CSingleDocTemplate(
95 IDR_MAINFRAME,
96 RUNTIME_CLASS( CNeuroManagerDoc ),
97 // main SDI frame window
98 RUNTIME_CLASS( CMainFrame ),
99 RUNTIME_CLASS( CNeuroManagerView ) );
100 if ( !pDocTemplate )
101 return FALSE;
102 AddDocTemplate( pDocTemplate );
103
104 // Parse command line for standard shell commands, DDE, file open
105 CCommandLineInfo cmdInfo;
106 ParseCommandLine( cmdInfo );
107
108 // disable to open empty document
109 //if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)
110 // cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
111
112 // Dispatch commands specified on the command line. Will return FALSE if
113 // app was launched with /RegServer, /Register, /Unregserver or /Unregister.
114 if ( !ProcessShellCommand( cmdInfo ) )
115 return FALSE;
116
117 // The one and only window has been initialized, so show and update it.
118 m_pMainWnd->ShowWindow( SW_SHOW );
119 m_pMainWnd->UpdateWindow();
120
121 // create ohter views
122 //if (!((CMainFrame*)m_pMainWnd)->CreateMultiViews())
123 // return FALSE;
124
125 return TRUE;
126 }
127
128
129
130 // CAboutDlg dialog used for App About
131
132 class CAboutDlg : public CDialog
133 {
134 public:
135 CAboutDlg();
136
137 // Dialog Data
138 enum { IDD = IDD_ABOUTBOX };
139
140 protected:
141 virtual void DoDataExchange( CDataExchange* pDX ); // DDX/DDV support
142
143 // Implementation
144 protected:
145 DECLARE_MESSAGE_MAP()
146 };
147
148 CAboutDlg::CAboutDlg() : CDialog( CAboutDlg::IDD )
149 {}
150
151 void CAboutDlg::DoDataExchange( CDataExchange* pDX )
152 {
153 CDialog::DoDataExchange( pDX );
154 }
155
156 BEGIN_MESSAGE_MAP( CAboutDlg, CDialog )
157 END_MESSAGE_MAP()
158
159 // App command to run the dialog
160 void CNeuroManagerApp::OnAppAbout()
161 {
162 CAboutDlg aboutDlg;
163 aboutDlg.DoModal();
164 }

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