📄 dlgsamp6.cpp
字号:
// $Id$
// Objective Grid/MFC Version 0.92 Beta
// (c) Copyright 1995 Stefan Hoenig
// All rights reserved.
static char FileId[] = "$Id$";
// dlgsamp6.cpp : implementation file
//
#include "stdafx.h"
#include "gridapp.h"
#include "dlgsamp6.h"
#ifndef _GXWND_H_
#include "gxwnd.h"
#endif
#ifndef _GXCTRL_H_
#include "gxctrl.h"
#endif
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
class CMyEdit: public CEdit
{
DECLARE_DYNCREATE(CMyEdit);
public:
CMyEdit() { }
};
IMPLEMENT_DYNCREATE(CMyEdit, CEdit);
#define new DEBUG_NEW
/////////////////////////////////////////////////////////////////////////////
// CSample6Dialog
//
// CSample6Dialog is based on the IDD_DLGSAMP6 dialog template.
// I have dragged an user control into the dialog template and
// set the control class to "GXWnd".
//
// In OnInitDialog I call the SubclassDlgItem member funtion
// which subclasses the CWnd control:
// m_wndGrid.SubclassDlgItem(IDC_SPLITTERWND6, this);
//
// After calling SubclassDlgItem, the user control is attached
// to the m_wndGrid member variable. m_wndGrid is an instance
// of the CSample6GridWnd class. OnInitDialog calls the
// Initialize method to initialize the grid.
//
// In DoDataExchange, I have added the line
// DDV_GXGridWnd(pDX, &m_wndGrid);
// which enables control validation in the dialog.
/////////////////////////////////////////////////////////////////////////////
// CSample6Dialog dialog
CSample6Dialog::CSample6Dialog(CWnd* pParent /*=NULL*/)
: CDialog(CSample6Dialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CSample6Dialog)
m_nEdit = 0;
m_nVal2 = 0;
//}}AFX_DATA_INIT
}
void CSample6Dialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSample6Dialog)
DDX_Text(pDX, IDC_EDIT1, m_nEdit);
DDV_MinMaxInt(pDX, m_nEdit, 0, 100);
DDX_Text(pDX, IDC_EDIT2, m_nVal2);
DDV_MinMaxInt(pDX, m_nVal2, 0, 100);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSample6Dialog, CDialog)
//{{AFX_MSG_MAP(CSample6Dialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSample6Dialog message handlers
BOOL CSample6Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
// m_wndSplit.SubclassDlgItem(IDC_SPLITTERWND6, this);
CCreateContext context;
context.m_pNewViewClass = RUNTIME_CLASS(CMyEdit);
m_wndSplit.Create(this, 2, 2, CSize(10,10), &context,
WS_TABSTOP | WS_CHILD | WS_BORDER | WS_VSCROLL | WS_HSCROLL
| SPLS_DYNAMIC_SPLIT);
CRect rect;
GetDlgItem(IDC_SPLITTERRECT6)->GetWindowRect(&rect);
ScreenToClient(&rect);
m_wndSplit.MoveWindow(&rect);
m_wndSplit.ShowWindow(SW_SHOW);
// m_wndGrid.Create(, CRect(25, 25, 315, 195), this, 21000);
/*
m_wndGrid.Initialize();
m_wndGrid.SetRowCount(256);
m_wndGrid.SetColCount(52);
m_wndGrid.SetFocus();*/
return TRUE; // return TRUE unless you set the focus to a control
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -