?? lcdlg.cpp
字號:
// lcDlg.cpp : implementation file
//
#include "stdafx.h"
#include "lc.h"
#include "lcDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLcDlg dialog
CLcDlg::CLcDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLcDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLcDlg)
m_C1 = 0;
m_D10 = 0;
m_C11 = 0;
m_C13 = 0;
m_D14 = 0;
m_C15 = 0;
m_D16 = 0;
m_C17 = 0;
m_D18 = 0;
m_C19 = 0;
m_D12 = 0;
m_D2 = 0;
m_D20 = 0;
m_C3 = 0;
m_D4 = 0;
m_C5 = 0;
m_D6 = 0;
m_C7 = 0;
m_D8 = 0;
m_C9 = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CLcDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLcDlg)
DDX_Control(pDX, IDC_xlc9, m_xlc9);
DDX_Control(pDX, IDC_xlc8, m_xlc8);
DDX_Control(pDX, IDC_xlc7, m_xlc7);
DDX_Control(pDX, IDC_xlc6, m_xlc6);
DDX_Control(pDX, IDC_xlc5, m_xlc5);
DDX_Control(pDX, IDC_xlc4, m_xlc4);
DDX_Control(pDX, IDC_xlc3, m_xlc3);
DDX_Control(pDX, IDC_xlc2, m_xlc2);
DDX_Control(pDX, IDC_xlc1, m_xlc1);
DDX_Control(pDX, IDC_xlc, m_xlc);
DDX_Control(pDX, IDC_LC, m_lc);
DDX_Control(pDX, IDC_LC6, m_lc6);
DDX_Control(pDX, IDC_LC9, m_lc9);
DDX_Control(pDX, IDC_LC8, m_lc8);
DDX_Control(pDX, IDC_LC7, m_lc7);
DDX_Control(pDX, IDC_LC5, m_lc5);
DDX_Control(pDX, IDC_LC4, m_lc4);
DDX_Control(pDX, IDC_LC3, m_lc3);
DDX_Control(pDX, IDC_LC2, m_lc2);
DDX_Control(pDX, IDC_LC1, m_lc1);
DDX_Text(pDX, IDC_EDIT1, m_C1);
DDX_Text(pDX, IDC_EDIT10, m_D10);
DDX_Text(pDX, IDC_EDIT11, m_C11);
DDX_Text(pDX, IDC_EDIT13, m_C13);
DDX_Text(pDX, IDC_EDIT14, m_D14);
DDX_Text(pDX, IDC_EDIT15, m_C15);
DDX_Text(pDX, IDC_EDIT16, m_D16);
DDX_Text(pDX, IDC_EDIT17, m_C17);
DDX_Text(pDX, IDC_EDIT18, m_D18);
DDX_Text(pDX, IDC_EDIT19, m_C19);
DDX_Text(pDX, IDC_EDIT12, m_D12);
DDX_Text(pDX, IDC_EDIT2, m_D2);
DDX_Text(pDX, IDC_EDIT20, m_D20);
DDX_Text(pDX, IDC_EDIT3, m_C3);
DDX_Text(pDX, IDC_EDIT4, m_D4);
DDX_Text(pDX, IDC_EDIT5, m_C5);
DDX_Text(pDX, IDC_EDIT6, m_D6);
DDX_Text(pDX, IDC_EDIT7, m_C7);
DDX_Text(pDX, IDC_EDIT8, m_D8);
DDX_Text(pDX, IDC_EDIT9, m_C9);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLcDlg, CDialog)
//{{AFX_MSG_MAP(CLcDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLcDlg message handlers
BOOL CLcDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CLcDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CLcDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CLcDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CLcDlg::OnOK()
{
int a ;
// TODO: Add extra validation here
CString temp;
// UpdateData(false);
UpdateData(true);
a=0;
temp.Format("%d mm",a);
m_lc.SetWindowText(temp);
m_xlc.SetWindowText(temp);
a=m_C19-m_D20+m_D18 ;
temp.Format("%d mm",a);
m_lc1.SetWindowText(temp);
m_xlc1.SetWindowText(temp);
a=a+m_C17-m_D18+m_D16 ;
temp.Format("%d mm",a);
m_lc2.SetWindowText(temp);
m_xlc2.SetWindowText(temp);
a=a+m_C15-m_D16+m_D14 ;
temp.Format("%d mm",a);
m_lc3.SetWindowText(temp);
m_xlc3.SetWindowText(temp);
a=a+m_C13-m_D14+m_D12 ;
temp.Format("%d mm",a);
m_lc4.SetWindowText(temp);
m_xlc4.SetWindowText(temp);
a=a+m_C11-m_D12+m_D10 ;
temp.Format("%d mm",a);
m_lc5.SetWindowText(temp);
m_xlc5.SetWindowText(temp);
a=a+m_C9-m_D10+m_D8 ;
temp.Format("%d mm",a);
m_lc6.SetWindowText(temp);
m_xlc6.SetWindowText(temp);
a=a+m_C7-m_D8+m_D6 ;
temp.Format("%d mm",a);
m_lc7.SetWindowText(temp);
m_xlc7.SetWindowText(temp);
a=a+m_C5-m_D6+m_D4 ;
temp.Format("%d mm",a);
m_lc8.SetWindowText(temp);
m_xlc8.SetWindowText(temp);
a=a+m_C3-m_D4+m_D2 ;
temp.Format("%d mm",a);
m_lc9.SetWindowText(temp);
m_xlc9.SetWindowText(temp);
//CQuesDialog.a=m_xs1 ;
// Temp.Format("%d",m_depth2);
// m_Text.SetWindowText(Temp);
// CDialog::OnOK();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -