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

📄 newitemdlg.cpp

📁 一个EVC开发的适用于WINCE平台的高级列表控件。实现了列表项的上下移动。
💻 CPP
字号:
// NewItemDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "NewItemDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CNewItemDlg dialog

CNewItemDlg::CNewItemDlg(int nMaxImage, CWnd* pParent /*=NULL*/)
	: CDialog(CNewItemDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNewItemDlg)
	m_strCaption = _T("New Item");
	m_nImage = 0;
	//}}AFX_DATA_INIT

    ASSERT(nMaxImage >= 0);
    m_nMaxImage = nMaxImage;

    m_bFullScreen = FALSE;
}

void CNewItemDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNewItemDlg)
	DDX_Text(pDX, IDC_CAPTION, m_strCaption);
	DDX_Text(pDX, IDC_IMAGE, m_nImage);
    //}}AFX_DATA_MAP

    DDV_MinMaxInt(pDX, m_nImage, 0, m_nMaxImage);
}

BEGIN_MESSAGE_MAP(CNewItemDlg, CDialog)
	//{{AFX_MSG_MAP(CNewItemDlg)
	ON_WM_CTLCOLOR()
    ON_WM_LBUTTONDOWN()
    ON_NOTIFY_REFLECT(NM_RECOGNIZEGESTURE, OnRecognizeGesture)
	ON_WM_ACTIVATE()
	ON_WM_SETTINGCHANGE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNewItemDlg message handlers

BOOL CNewItemDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

    ASSERT(::IsWindow(::GetDlgItem(m_hWnd, IDC_SPIN1)));
    ((CSpinButtonCtrl*) GetDlgItem(IDC_SPIN1))->SetRange(0, m_nMaxImage);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

HBRUSH CNewItemDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

	// TODO: Change any attributes of the DC here

	// TODO: Return a different brush if the default is not desired

    if (nCtlColor == CTLCOLOR_STATIC)
    {
        pDC->SetBkMode(TRANSPARENT);

        hbr = CreateSolidBrush(::GetSysColor(COLOR_BTNFACE));
    }
    else if (pWnd == this)
    {
        hbr = CreateSolidBrush(::GetSysColor(COLOR_BTNFACE));
    }

	return hbr;
}

void CNewItemDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
	CWnd::OnActivate(nState, pWndOther, bMinimized);
}

void CNewItemDlg::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
	CWnd::OnSettingChange(uFlags, lpszSection);
}

void CNewItemDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
    Default(); // call default message handler
}

void CNewItemDlg::OnRecognizeGesture(NMHDR* pNMHDR, LRESULT* pResult)
{
    *pResult = TRUE; // cancel the red dot animation
}

⌨️ 快捷键说明

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