summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-06-20 14:58:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-06-20 14:58:04 +0300
commitb52aae1e9c6355d1725e000dcf8824fc2fe40383 (patch)
treebbc1ef23af3de05a59038145e1b36db6ca8cf2b4 /src/core/stdmsg
parent5fb505e97bca59badf137b524c54629fa51a8d65 (diff)
time to get rid of some DlgProc defined just to handle WM_SIZE issues
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/stdafx.h1
-rw-r--r--src/core/stdmsg/src/tabs.cpp27
2 files changed, 17 insertions, 11 deletions
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index ef484f4f68..6dd1a92181 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -117,6 +117,7 @@ public:
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
int Resizer(UTILRESIZECONTROL *urc) override;
+ void OnResize() override;
};
extern CTabbedWindow *g_pTabDialog;
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index ad11e2afa9..61c2426641 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -188,6 +188,21 @@ void CTabbedWindow::OnDestroy()
g_pTabDialog = nullptr;
}
+void CTabbedWindow::OnResize()
+{
+ CDlgBase::OnResize();
+
+ SendMessage(m_hwndStatus, WM_SIZE, 0, 0);
+
+ if (m_pEmbed) {
+ RECT rc;
+ GetClientRect(m_tab.GetHwnd(), &rc);
+ MoveWindow(m_pEmbed->GetHwnd(), 0, 0, rc.right - rc.left, rc.bottom - rc.top, FALSE);
+ }
+
+ SaveWindowPosition(false);
+}
+
int CTabbedWindow::Resizer(UTILRESIZECONTROL *urc)
{
if (urc->wId == IDC_TAB) {
@@ -639,17 +654,7 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
break;
}
- LRESULT res = CDlgBase::DlgProc(msg, wParam, lParam);
- if (msg == WM_SIZE) {
- SendMessage(m_hwndStatus, WM_SIZE, 0, 0);
- if (m_pEmbed) {
- GetClientRect(m_tab.GetHwnd(), &rc);
- MoveWindow(m_pEmbed->GetHwnd(), 0, 0, rc.right - rc.left, rc.bottom - rc.top, FALSE);
- }
- SaveWindowPosition(false);
- }
-
- return res;
+ return CDlgBase::DlgProc(msg, wParam, lParam);
}
/////////////////////////////////////////////////////////////////////////////////////////