summaryrefslogtreecommitdiff
path: root/src/core/stduserinfo
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/stduserinfo
parent5fb505e97bca59badf137b524c54629fa51a8d65 (diff)
time to get rid of some DlgProc defined just to handle WM_SIZE issues
Diffstat (limited to 'src/core/stduserinfo')
-rw-r--r--src/core/stduserinfo/src/contactinfo.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp
index 475c0d3de0..a66401ea6d 100644
--- a/src/core/stduserinfo/src/contactinfo.cpp
+++ b/src/core/stduserinfo/src/contactinfo.cpp
@@ -216,11 +216,13 @@ static int IsOverEmail(HWND hwndDlg, wchar_t *szEmail, int cchEmail)
class CContactPage : public CUserInfoPageDlg
{
+ typedef CUserInfoPageDlg CSuper;
+
CCtrlListView m_emails, m_phones;
public:
CContactPage() :
- CUserInfoPageDlg(g_plugin, IDD_INFO_CONTACT),
+ CSuper(g_plugin, IDD_INFO_CONTACT),
m_emails(this, IDC_EMAILS),
m_phones(this, IDC_PHONES)
{
@@ -259,6 +261,21 @@ public:
return true;
}
+ void OnResize() override
+ {
+ CSuper::OnResize();
+
+ RECT rc;
+ GetClientRect(m_emails.GetHwnd(), &rc);
+ rc.right -= GetSystemMetrics(SM_CXVSCROLL);
+
+ m_emails.SetColumnWidth(0, rc.right / 4);
+ m_emails.SetColumnWidth(1, rc.right - rc.right / 4 - 40);
+
+ m_phones.SetColumnWidth(0, rc.right / 4);
+ m_phones.SetColumnWidth(1, rc.right - rc.right / 4 - 90);
+ }
+
int Resizer(UTILRESIZECONTROL *urc) override
{
switch (urc->wId) {
@@ -528,21 +545,7 @@ public:
}
}
- INT_PTR res = CDlgBase::DlgProc(msg, wParam, lParam);
-
- if (msg == WM_SIZE) {
- RECT rc;
- GetClientRect(m_emails.GetHwnd(), &rc);
- rc.right -= GetSystemMetrics(SM_CXVSCROLL);
-
- m_emails.SetColumnWidth(0, rc.right / 4);
- m_emails.SetColumnWidth(1, rc.right - rc.right / 4 - 40);
-
- m_phones.SetColumnWidth(0, rc.right / 4);
- m_phones.SetColumnWidth(1, rc.right - rc.right / 4 - 90);
- }
-
- return res;
+ return CDlgBase::DlgProc(msg, wParam, lParam);
}
};