summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-04 20:41:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-04 20:41:13 +0000
commit6b3ded37e4a4825be2df3612bdcbb7dfc00a1800 (patch)
treed6b6290439e207be3bb28718a2829e298db08342 /plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp
parentd4ed74b1750b5389f22fd67246985ba782d2648b (diff)
HistoryStats sources
git-svn-id: http://svn.miranda-ng.org/main/trunk@8397 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp')
-rw-r--r--plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp b/plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp
new file mode 100644
index 0000000000..4b3caf5885
--- /dev/null
+++ b/plugins/!NotAdopted/HistoryStats/dlgoption_subbase.cpp
@@ -0,0 +1,76 @@
+#include "_globals.h"
+#include "dlgoption.h"
+
+#include "main.h"
+
+/*
+ * DlgOption::SubBase
+ */
+
+BOOL CALLBACK DlgOption::SubBase::staticDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ SubBase* pDlg = reinterpret_cast<SubBase*>(GetWindowLong(hDlg, DWL_USER));
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ pDlg = reinterpret_cast<SubBase*>(lParam);
+ SetWindowLong(hDlg, DWL_USER, reinterpret_cast<LONG>(pDlg));
+ pDlg->m_hWnd = hDlg;
+ pDlg->onWMInitDialog();
+ pDlg->loadSettings();
+ return TRUE;
+
+ case WM_DESTROY:
+ pDlg->onWMDestroy();
+ delete pDlg;
+ SetWindowLong(hDlg, DWL_USER, 0);
+ return TRUE;
+ }
+
+ return pDlg ? pDlg->handleMsg(msg, wParam, lParam) : FALSE;
+}
+
+DlgOption::SubBase::SubBase()
+ : m_pParent(NULL), m_hWnd(NULL)
+{
+}
+
+DlgOption::SubBase::~SubBase()
+{
+}
+
+void DlgOption::SubBase::createWindow(DlgOption* pParent, WORD nDlgResource, const RECT& rect)
+{
+ m_pParent = pParent;
+
+ CreateDialogParam(
+ g_hInst,
+ MAKEINTRESOURCE(nDlgResource),
+ m_pParent->getHWnd(),
+ staticDlgProc,
+ reinterpret_cast<LPARAM>(this));
+
+ MoveWindow(
+ m_hWnd,
+ rect.left,
+ rect.top,
+ rect.right - rect.left,
+ rect.bottom - rect.top, TRUE);
+}
+
+void DlgOption::SubBase::destroyWindow()
+{
+ if (m_hWnd)
+ {
+ DestroyWindow(m_hWnd);
+
+ // exit NOW since we destroyed ourselves
+ return;
+ }
+}
+
+void DlgOption::SubBase::moveWindow(const RECT& rWnd)
+{
+ utils::moveWindow(m_hWnd, rWnd);
+}