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

📄 sheetctrl.cpp

📁 机器人处理中使用USB摄像机的例子程序.
💻 CPP
字号:
// SheetCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "USBCam.h"
#include "SheetCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSheetCtrl

IMPLEMENT_DYNAMIC(CSheetCtrl, CPropertySheet)

CSheetCtrl::CSheetCtrl(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}

CSheetCtrl::CSheetCtrl(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	AddPage (&PageCam);	
	m_FileSaved = FALSE;
}

CSheetCtrl::~CSheetCtrl()
{
}


BEGIN_MESSAGE_MAP(CSheetCtrl, CPropertySheet)
	//{{AFX_MSG_MAP(CSheetCtrl)
	ON_WM_SHOWWINDOW()
	ON_WM_CREATE()
	ON_WM_QUERYDRAGICON()
	ON_COMMAND(ID_APP_EXIT, OnAppExit)
	ON_WM_ENDSESSION()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSheetCtrl message handlers

void CSheetCtrl::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CWnd		*	pButton			= NULL;
	CRect			ButtonRect_1(0,0,0,0);
	CRect			WndRect(0,0,0,0);
	
	// get size of display
	this->GetClientRect(&WndRect);
	// move button
	pButton = GetDlgItem( IDOK );
	pButton->SetWindowText ("Exit");
	pButton->GetWindowRect(&ButtonRect_1);
	ButtonRect_1.left		= WndRect.right	- ButtonRect_1.Width();
	ButtonRect_1.right		= WndRect.right;
	ButtonRect_1.top		= WndRect.bottom - ButtonRect_1.Height();
	ButtonRect_1.bottom		= WndRect.bottom;
	pButton->MoveWindow(ButtonRect_1);

	
	GetDlgItem(ID_APPLY_NOW)->ShowWindow( SW_HIDE );
	GetDlgItem(IDCANCEL	   )->ShowWindow( SW_HIDE );
	//HWND hWnd = (HWND)this;             
	//::SetWindowPos(hWnd,  HWND_TOP, 0, 0, 200, 200, SWP_NOOWNERZORDER );
	//this->MoveWindow( 0, 0, 599, 400,TRUE );
	//DWORD style = this->GetStyle();
	

	CPropertySheet::OnShowWindow(bShow, nStatus);
}

int CSheetCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	this->ModifyStyle(0, WS_MINIMIZEBOX, SWP_NOSIZE );
	SetIcon(m_hIcon, TRUE);         // Set big icon
	SetIcon(m_hIcon, FALSE);        // Set small icon
	CFileFind fFind;

	CString str;
	fFind.FindFile (NULL,0);
	//PictDir = fFind.GetRoot() + PICTURE_DIR;

	return 0;
}

HCURSOR CSheetCtrl::OnQueryDragIcon() 
{
	return (HCURSOR) m_hIcon;	
	//return CPropertySheet::OnQueryDragIcon();
}


/*BOOL CSheetCtrl::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	DEBUG_INT (wParam);
	DEBUG_INT (IDOK);
	m_FileSaved = FALSE;
	if (!m_FileSaved)
	{
			AfxMessageBox ("");
			wParam = 0;
			lParam = 0;
			return CPropertySheet::OnCommand(wParam, lParam);
	}
	return CPropertySheet::OnCommand(wParam, lParam);
}

void CSheetCtrl::OnClose() 
{

	CPropertySheet::OnClose();
}*/

void CSheetCtrl::OnAppExit() 
{
		DEBUG_INT (33);	
}

void CSheetCtrl::OnEndSession(BOOL bEnding) 
{
	CPropertySheet::OnEndSession(bEnding);
	
	DEBUG_INT (44);	
}

⌨️ 快捷键说明

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