📄 xba toolsdlg.cpp
字号:
// XBA ToolsDlg.cpp : implementation file
//
#include "stdafx.h"
#include "XBA Tools.h"
#include "XBA ToolsDlg.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()
/////////////////////////////////////////////////////////////////////////////
// CXBAToolsDlg dialog
CXBAToolsDlg::CXBAToolsDlg(CWnd* pParent /*=NULL*/)
: CDialog(CXBAToolsDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CXBAToolsDlg)
m_i01 = 0;
m_i11 = 0;
m_i12 = 0;
m_i13 = 0;
m_i14 = 0;
m_i15 = 0;
m_i16 = 0;
m_i17 = 0;
m_i18 = 0;
m_i19 = 0;
m_i02 = 0;
m_i03 = 0;
m_i04 = 0;
m_i05 = 0;
m_i06 = 0;
m_i07 = 0;
m_i08 = 0;
m_i09 = 0;
m_c01 = _T("COLOR01");
m_c02 = _T("COLOR01");
m_c03 = _T("COLOR01");
m_c05 = _T("COLOR01");
m_c04 = _T("COLOR01");
m_c06 = _T("COLOR01");
m_c07 = _T("COLOR01");
m_c08 = _T("COLOR01");
m_c09 = _T("COLOR01");
m_i21 = 0;
m_i22 = 0;
m_i23 = 0;
m_i24 = 0;
m_i25 = 0;
m_i26 = 0;
m_i27 = 0;
m_i28 = 0;
m_i29 = 0;
m_iMax = 0;
m_iMin = 0;
m_iCurr = 0;
m_ChkSave = FALSE;
m_TeamNo = _T("");
m_PlayerNo = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CXBAToolsDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CXBAToolsDlg)
DDX_Text(pDX, IDC_EDIT1, m_i01);
DDX_Text(pDX, IDC_EDIT2, m_i02);
DDX_Text(pDX, IDC_EDIT3, m_i03);
DDX_Text(pDX, IDC_EDIT4, m_i04);
DDX_Text(pDX, IDC_EDIT5, m_i05);
DDX_Text(pDX, IDC_EDIT6, m_i06);
DDX_Text(pDX, IDC_EDIT7, m_i07);
DDX_Text(pDX, IDC_EDIT8, m_i08);
DDX_Text(pDX, IDC_EDIT9, m_i09);
DDX_Text(pDX, IDC_EDIT11, m_i11);
DDX_Text(pDX, IDC_EDIT12, m_i12);
DDX_Text(pDX, IDC_EDIT13, m_i13);
DDX_Text(pDX, IDC_EDIT14, m_i14);
DDX_Text(pDX, IDC_EDIT15, m_i15);
DDX_Text(pDX, IDC_EDIT16, m_i16);
DDX_Text(pDX, IDC_EDIT17, m_i17);
DDX_Text(pDX, IDC_EDIT18, m_i18);
DDX_Text(pDX, IDC_EDIT19, m_i19);
DDX_Text(pDX, IDC_EDIT21, m_i21);
DDX_Text(pDX, IDC_EDIT22, m_i22);
DDX_Text(pDX, IDC_EDIT23, m_i23);
DDX_Text(pDX, IDC_EDIT24, m_i24);
DDX_Text(pDX, IDC_EDIT25, m_i25);
DDX_Text(pDX, IDC_EDIT26, m_i26);
DDX_Text(pDX, IDC_EDIT27, m_i27);
DDX_Text(pDX, IDC_EDIT28, m_i28);
DDX_Text(pDX, IDC_EDIT29, m_i29);
DDX_Control(pDX, IDC_COMBO9, m_com9);
DDX_Control(pDX, IDC_COMBO8, m_com8);
DDX_Control(pDX, IDC_COMBO7, m_com7);
DDX_Control(pDX, IDC_COMBO6, m_com6);
DDX_Control(pDX, IDC_COMBO5, m_com5);
DDX_Control(pDX, IDC_COMBO4, m_com4);
DDX_Control(pDX, IDC_COMBO3, m_com3);
DDX_Control(pDX, IDC_COMBO2, m_com2);
DDX_Control(pDX, IDC_COMBO1, m_com1);
DDX_CBString(pDX, IDC_COMBO1, m_c01);
DDX_CBString(pDX, IDC_COMBO2, m_c02);
DDX_CBString(pDX, IDC_COMBO3, m_c03);
DDX_CBString(pDX, IDC_COMBO5, m_c05);
DDX_CBString(pDX, IDC_COMBO4, m_c04);
DDX_CBString(pDX, IDC_COMBO6, m_c06);
DDX_CBString(pDX, IDC_COMBO7, m_c07);
DDX_CBString(pDX, IDC_COMBO8, m_c08);
DDX_CBString(pDX, IDC_COMBO9, m_c09);
DDX_Text(pDX, IDC_EDIT_MAX, m_iMax);
DDV_MinMaxInt(pDX, m_iMax, 0, 99);
DDX_Text(pDX, IDC_EDIT_MIN, m_iMin);
DDV_MinMaxInt(pDX, m_iMin, 0, 99);
DDX_Text(pDX, IDC_Curr, m_iCurr);
DDX_Check(pDX, IDC_CHECK_SAVE, m_ChkSave);
DDX_Text(pDX, IDC_TeamNo, m_TeamNo);
DDV_MaxChars(pDX, m_TeamNo, 10);
DDX_Text(pDX, IDC_PlayerNo, m_PlayerNo);
DDV_MaxChars(pDX, m_PlayerNo, 3);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CXBAToolsDlg, CDialog)
//{{AFX_MSG_MAP(CXBAToolsDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_ABOUT, OnAbout)
ON_BN_CLICKED(IDC_CHECK_SAVE, OnCheckSave)
ON_BN_CLICKED(IDC_bSave, OnbSave)
ON_BN_CLICKED(IDC_bLoad, OnbLoad)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CXBAToolsDlg message handlers
BOOL CXBAToolsDlg::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 CXBAToolsDlg::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 CXBAToolsDlg::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 CXBAToolsDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CXBAToolsDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(true);
CString strData;
//int iColor;
if (m_c01=="COLOR01"){ m_i11=m_i01+40;m_i21=m_i01+55;}
if (m_c01=="COLOR02"){ m_i11=m_i01+32;m_i21=m_i01+39;}
if (m_c01=="COLOR03"){ m_i11=m_i01+25;m_i21=m_i01+31;}
if (m_c01=="COLOR04"){ m_i11=m_i01+19;m_i21=m_i01+24;}
if (m_c01=="COLOR05"){ m_i11=m_i01+14;m_i21=m_i01+18;}
if (m_c01=="COLOR06"){ m_i11=m_i01+10;m_i21=m_i01+13;}
if (m_c01=="COLOR07"){ m_i11=m_i01+7;m_i21=m_i01+9;}
if (m_c01=="COLOR08"){ m_i11=m_i01+4;m_i21=m_i01+6;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -