// [!output VIEW_IMPL] : [!output VIEW_CLASS] クラスの実装 // #include "stdafx.h" #include "[!output APP_HEADER]" #include "[!output DOC_HEADER]" #include "[!output VIEW_HEADER]" #ifdef _DEBUG #define new DEBUG_NEW #endif // [!output VIEW_CLASS] IMPLEMENT_DYNCREATE([!output VIEW_CLASS], [!output VIEW_BASE_CLASS]) BEGIN_MESSAGE_MAP([!output VIEW_CLASS], [!output VIEW_BASE_CLASS]) [!if APP_TYPE_SDI_DOCLIST] [!if !MULTIPLE_PLATFORM] [!if POCKETPC2003_UI_MODEL] ON_WM_CREATE() ON_WM_SETFOCUS() ON_WM_DESTROY() [!endif] [!else] [!if POCKETPC2003_UI_MODEL] #ifdef WIN32_PLATFORM_PSPC ON_WM_CREATE() ON_WM_SETFOCUS() ON_WM_DESTROY() #endif // WIN32_PLATFORM_PSPC [!endif] [!endif] [!endif] [!if PRINTING] // 標準印刷コマンド ON_COMMAND(ID_FILE_PRINT, &[!output VIEW_BASE_CLASS]::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, &[!output VIEW_BASE_CLASS]::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, &[!output VIEW_BASE_CLASS]::OnFilePrintPreview) [!endif] END_MESSAGE_MAP() // [!output VIEW_CLASS] コンストラクション/デストラクション [!output VIEW_CLASS]::[!output VIEW_CLASS]() [!if FORM_VIEW] : [!output VIEW_BASE_CLASS]([!output VIEW_CLASS]::IDD) [!endif] { // TODO: 構築コードをここに追加します。 } [!output VIEW_CLASS]::~[!output VIEW_CLASS]() { } [!if FORM_VIEW] void [!output VIEW_CLASS]::DoDataExchange(CDataExchange* pDX) { [!output VIEW_BASE_CLASS]::DoDataExchange(pDX); } [!endif] BOOL [!output VIEW_CLASS]::PreCreateWindow(CREATESTRUCT& cs) { // TODO: この位置で CREATESTRUCT cs を修正して Window クラスまたはスタイルを // 修正してください。 return [!output VIEW_BASE_CLASS]::PreCreateWindow(cs); } [!if !FORM_VIEW && !TREE_VIEW && !LIST_VIEW] // [!output VIEW_CLASS] 描画 void [!output VIEW_CLASS]::OnDraw(CDC* /*pDC*/) { [!output DOC_CLASS]* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: この場所にネイティブ データ用の描画コードを追加します。 } [!endif] [!if SCROLL_VIEW || LIST_VIEW || TREE_VIEW || FORM_VIEW] void [!output VIEW_CLASS]::OnInitialUpdate() { [!output VIEW_BASE_CLASS]::OnInitialUpdate(); [!if LIST_VIEW] // TODO: GetListCtrl() メンバ関数の呼び出しをとおして直接そのリスト コントロールに // アクセスすることによって ListView をアイテムで固定できます。 [!endif] [!if TREE_VIEW] // TODO: GetTreeCtrl() メンバ関数の呼び出しをとおして直接そのリスト コントロールに // アクセスすることによって TreeView をアイテムで固定できます。 [!endif] [!if SCROLL_VIEW] CSize sizeTotal; // TODO: このビューのサイズの合計を計算します。 sizeTotal.cx = sizeTotal.cy = 100; SetScrollSizes(MM_TEXT, sizeTotal); [!endif] } [!endif] [!if PRINTING] // [!output VIEW_CLASS] 印刷 BOOL [!output VIEW_CLASS]::OnPreparePrinting(CPrintInfo* pInfo) { // TODO: 印刷用のコードをここに追加してください。 // 既定の印刷準備 return DoPreparePrinting(pInfo); } void [!output VIEW_CLASS]::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: 印刷前の特別な初期化処理を追加してください。 } void [!output VIEW_CLASS]::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: 印刷後の後処理を追加してください。 } [!if FORM_VIEW] void [!output VIEW_CLASS]::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/) { // TODO: 印刷用のコードをここに追加してください。 } [!endif] [!endif] // [!output VIEW_CLASS] 診断 #ifdef _DEBUG void [!output VIEW_CLASS]::AssertValid() const { [!output VIEW_BASE_CLASS]::AssertValid(); } [!output DOC_CLASS]* [!output VIEW_CLASS]::GetDocument() const // デバッグ以外のバージョンはインラインです。 { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS([!output DOC_CLASS]))); return ([!output DOC_CLASS]*)m_pDocument; } #endif //_DEBUG [!if APP_TYPE_SDI_DOCLIST] [!if !MULTIPLE_PLATFORM] [!if POCKETPC2003_UI_MODEL] int [!output VIEW_CLASS]::OnCreate( LPCREATESTRUCT lpCreateStruct ) { int iResult = CView::OnCreate(lpCreateStruct); if(iResult == 0) SHDoneButton(TRUE); return iResult; } void [!output VIEW_CLASS]::OnSetFocus(CWnd* pOldWnd) { CView::OnSetFocus(pOldWnd); } void [!output VIEW_CLASS]::OnDestroy() { CView::OnDestroy(); } BOOL [!output VIEW_CLASS]::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } [!endif] [!else] [!if POCKETPC2003_UI_MODEL] #ifdef WIN32_PLATFORM_PSPC int [!output VIEW_CLASS]::OnCreate( LPCREATESTRUCT lpCreateStruct ) { int iResult = CView::OnCreate(lpCreateStruct); if(iResult == 0) SHDoneButton(TRUE); return iResult; } void [!output VIEW_CLASS]::OnSetFocus(CWnd* pOldWnd) { CView::OnSetFocus(pOldWnd); } void [!output VIEW_CLASS]::OnDestroy() { CView::OnDestroy(); } BOOL [!output VIEW_CLASS]::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } #endif // WIN32_PLATFORM_PSPC [!endif] [!endif] [!endif] // [!output VIEW_CLASS] メッセージ ハンドラ