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

📄 selviewdemoview.cpp

📁 wince 下的MID窗口演示程序
💻 CPP
字号:
// SelViewDemoView.cpp : implementation of the CSelViewDemoView class
//

#include "stdafx.h"
#include "SelViewDemo.h"

#include "SelViewDemoDoc.h"
#include "SelViewDemoView.h"
#include "MainFrm.h"
#include "MySecondView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSelViewDemoView

IMPLEMENT_DYNCREATE(CSelViewDemoView, CFormView)

BEGIN_MESSAGE_MAP(CSelViewDemoView, CFormView)
	//{{AFX_MSG_MAP(CSelViewDemoView)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnCancel)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSelViewDemoView construction/destruction

CSelViewDemoView::CSelViewDemoView()
	: CFormView(CSelViewDemoView::IDD)
{
	//{{AFX_DATA_INIT(CSelViewDemoView)
	m_selection = -1;
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CSelViewDemoView::~CSelViewDemoView()
{
}

void CSelViewDemoView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSelViewDemoView)
	DDX_Radio(pDX, IDC_RADIO1, m_selection);
	//}}AFX_DATA_MAP
}

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

	return CFormView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CSelViewDemoView diagnostics

#ifdef _DEBUG
void CSelViewDemoView::AssertValid() const
{
	CFormView::AssertValid();
}

void CSelViewDemoView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

CSelViewDemoDoc* CSelViewDemoView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSelViewDemoDoc)));
	return (CSelViewDemoDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSelViewDemoView message handlers

void CSelViewDemoView::OnNextViewButton() 
{
	UpdateData();
	CMainFrame* pMFrame = (CMainFrame*)GetParentFrame();
	pMFrame->OnSelectNextView(RUNTIME_CLASS(CMySecondView), 
				m_selection == 0 ? AIT_HIDE_WINDOW : AIT_DESTROY_WINDOW);
}

void CSelViewDemoView::OnCancel() 
{
	PostMessage(WM_CLOSE,0,0);
}

void CSelViewDemoView::OnSize(UINT nType, int cx, int cy) 
{
	CFormView::OnSize(nType, cx, cy);
	SCROLLINFO si;
	memset(&si, 0, sizeof(si));
	si.cbSize	= sizeof(si);
	si.fMask	= SIF_ALL;
	si.nMin 	= 0;
	si.nMax 	= 100;
	si.nPos 	= 0;
	si.nPage	= 200;
	SetScrollInfo(SB_VERT, &si, FALSE);
	SetScrollInfo(SB_HORZ, &si, FALSE);
	
	
}

⌨️ 快捷键说明

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