summaryrefslogtreecommitdiff
path: root/include/m_gui.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-13 14:39:35 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-13 14:39:35 +0000
commit2fa4d8fd0f2c29517025dfc3bebc8a5e07c3d380 (patch)
tree2beeddcf0559b1c42c92ea6f32ef771b642285b8 /include/m_gui.h
parentec6783d12fa3d427acabed5460cf343255a77118 (diff)
- nasty crutch removed from Options_AddPage;
- HWND hwndParent removed from the CDlgBase constructor; - method CDlgBase::SetParent() added for the rare occasions where it's needed; git-svn-id: http://svn.miranda-ng.org/main/trunk@12785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_gui.h')
-rw-r--r--include/m_gui.h36
1 files changed, 9 insertions, 27 deletions
diff --git a/include/m_gui.h b/include/m_gui.h
index cf8fc3844f..b71ae87ca2 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -259,7 +259,7 @@ class MIR_CORE_EXPORT CDlgBase
friend class CCtrlData;
public:
- CDlgBase(HINSTANCE hInst, int idDialog, HWND hwndParent);
+ CDlgBase(HINSTANCE hInst, int idDialog);
virtual ~CDlgBase();
// general utilities
@@ -267,29 +267,11 @@ public:
void Show(int nCmdShow = SW_SHOW);
int DoModal();
- __inline HWND GetHwnd() const { return m_hwnd; }
- __inline bool IsInitialized() const { return m_initialized; }
- __inline void Close() { SendMessage(m_hwnd, WM_CLOSE, 0, 0); }
- __inline const MSG *ActiveMessage() const { return &m_msg; }
-
- // dynamic creation support (mainly to avoid leaks in options)
- struct CreateParam
- {
- CDlgBase *(*create)(void *param);
- void *param;
- };
- static INT_PTR CALLBACK DynamicDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (msg == WM_INITDIALOG)
- {
- CreateParam *param = (CreateParam *)lParam;
- CDlgBase *wnd = param->create(param->param);
- SetWindowLongPtr(hwnd, DWLP_DLGPROC, (LONG_PTR)GlobalDlgProc);
- return GlobalDlgProc(hwnd, msg, wParam, (LPARAM)wnd);
- }
-
- return FALSE;
- }
+ __forceinline HWND GetHwnd() const { return m_hwnd; }
+ __forceinline bool IsInitialized() const { return m_initialized; }
+ __forceinline void SetParent(HWND hwnd) { m_hwndParent = hwnd; }
+ __forceinline void Close() { SendMessage(m_hwnd, WM_CLOSE, 0, 0); }
+ __forceinline const MSG *ActiveMessage() const { return &m_msg; }
LRESULT m_lresult;
@@ -1205,7 +1187,7 @@ class MIR_CORE_EXPORT CProtoIntDlgBase : public CDlgBase
typedef CDlgBase CSuper;
public:
- CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog, HWND parent, bool show_label = true);
+ CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog, bool show_label = true);
void CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, DWORD iValue);
void CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szValue);
@@ -1242,8 +1224,8 @@ class CProtoDlgBase : public CProtoIntDlgBase
typedef CProtoIntDlgBase CSuper;
public:
- __inline CProtoDlgBase<TProto>(TProto *proto, int idDialog, HWND parent, bool show_label=true) :
- CProtoIntDlgBase(proto, idDialog, parent, show_label),
+ __inline CProtoDlgBase<TProto>(TProto *proto, int idDialog, bool show_label=true) :
+ CProtoIntDlgBase(proto, idDialog, show_label),
m_proto(proto)
{
}