Develop and Download Open Source Software

Browse CVS Repository

Contents of /satellite/neuromanager/NeuroManagerView.cpp

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


Revision 1.6 - (show annotations) (download) (as text)
Sat Feb 4 13:38:16 2006 UTC (18 years, 2 months ago) by orrisroot
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
File MIME type: text/x-c++src
FILE REMOVED
moved main application sources to neuromanager directory.

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: NeuroManagerView.cpp,v 1.5 2006/01/24 01:59:57 orrisroot Exp $ */
23
24 // NeuroManagerView.cpp : implementation of the CNeuroManagerView class
25 //
26
27 #include "stdafx.h"
28 #include "NeuroManager.h"
29
30 #include "NeuroManagerDoc.h"
31 #include "NeuroManagerView.h"
32
33 #ifdef _DEBUG
34 #define new DEBUG_NEW
35 #endif
36
37
38 // CNeuroManagerView
39
40 IMPLEMENT_DYNCREATE( CNeuroManagerView, CView )
41
42 BEGIN_MESSAGE_MAP( CNeuroManagerView, CView )
43 ON_WM_ERASEBKGND()
44 ON_WM_DESTROY()
45 // Standard printing commands
46 ON_COMMAND( ID_FILE_PRINT, CView::OnFilePrint )
47 ON_COMMAND( ID_FILE_PRINT_DIRECT, CView::OnFilePrint )
48 ON_COMMAND( ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview )
49 END_MESSAGE_MAP()
50
51 // CNeuroManagerView construction/destruction
52
53 CNeuroManagerView::CNeuroManagerView()
54 {
55 // TODO: add construction code here
56 m_hOldBkgndBrush = 0;
57 }
58
59 CNeuroManagerView::~CNeuroManagerView()
60 {}
61
62 BOOL CNeuroManagerView::PreCreateWindow( CREATESTRUCT& cs )
63 {
64 // TODO: Modify the Window class or styles here by modifying
65 // the CREATESTRUCT cs
66 return CView::PreCreateWindow( cs );
67 }
68
69
70 // CNeuroManagerView drawing
71
72 void CNeuroManagerView::OnDraw( CDC* pDC )
73 {
74 CNeuroManagerDoc * pDoc = GetDocument();
75 ASSERT_VALID( pDoc );
76 if ( !pDoc )
77 return ;
78
79 // TODO: add draw code for native data here
80
81 }
82
83
84 // CNeuroManagerView printing
85
86 BOOL CNeuroManagerView::OnPreparePrinting( CPrintInfo* pInfo )
87 {
88 // default preparation
89 return DoPreparePrinting( pInfo );
90 }
91
92 void CNeuroManagerView::OnBeginPrinting( CDC* /*pDC*/, CPrintInfo* /*pInfo*/ )
93 {
94 // TODO: add extra initialization before printing
95 }
96
97 void CNeuroManagerView::OnEndPrinting( CDC* /*pDC*/, CPrintInfo* /*pInfo*/ )
98 {
99 // TODO: add cleanup after printing
100 }
101
102
103 // CNeuroManagerView diagnostics
104
105 #ifdef _DEBUG
106 void CNeuroManagerView::AssertValid() const
107 {
108 CView::AssertValid();
109 }
110
111 void CNeuroManagerView::Dump( CDumpContext& dc ) const
112 {
113 CView::Dump( dc );
114 }
115
116 CNeuroManagerDoc* CNeuroManagerView::GetDocument() const // non-debug version is inline
117 {
118 ASSERT( m_pDocument->IsKindOf( RUNTIME_CLASS( CNeuroManagerDoc ) ) );
119 return ( CNeuroManagerDoc* ) m_pDocument;
120 }
121 #endif //_DEBUG
122
123
124 BOOL CNeuroManagerView::OnEraseBkgnd( CDC* pDC )
125 {
126 BOOL ret = CView::OnEraseBkgnd( pDC );
127
128 pDC->SetBkColor( GetSysColor( COLOR_APPWORKSPACE ) ); // for background color of TextOut()
129
130 return ret;
131 }
132
133 void CNeuroManagerView::OnDestroy()
134 {
135 // resotore brush color
136 if ( m_hOldBkgndBrush )
137 {
138 SetClassLongPtr( GetSafeHwnd(), GCL_HBRBACKGROUND, ( LONG_PTR ) m_hOldBkgndBrush );
139 m_hOldBkgndBrush = 0;
140 m_BkgndBrush.DeleteObject();
141 }
142
143 CView::OnDestroy();
144 }
145
146 void CNeuroManagerView::OnInitialUpdate()
147 {
148 CView::OnInitialUpdate();
149
150 // create and change background brush color
151 if ( m_BkgndBrush.m_hObject == 0 )
152 {
153 m_BkgndBrush.CreateSolidBrush( GetSysColor( COLOR_APPWORKSPACE ) ); // color of MDI workspace
154 m_hOldBkgndBrush = ( HBRUSH ) SetClassLongPtr(
155 GetSafeHwnd(),
156 GCL_HBRBACKGROUND,
157 ( LONG_PTR ) m_BkgndBrush.m_hObject
158 );
159 }
160 }

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