summaryrefslogtreecommitdiff
path: root/protocols/JabberG
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 /protocols/JabberG
parent5fb505e97bca59badf137b524c54629fa51a8d65 (diff)
time to get rid of some DlgProc defined just to handle WM_SIZE issues
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp13
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp10
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp16
3 files changed, 15 insertions, 24 deletions
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index 86fc5ab511..72deebab0f 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -225,16 +225,13 @@ public:
m_proto->GetMucDlg(m_info->type) = nullptr;
}
- INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override
+ void OnResize() override
{
- INT_PTR ret = CSuper::DlgProc(uMsg, wParam, lParam);
- if (uMsg == WM_SIZE) {
- RECT rc;
- GetClientRect(m_list.GetHeader(), &rc);
- m_list.SetColumnWidth(0, rc.right - rc.left);
- }
+ CSuper::OnResize();
- return ret;
+ RECT rc;
+ GetClientRect(m_list.GetHeader(), &rc);
+ m_list.SetColumnWidth(0, rc.right - rc.left);
}
int Resizer(UTILRESIZECONTROL *urc) override
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 49ca3d8010..5986fc701e 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -239,8 +239,8 @@ class CCtrlNotebookList : public CCtrlListBox
HFONT m_hfntNormal, m_hfntSmall, m_hfntBold;
public:
- CCtrlNotebookList(CDlgBase* dlg, int ctrlId)
- : CCtrlListBox(dlg, ctrlId),
+ CCtrlNotebookList(CDlgBase* dlg, int ctrlId) :
+ CCtrlListBox(dlg, ctrlId),
m_adding(false)
{
m_hfntNormal = m_hfntSmall = m_hfntBold = nullptr;
@@ -266,7 +266,8 @@ public:
mis.itemID = idx;
mis.itemData = data;
OnMeasureItem(&mis);
- if (mis.itemHeight) SendMessage(m_hwnd, LB_SETITEMHEIGHT, idx, mis.itemHeight);
+ if (mis.itemHeight)
+ SendMessage(m_hwnd, LB_SETITEMHEIGHT, idx, mis.itemHeight);
return idx;
}
@@ -288,7 +289,8 @@ public:
mis.itemID = idx;
mis.itemData = GetItemData(idx);
OnMeasureItem(&mis);
- if (mis.itemHeight) SendMessage(m_hwnd, LB_SETITEMHEIGHT, idx, mis.itemHeight);
+ if (mis.itemHeight)
+ SendMessage(m_hwnd, LB_SETITEMHEIGHT, idx, mis.itemHeight);
}
SendMessage(m_hwnd, WM_SETREDRAW, TRUE, 0);
RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index d7ebc6af0e..cf07268ba8 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -79,7 +79,6 @@ class JabberUserInfoDlg : public CUserInfoPageDlg
UI_MESSAGE_MAP(JabberUserInfoDlg, CUserInfoPageDlg);
UI_MESSAGE(WM_PROTO_CHECK_ONLINE, OnCheckOnline);
- UI_MESSAGE(WM_SIZE, OnSize);
UI_MESSAGE_MAP_END();
INT_PTR OnCheckOnline(UINT, WPARAM, LPARAM)
@@ -91,12 +90,6 @@ class JabberUserInfoDlg : public CUserInfoPageDlg
return 0;
}
- INT_PTR OnSize(UINT, WPARAM, LPARAM lParam)
- {
- MoveWindow(GetDlgItem(m_hwnd, IDC_TV_INFO), 5, 5, LOWORD(lParam) - 10, HIWORD(lParam) - 10, TRUE);
- return 0;
- }
-
////////////////////////////////////////////////////////////////////////////////////////
// User information block
@@ -400,11 +393,11 @@ public:
RECT rc;
GetClientRect(m_hwnd, &rc);
- MoveWindow(GetDlgItem(m_hwnd, IDC_TV_INFO), 5, 5, rc.right - 10, rc.bottom - 10, TRUE);
+ MoveWindow(m_tree.GetHwnd(), 5, 5, rc.right - 10, rc.bottom - 10, TRUE);
HIMAGELIST himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1);
ImageList_AddSkinIcon(himl, SKINICON_OTHER_SMALLDOT);
- TreeView_SetImageList(GetDlgItem(m_hwnd, IDC_TV_INFO), himl, TVSIL_NORMAL);
+ TreeView_SetImageList(m_tree.GetHwnd(), himl, TVSIL_NORMAL);
WindowList_Add(hUserInfoList, m_hwnd, m_hContact);
return true;
@@ -414,7 +407,7 @@ public:
{
ppro->WindowUnsubscribe(m_hwnd);
WindowList_Remove(hUserInfoList, m_hwnd);
- ImageList_Destroy(TreeView_SetImageList(GetDlgItem(m_hwnd, IDC_TV_INFO), nullptr, TVSIL_NORMAL));
+ ImageList_Destroy(m_tree.SetImageList(nullptr, TVSIL_NORMAL));
Window_FreeIcon_IcoLib(m_hwnd);
}
@@ -435,8 +428,7 @@ public:
item = ppro->ListGetItemPtr(LIST_ROSTER, jid);
if (item == nullptr) {
- HWND hwndTree = GetDlgItem(m_hwnd, IDC_TV_INFO);
- TreeView_DeleteAllItems(hwndTree);
+ m_tree.DeleteAllItems();
HTREEITEM htiRoot = FillInfoLine(nullptr, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true);
FillInfoLine(htiRoot, g_plugin.getIcon(IDI_VCARD), nullptr, TranslateU("Please switch online to see more details."));
return false;