📄 groupproperty.cpp
字号:
// GroupProperty.cpp : implementation file
//
#include "stdafx.h"
#include "PStart.h"
#include "GroupProperty.h"
#include "PStartDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGroupProperty dialog
struct fp_info
{
CString name;
CString path;
};
CGroupProperty::CGroupProperty(CWnd* pParent /*=NULL*/)
: CDialog(CGroupProperty::IDD, pParent)
{
//{{AFX_DATA_INIT(CGroupProperty)
m_name = _T("");
m_path = _T("");
//}}AFX_DATA_INIT
}
void CGroupProperty::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGroupProperty)
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Text(pDX, IDC_EDITNAME, m_name);
DDX_Text(pDX, IDC_EDITPATCH, m_path);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGroupProperty, CDialog)
//{{AFX_MSG_MAP(CGroupProperty)
ON_BN_CLICKED(IDC_OK, OnOk)
ON_EN_CHANGE(IDC_EDITNAME, OnChangeEditname)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGroupProperty message handlers
BOOL CGroupProperty::OnInitDialog()
{
CDialog::OnInitDialog();
m_ok.EnableWindow(FALSE);//
return TRUE;
}
void CGroupProperty::OnChangeEditname()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if(!m_name.IsEmpty())
m_ok.EnableWindow(TRUE);
else
m_ok.EnableWindow(FALSE);
}
void CGroupProperty::OnBrowse()
{
// TODO: Add your control notification handler code here
CFileDialog FileDlg(TRUE, NULL, NULL, OFN_FILEMUSTEXIST, _T("Icon files(*.exe;*.ico;*.scr)|*.exe;*.ico;*.scr"), NULL);
if(FileDlg.DoModal()==IDOK)
{
m_path=FileDlg.GetPathName();
UpdateData(FALSE);
}
}
void CGroupProperty::OnOk()
{
// TODO: Add your control notification handler code here
CPStartDlg *pmaindlg;
fp_info fp;
fp.name=m_name;
fp.path=m_path;
pmaindlg=(CPStartDlg*)AfxGetApp()->m_pMainWnd;
if(pmaindlg)
pmaindlg->SendMessage(WM_GROUPPROPERTY, 0, (LPARAM)&fp);
this->SendMessage(WM_CLOSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -