⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toolsoftforprintiew.cpp

📁 打印数据生成和模拟
💻 CPP
字号:


#include "stdafx.h"
#include "ToolSoftForPrint.h"

#include "ToolSoftForPrintDoc.h"
#include "ToolSoftForPrintView.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

UINT WM_CHANGE_ACTIVE_TABL	= ::RegisterWindowMessage (_T("WM_ONCHANGE_ACTIVE_TABL"));
/////////////////////////////////////////////////////////////////////////////
// CToolSoftForPrintView

IMPLEMENT_DYNCREATE(CToolSoftForPrintView, CView)

BEGIN_MESSAGE_MAP(CToolSoftForPrintView, CView)
	//{{AFX_MSG_MAP(CToolSoftForPrintView)
	ON_WM_CREATE()
	ON_WM_ERASEBKGND()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
	ON_REGISTERED_MESSAGE(BCGM_CHANGE_ACTIVE_TAB,OnTabActivate)
//	ON_REGISTERED_MESSAGE(BCGM_CHANGE_ACTIVE_TAB,OnTableChange)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CToolSoftForPrintView construction/destruction

CToolSoftForPrintView::CToolSoftForPrintView()
{
	// TODO: add construction code here

}

CToolSoftForPrintView::~CToolSoftForPrintView()
{
}

BOOL CToolSoftForPrintView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CToolSoftForPrintView drawing

void CToolSoftForPrintView::OnDraw(CDC* pDC)
{

}

LONG CToolSoftForPrintView::OnTabActivate(WPARAM wParam, LPARAM lParam)
{


	return 0;
}
/////////////////////////////////////////////////////////////////////////////
// CToolSoftForPrintView printing

BOOL CToolSoftForPrintView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CToolSoftForPrintView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CToolSoftForPrintView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CToolSoftForPrintView diagnostics

#ifdef _DEBUG
void CToolSoftForPrintView::AssertValid() const
{
	CView::AssertValid();
}

void CToolSoftForPrintView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}


#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CToolSoftForPrintView message handlers

int CToolSoftForPrintView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CView::OnCreate(lpCreateStruct) == -1)
		return -1;
	CRect rectDummy;
	const DWORD dwViewStyle = LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL;
	rectDummy.SetRectEmpty ();

	if (!m_wndTabs.Create (CBCGTabWnd::STYLE_FLAT_SHARED_HORZ_SCROLL, rectDummy, this, 1))
	{
		TRACE0("Failed to create output tab window\n");
		return -1;
	}
	m_wndTabs.ShowWindow(SW_HIDE);
	// TODO: Add your specialized creation code here
   CChildFrame *pFrame=(CChildFrame*)this->GetParent();
	ASSERT(pFrame->IsKindOf(RUNTIME_CLASS(CChildFrame)));	
	pFrame->SetTskEditView(this);	
	return 0;
}

BOOL CToolSoftForPrintView::OnEraseBkgnd(CDC* pDC) 
{
  CRect recTmp;
  GetClientRect(&recTmp);
  pDC->FillRect(recTmp,&CBrush(RGB(0,0,0)));
	//return CView::OnEraseBkgnd(pDC);
  return TRUE;
}

void CToolSoftForPrintView::OnSize(UINT nType, int cx, int cy) 
{
	CView::OnSize(nType, cx, cy);	
	CRect rc;
    GetClientRect(rc);	
	m_wndTabs.SetWindowPos(NULL, rc.left, rc.top, rc.Width(), rc.Height (), SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW);	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -