📄 modelessdlg.h
字号:
#ifndef _MODELESS_DLG_H
#define _MODELESS_DLG_H
// T: 一般是CDialog
// U: 派生类
template<class T, class U>
class modelessdlg: public T
{
public:
typedef modelessdlg<T,U> baseclass;
modelessdlg(UINT idd, CWnd* parent = NULL): T(idd, parent){}
void init(CWnd* parent=NULL)
{
Create(U::IDD, parent) ;
}
virtual void show(CWnd* parent = NULL)
{
if (!IsWindow(m_hWnd))
init(parent) ;
if (::IsWindowVisible(m_hWnd))
return ;
CenterWindow() ;
ShowWindow(SW_SHOW) ;
UpdateWindow() ;
}
virtual void hide()
{
DestroyWindow() ;
}
protected:
virtual int DoModal(){return -1;}
virtual void OnOK(){}
virtual void OnCancel(){}
};
#endif // _MODELESS_DLG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -