DragonNest/Third/XTToolkitPro/Samples/CommandBars/CustomizeDlg/CustomizeDlgView.cpp
2024-12-19 09:48:26 +08:00

134 lines
3.6 KiB
C++

// CustomizeDlgView.cpp : implementation of the CCustomizeDlgView class
//
// This file is a part of the XTREME TOOLKIT PRO MFC class library.
// (c)1998-2008 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF CODEJOCK SOFTWARE.
//
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// support@codejock.com
// http://www.codejock.com
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "CustomizeDlg.h"
#include "CustomizeDlgDoc.h"
#include "CustomizeDlgView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDlgView
IMPLEMENT_DYNCREATE(CCustomizeDlgView, CEditView)
BEGIN_MESSAGE_MAP(CCustomizeDlgView, CEditView)
//{{AFX_MSG_MAP(CCustomizeDlgView)
ON_WM_RBUTTONDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDlgView construction/destruction
CCustomizeDlgView::CCustomizeDlgView()
{
// TODO: add construction code here
}
CCustomizeDlgView::~CCustomizeDlgView()
{
}
BOOL CCustomizeDlgView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
BOOL bPreCreated = CEditView::PreCreateWindow(cs);
cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
return bPreCreated;
}
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDlgView drawing
void CCustomizeDlgView::OnDraw(CDC* /*pDC*/)
{
CCustomizeDlgDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDlgView printing
BOOL CCustomizeDlgView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CCustomizeDlgView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CCustomizeDlgView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDlgView diagnostics
#ifdef _DEBUG
void CCustomizeDlgView::AssertValid() const
{
CEditView::AssertValid();
}
void CCustomizeDlgView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CCustomizeDlgDoc* CCustomizeDlgView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCustomizeDlgDoc)));
return (CCustomizeDlgDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCustomizeDlgView message handlers
void CCustomizeDlgView::OnRButtonDown(UINT /*nFlags*/, CPoint point)
{
ClientToScreen(&point);
((CXTPMDIFrameWnd*)AfxGetMainWnd())->GetCommandBars()->
TrackPopupMenu(IDR_CONTEXT_MENU, TPM_RIGHTBUTTON, point.x, point.y);
}