-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNET_USE.CPP
169 lines (127 loc) · 3.87 KB
/
NET_USE.CPP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// drawvw.cpp : implementation of the CNetUse class
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1993 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and Microsoft
// QuickHelp and/or WinHelp documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#include <afxpriv.h>
#include "train.h"
#include "drawdoc.h"
#include "drawobj.h"
#include "cntritem.h"
#include "basevw.h"
#include "mapview.h"
#include "net_use.h"
#include "drawtool.h"
#include "mainfrm.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNetUse
IMPLEMENT_DYNCREATE(CNetUse, CBaseView)
BEGIN_MESSAGE_MAP(CNetUse, CBaseView)
ON_COMMAND(ID_GET_FAHRKARTE, OnChooseFahrkarte)
ON_UPDATE_COMMAND_UI(ID_GET_FAHRKARTE, OnUpdateChooseFahrkarte)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNetUse construction/destruction
CNetUse::CNetUse()
{
m_bGrid = TRUE;
m_gridColor = RGB(0, 0, 128);
m_bActive = FALSE;
}
CNetUse::~CNetUse()
{
}
BOOL CNetUse::PreCreateWindow(CREATESTRUCT& cs)
{
return CBaseView::PreCreateWindow(cs);
}
void CNetUse::OnActivateView(BOOL bActivate, CView* pActiveView,
CView* pDeactiveView)
{
if (m_bActive != bActivate)
{
CMainFrame* V = (CMainFrame*) AfxGetMainWnd();
if (V != NULL) V->OnViewBar(IDW_USE);
}
CBaseView::OnActivateView(bActivate, pActiveView, pDeactiveView);
}
/////////////////////////////////////////////////////////////////////////////
// CNetUse drawing
CObList* CNetUse::GetDocObjects()
{
return GetDocument()->GetNetObjects();
}
void CNetUse::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CBaseView::OnPrepareDC(pDC, pInfo);
}
void CNetUse::OnInitialUpdate()
{
CBaseView::OnInitialUpdate();
}
/////////////////////////////////////////////////////////////////////////////
// CNetUse printing
BOOL CNetUse::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CNetUse::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
CScrollView::OnBeginPrinting(pDC,pInfo);
// check page size -- user could have gone into print setup
// from print dialog and changed paper or orientation
GetDocument()->ComputePageSize();
}
void CNetUse::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// OLE Client support and commands
BOOL CNetUse::IsSelected(const CObject* pDocItem) const
{
CDrawObj* pDrawObj = (CDrawObj*)pDocItem;
if (pDocItem->IsKindOf(RUNTIME_CLASS(CDrawItem)))
pDrawObj = ((CDrawItem*)pDocItem)->m_pDrawObj;
return m_selection.Find(pDrawObj) != NULL;
}
void CNetUse::OnMouseMove(UINT nFlags, CPoint point)
{
if (!m_bActive)
return;
}
/////////////////////////////////////////////////////////////////////////////
// CNetUse message handlers
void CNetUse::OnChooseFahrkarte()
{
CDrawTool::c_drawShape = choosefahrkarte;
}
void CNetUse::OnUpdateChooseFahrkarte(CCmdUI* pCmdUI)
{
pCmdUI->SetRadio(CDrawTool::c_drawShape == choosefahrkarte);
}
/////////////////////////////////////////////////////////////////////////////
// CNetUse diagnostics
#ifdef _DEBUG
void CNetUse::AssertValid() const
{
CScrollView::AssertValid();
}
void CNetUse::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////