summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-04-13 14:44:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-04-13 14:44:28 +0300
commit9f61e31b9ccdfe93b693998cab1baa331f87cd97 (patch)
treee48c97d10a90ef4a544bd84ccb5fd6cae6603e4a /src/mir_core
parentb217f24e496c98b4f7af416ca61e67571fb6b2bf (diff)
two new functions: CDlgBase::Resize & Hide
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/CCtrlPages.cpp6
-rw-r--r--src/mir_core/src/CDlgBase.cpp28
-rw-r--r--src/mir_core/src/mir_core.def2
-rw-r--r--src/mir_core/src/mir_core64.def2
4 files changed, 29 insertions, 9 deletions
diff --git a/src/mir_core/src/CCtrlPages.cpp b/src/mir_core/src/CCtrlPages.cpp
index c8ec995b7c..deb6dcd756 100644
--- a/src/mir_core/src/CCtrlPages.cpp
+++ b/src/mir_core/src/CCtrlPages.cpp
@@ -297,7 +297,7 @@ BOOL CCtrlPages::OnNotify(int /*idCtrl*/, NMHDR *pnmh)
case TCN_SELCHANGE:
if (m_pActivePage != nullptr)
- ShowWindow(m_pActivePage->GetHwnd(), SW_HIDE);
+ m_pActivePage->Hide();
if (info = GetCurrPage()) {
m_pActivePage = info->m_pDlg;
@@ -357,9 +357,9 @@ void CCtrlPages::OnApply()
if (GetWindowLongPtr(pshn.hdr.hwndFrom, DWLP_MSGRESULT) == PSNRET_INVALID_NOCHANGEPAGE) {
TabCtrl_SetCurSel(m_hwnd, i);
if (m_pActivePage != nullptr)
- ShowWindow(m_pActivePage->GetHwnd(), SW_HIDE);
+ m_pActivePage->Hide();
m_pActivePage = p->m_pDlg;
- ShowWindow(m_pActivePage->GetHwnd(), SW_SHOW);
+ m_pActivePage->Show();
m_parentWnd->Fail();
return;
}
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp
index f91afa80a3..6921d47de2 100644
--- a/src/mir_core/src/CDlgBase.cpp
+++ b/src/mir_core/src/CDlgBase.cpp
@@ -64,16 +64,17 @@ CDlgBase::~CDlgBase()
DestroyWindow(m_hwnd);
}
-void CDlgBase::Create()
+/////////////////////////////////////////////////////////////////////////////////////////
+// methods
+
+void CDlgBase::Close()
{
- CreateDialogParam(m_hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)this);
+ ::SendMessage(m_hwnd, WM_CLOSE, 0, 0);
}
-void CDlgBase::Show(int nCmdShow)
+void CDlgBase::Create()
{
- if (m_hwnd == nullptr)
- Create();
- ShowWindow(m_hwnd, nCmdShow);
+ CreateDialogParam(m_hInst, MAKEINTRESOURCE(m_idDialog), m_hwndParent, GlobalDlgProc, (LPARAM)this);
}
int CDlgBase::DoModal()
@@ -93,12 +94,27 @@ void CDlgBase::NotifyChange(void)
SendMessage(m_hwndParent, PSM_CHANGED, (WPARAM)m_hwnd, 0);
}
+void CDlgBase::Resize()
+{
+ SendMessage(m_hwnd, WM_SIZE, 0, 0);
+}
+
void CDlgBase::SetCaption(const wchar_t *ptszCaption)
{
if (m_hwnd && ptszCaption)
SetWindowText(m_hwnd, ptszCaption);
}
+void CDlgBase::Show(int nCmdShow)
+{
+ if (m_hwnd == nullptr)
+ Create();
+ ShowWindow(m_hwnd, nCmdShow);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// virtual methods
+
int CDlgBase::Resizer(UTILRESIZECONTROL*)
{
return RD_ANCHORX_LEFT | RD_ANCHORY_TOP;
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index cc09ff681f..ebc69f8d19 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1048,3 +1048,5 @@ CallFunctionSync @1170
?GetRichTextUtf@CCtrlRichEdit@@QBEPADXZ @1235 NONAME
?GetRichTextRtf@CCtrlRichEdit@@QBEPAD_N0@Z @1236 NONAME
?SetReadOnly@CCtrlRichEdit@@QAEX_N@Z @1237 NONAME
+?Hide@CDlgBase@@QAEXXZ @1238 NONAME
+?Resize@CDlgBase@@QAEXXZ @1239 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 6d4473cab5..2e5c83b8af 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1048,3 +1048,5 @@ CallFunctionSync @1170
?GetRichTextUtf@CCtrlRichEdit@@QEBAPEADXZ @1235 NONAME
?GetRichTextRtf@CCtrlRichEdit@@QEBAPEAD_N0@Z @1236 NONAME
?SetReadOnly@CCtrlRichEdit@@QEAAX_N@Z @1237 NONAME
+?Hide@CDlgBase@@QEAAXXZ @1238 NONAME
+?Resize@CDlgBase@@QEAAXXZ @1239 NONAME