From 65cd7e169459a539122219425006cda70c28761d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Mar 2017 23:51:43 +0300 Subject: StdMsg: applying standard resizer --- src/core/stdmsg/src/chat_window.cpp | 12 ++++++------ src/core/stdmsg/src/stdafx.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core') diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 9d2da4c440..553328c02f 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -33,10 +33,9 @@ struct MESSAGESUBDATA static wchar_t szTrimString[] = L":;,.!?\'\"><()[]- \r\n"; -int CChatRoomDlg::RoomWndResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc) +int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc) { - CChatRoomDlg *dat = (CChatRoomDlg*)lParam; - SESSION_INFO *si = dat->m_si; + SESSION_INFO *si = m_si; RECT rc; BOOL bControl = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowTopButtons", 1); @@ -47,7 +46,7 @@ int CChatRoomDlg::RoomWndResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc) switch (urc->wId) { case IDOK: - GetWindowRect(dat->m_hwndStatus, &rc); + GetWindowRect(m_hwndStatus, &rc); urc->rcItem.left = bSend ? 315 : urc->dlgNewSize.cx; urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY + 23; urc->rcItem.bottom = urc->dlgNewSize.cy - (rc.bottom - rc.top) - 1; @@ -83,7 +82,7 @@ LBL_CalcBottom: return RD_ANCHORX_WIDTH | RD_ANCHORY_CUSTOM; case IDC_MESSAGE: - GetWindowRect(dat->m_hwndStatus, &rc); + GetWindowRect(m_hwndStatus, &rc); urc->rcItem.right = bSend ? urc->dlgNewSize.cx - 64 : urc->dlgNewSize.cx; urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY + 22; urc->rcItem.bottom = urc->dlgNewSize.cy - (rc.bottom - rc.top) - 1; @@ -855,6 +854,7 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) : m_hContact = si->hContact; m_autoClose = 0; + m_forceResizable = true; m_btnBold.OnClick = Callback(this, &CChatRoomDlg::OnClick_Bold); m_btnItalic.OnClick = Callback(this, &CChatRoomDlg::OnClick_Bold); @@ -1355,7 +1355,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) EnableWindow(m_btnChannelMgr.GetHwnd(), pci->MM_FindModule(m_si->pszModule)->bChanMgr); } - Utils_ResizeDialog(m_hwnd, g_hInst, MAKEINTRESOURCEA(IDD_CHANNEL), RoomWndResize, (LPARAM)this); + CSrmmBaseDialog::DlgProc(uMsg, wParam, lParam); // call built-in resizer SetButtonsPos(m_hwnd, true); InvalidateRect(m_hwndStatus, NULL, TRUE); diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 236b5761db..5248b2a200 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -174,7 +174,6 @@ class CChatRoomDlg : public CSrmmBaseDialog { friend struct CTabbedWindow; - static int RoomWndResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc); HWND m_hwndStatus; SESSION_INFO *m_si; @@ -200,6 +199,7 @@ public: virtual void OnDestroy() override; virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; + virtual int Resizer(UTILRESIZECONTROL *urc) override; void OnClick_Bold(CCtrlButton*); void OnClick_Color(CCtrlButton*); -- cgit v1.2.3