📄 welldataprocessview.cpp
字号:
// WellDataProcessView.cpp : implementation of the CWellDataProcessView class
//
#include "stdafx.h"
#include "WellDataProcess.h"
#include "WellDataProcessDoc.h"
#include "WellDataProcessView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWellDataProcessView
IMPLEMENT_DYNCREATE(CWellDataProcessView, CScrollView)
BEGIN_MESSAGE_MAP(CWellDataProcessView, CScrollView)
//{{AFX_MSG_MAP(CWellDataProcessView)
ON_WM_CREATE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
ON_WM_CONTEXTMENU()
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWellDataProcessView construction/destruction
CWellDataProcessView::CWellDataProcessView()
{
// TODO: add construction code here
}
CWellDataProcessView::~CWellDataProcessView()
{
}
BOOL CWellDataProcessView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CScrollView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CWellDataProcessView drawing
void CWellDataProcessView::OnDraw(CDC* pDC)
{
CWellDataProcessDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
void CWellDataProcessView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = 100;
sizeTotal.cy = 2600;
SetScrollSizes(MM_TEXT, sizeTotal);
m_gmgsWnd.Create("GmgsAnalyseWnd", WS_CHILD | WS_VISIBLE, CRect(0, 0, 700, 2500), this);
}
/////////////////////////////////////////////////////////////////////////////
// CWellDataProcessView printing
BOOL CWellDataProcessView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CWellDataProcessView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CWellDataProcessView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CWellDataProcessView diagnostics
#ifdef _DEBUG
void CWellDataProcessView::AssertValid() const
{
CScrollView::AssertValid();
}
void CWellDataProcessView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
CWellDataProcessDoc* CWellDataProcessView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWellDataProcessDoc)));
return (CWellDataProcessDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CWellDataProcessView message handlers
void CWellDataProcessView::OnContextMenu(CWnd*, CPoint point)
{
if (point.x == -1 && point.y == -1){
//keystroke invocation
CRect rect;
GetClientRect(rect);
ClientToScreen(rect);
point = rect.TopLeft();
point.Offset(5, 5);
}
CMenu menu;
VERIFY(menu.LoadMenu(IDR_MENU_POPUP));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
pWndPopupOwner);
}
int CWellDataProcessView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CScrollView::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
void CWellDataProcessView::OnSize(UINT nType, int cx, int cy)
{
CScrollView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
}
void CWellDataProcessView::ReSize()
{
// if (!IsWindow(m_wnd.GetSafeHwnd()))
// return;
if (!IsWindow(GetSafeHwnd()))
return;
CRect rect;
GetClientRect(rect);
// CRect rc(10, 10, rect.right - 10, g_nWndHeight - 20);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -