diff options
-rw-r--r-- | include/m_gui.h | 8 | ||||
-rw-r--r-- | libs/win32/mir_core.lib | bin | 316862 -> 317344 bytes | |||
-rw-r--r-- | libs/win64/mir_core.lib | bin | 317840 -> 318334 bytes | |||
-rw-r--r-- | plugins/Scriver/src/chat_window.cpp | 6 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 24 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/netlibopts.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/options.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/CCtrlPages.cpp | 6 | ||||
-rw-r--r-- | src/mir_core/src/CDlgBase.cpp | 28 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 2 |
18 files changed, 78 insertions, 56 deletions
diff --git a/include/m_gui.h b/include/m_gui.h index 36e3e0289f..7a48523938 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -382,6 +382,8 @@ public: virtual ~CDlgBase();
// general utilities
+ void Close();
+ void Resize();
void Create();
void Show(int nCmdShow = SW_SHOW);
int DoModal();
@@ -390,13 +392,13 @@ public: void SetCaption(const wchar_t *ptszCaption);
void NotifyChange(void); // sends a notification to a parent window
+ __forceinline void Fail() { m_lresult = false; }
__forceinline HINSTANCE GetInst() const { return m_hInst; }
__forceinline HWND GetHwnd() const { return m_hwnd; }
+ __forceinline void Hide() { Show(SW_HIDE); }
__forceinline bool IsInitialized() const { return m_initialized; }
__forceinline void SetParent(HWND hwnd) { m_hwndParent = hwnd; }
- __forceinline void Close() { SendMessage(m_hwnd, WM_CLOSE, 0, 0); }
- __forceinline void Fail() { m_lresult = false; }
-
+
__forceinline CCtrlBase* operator[](int iControlId) { return FindControl(iControlId); }
static CDlgBase* Find(HWND hwnd);
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex b7c8a48d49..51de6bdc37 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex 5669d1285b..d31e50a364 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index e8536333e9..107c87db54 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -353,7 +353,7 @@ void CChatRoomDlg::onClick_ShowList(CCtrlButton *pButton) m_bNicklistEnabled = !m_bNicklistEnabled;
pButton->SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)GetCachedIcon(m_bNicklistEnabled ? "chat_nicklist" : "chat_nicklist2"));
ScrollToBottom();
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton)
@@ -512,7 +512,7 @@ void CChatRoomDlg::UpdateOptions() InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
}
m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
RedrawLog2();
}
@@ -903,7 +903,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) switch (uMsg) {
case DM_SWITCHINFOBAR:
case DM_SWITCHTOOLBAR:
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
break;
case WM_SIZE:
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 18e8100153..9fd00e3ed0 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -702,7 +702,7 @@ void CSrmmWindow::SetDialogToType() UpdateReadChars();
EnableWindow(GetDlgItem(m_hwnd, IDOK), m_message.GetRichTextLength() != 0);
SendMessage(m_hwnd, DM_CLISTSETTINGSCHANGED, 0, 0);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
void CSrmmWindow::SetStatusIcon()
@@ -730,7 +730,7 @@ void CSrmmWindow::ShowAvatar() INT_PTR res = CallService(MS_AV_GETAVATARBITMAP, m_hContact, 0);
m_ace = res != CALLSERVICE_NOTFOUND ? (AVATARCACHEENTRY*)res : nullptr;
m_hbmpAvatarPic = (m_ace != nullptr && (m_ace->dwFlags & AVS_HIDEONCLIST) == 0) ? m_ace->hbmPic : nullptr;
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
RefreshInfobar();
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index bde388d85f..e8452307cb 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -702,7 +702,7 @@ void CChatRoomDlg::onClick_ShowNickList(CCtrlButton *pButton) m_bNicklistEnabled = !m_bNicklistEnabled; - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); if (CSkin::m_skinEnabled) InvalidateRect(m_hwnd, nullptr, TRUE); ScrollToBottom(); @@ -871,7 +871,7 @@ void CChatRoomDlg::UpdateOptions() InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE); m_btnFilter.SendMsg(BUTTONSETOVERLAYICON, (LPARAM)(m_bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); RedrawLog2(); } @@ -1891,7 +1891,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (iSplitterX > rc.right - rc.left - 35) iSplitterX = rc.right - rc.left - 35; m_pContainer->settings->iSplitterX = iSplitterX; - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); } else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERY) || lParam == -1) { GetClientRect(m_hwnd, &rc); @@ -1906,7 +1906,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) m_iSplitterY = rc.bottom - rc.top - DPISCALEY_S(40); m_pContainer->settings->iSplitterY = m_iSplitterY; UpdateToolbarBG(); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); } else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_PANELSPLITTER)) { pt.x = 0, pt.y = wParam; @@ -2337,7 +2337,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (m_dwFlags & MWF_WASBACKGROUNDCREATE) { m_dwFlags &= ~MWF_WASBACKGROUNDCREATE; - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); pt.x = pt.y = 0; m_log.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&pt); @@ -2349,7 +2349,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } else { - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); if (lParam == 0) DM_ScrollToBottom(1, 1); } @@ -2372,7 +2372,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; case DM_CONFIGURETOOLBAR: - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); break; case DM_SMILEYOPTIONSCHANGED: diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index c2fe808c83..96c17b3607 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -278,7 +278,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar LoadSplitter(); AdjustBottomAvatarDisplay(); DM_RecalcPictureSize(); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); break; case ID_MODE_PRIVATE: @@ -287,7 +287,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar LoadSplitter(); AdjustBottomAvatarDisplay(); DM_RecalcPictureSize(); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); break; case ID_GLOBAL_BBCODE: @@ -421,7 +421,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar RedrawWindow(m_hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN); } SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); DM_ScrollToBottom(1, 1); Utils::showDlgControl(m_hwnd, IDC_MULTISPLITTER, (m_sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE); Utils::showDlgControl(m_hwnd, IDC_CLIST, (m_sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE); @@ -460,7 +460,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar if (!m_bIsAutosizingInput) { m_iSplitterY = m_iSplitterSaved; - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); DM_ScrollToBottom(0, 1); } } @@ -762,7 +762,7 @@ void CTabBaseDlg::DM_RecalcPictureSize() BITMAP bminfo; GetObject(hbm, sizeof(bminfo), &bminfo); CalcDynamicAvatarSize(&bminfo); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); } else m_pic.cy = m_pic.cx = 60; } @@ -1174,7 +1174,7 @@ int CTabBaseDlg::DM_SplitterGlobalEvent(WPARAM wParam, LPARAM lParam) LoadSplitter(); AdjustBottomAvatarDisplay(); DM_RecalcPictureSize(); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); DM_ScrollToBottom(1, 1); if (this != srcDat) UpdateToolbarBG(); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index e0c77fe6c1..ec495316bc 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -152,7 +152,7 @@ void CTabBaseDlg::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt) PluginConfig.m_visualMessageSizeIndicator = !PluginConfig.m_visualMessageSizeIndicator;
db_set_b(0, SRMSGMOD_T, "msgsizebar", (BYTE)PluginConfig.m_visualMessageSizeIndicator);
Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 0);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
if (m_pContainer->hwndStatus)
RedrawWindow(m_pContainer->hwndStatus, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
break;
@@ -410,7 +410,7 @@ void CTabBaseDlg::SetDialogToType() EnableSendButton(GetWindowTextLength(m_message.GetHwnd()) != 0);
UpdateTitle();
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
Utils::enableDlgControl(m_hwnd, IDC_CONTACTPIC, false);
@@ -1180,7 +1180,7 @@ void CSrmmWindow::onClick_Add(CCtrlButton*) ShowMultipleControls(m_hwnd, addControls, _countof(addControls), SW_HIDE);
if (!(m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
Utils::showDlgControl(m_hwnd, IDC_LOGFROZENTEXT, SW_HIDE);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
}
@@ -1278,7 +1278,7 @@ void CSrmmWindow::onClick_CancelAdd(CCtrlButton*) ShowMultipleControls(m_hwnd, addControls, _countof(addControls), SW_HIDE);
if (!(m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
Utils::showDlgControl(m_hwnd, IDC_LOGFROZENTEXT, SW_HIDE);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
void CSrmmWindow::onChange_Message(CCtrlEdit*)
@@ -1589,7 +1589,7 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter) HWND hwndEdit = m_message.GetHwnd();
SetWindowPos(hwndEdit, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
RedrawWindow(hwndEdit, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW | RDW_ERASE);
DM_ScrollToBottom(0, 0);
Utils::showDlgControl(m_hwnd, IDC_MULTISPLITTER, (m_sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE);
@@ -1689,7 +1689,7 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter) SetDlgItemText(m_hwnd, IDC_LOGFROZENTEXT, TranslateT("Contact not on list. You may add it..."));
else
SetDlgItemText(m_hwnd, IDC_LOGFROZENTEXT, TranslateT("Auto scrolling is disabled (press F12 to enable it)"));
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
DM_ScrollToBottom(1, 1);
return _dlgReturn(m_hwnd, 1);
}
@@ -2450,7 +2450,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (lParam == 1) {
DM_RecalcPictureSize();
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
DM_ScrollToBottom(0, 1);
}
return 0;
@@ -2493,7 +2493,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case DM_UPDATEPICLAYOUT:
LoadContactAvatar();
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
return 0;
case DM_SPLITTERMOVED:
@@ -2509,7 +2509,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (m_iMultiSplit > ((rc.right - rc.left) - 80))
m_iMultiSplit = oldSplitterX;
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERY)) {
GetClientRect(m_hwnd, &rc);
@@ -2544,7 +2544,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DM_RecalcPictureSize();
}
UpdateToolbarBG();
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_PANELSPLITTER)) {
GetClientRect(m_log.GetHwnd(), &rc);
@@ -2698,7 +2698,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) MoveWindow(m_hwnd, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), TRUE);
if (m_dwFlags & MWF_WASBACKGROUNDCREATE) {
m_dwFlags &= ~MWF_WASBACKGROUNDCREATE;
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
PostMessage(m_hwnd, DM_UPDATEPICLAYOUT, 0, 0);
if (PluginConfig.m_bAutoLocaleSupport) {
if (m_hkl == 0)
@@ -2712,7 +2712,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) m_pContainer->SideBar->Layout();
}
else {
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
if (lParam == 0)
DM_ScrollToBottom(0, 1);
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 3901453004..a3f47459f5 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -347,7 +347,7 @@ int CTabBaseDlg::MsgWindowMenuHandler(int selection, int menuId) }
ShowPicture(false);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
DM_ScrollToBottom(0, 1);
return 1;
@@ -735,7 +735,7 @@ void CTabBaseDlg::ShowPicture(bool showNewPic) if (!m_hwndPanelPic) {
InvalidateRect(m_hwnd, nullptr, TRUE);
UpdateWindow(m_hwnd);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
return;
}
@@ -753,7 +753,7 @@ void CTabBaseDlg::ShowPicture(bool showNewPic) if (!showNewPic)
SetDialogToType();
else
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
void CTabBaseDlg::FlashOnClist(MEVENT hEvent, DBEVENTINFO *dbei)
@@ -1304,7 +1304,7 @@ void CSrmmWindow::LoadOwnAvatar() AdjustBottomAvatarDisplay();
GetObject(m_hOwnPic, sizeof(bm), &bm);
CalcDynamicAvatarSize(&bm);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index e01de1548e..e126a4b289 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -147,7 +147,7 @@ INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) m_pPanel.setHeight((LONG)lParam);
}
}
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
return 0;
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index d9114da0ae..0d5ae4e629 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -112,7 +112,7 @@ void CChatRoomDlg::onClick_NickList(CCtrlButton *pButton) pButton->SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_bNicklistEnabled ? "nicklist" : "nicklist2", FALSE)); ScrollToBottom(); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); } void CChatRoomDlg::onClick_Ok(CCtrlButton *pButton) @@ -321,7 +321,7 @@ void CChatRoomDlg::UpdateOptions() m_nickList.SendMsg(LB_SETITEMHEIGHT, 0, height > font ? height : font); InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE); - SendMessage(m_hwnd, WM_SIZE, 0, 0); + Resize(); RedrawLog2(); } diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index a39c109175..c3ed9caeee 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -387,7 +387,7 @@ void CSrmmWindow::OnOptionsApplied(bool bUpdateAvatar) if (m_avatarPic == nullptr || !g_dat.bShowAvatar)
m_avatar.Hide();
SendMessage(m_hwnd, DM_UPDATETITLE, 0, 0);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
if (m_hBkgBrush)
DeleteObject(m_hBkgBrush);
@@ -964,7 +964,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (rc.bottom - rc.top < m_minEditBoxSize.cy)
m_splitter.OnChange(&m_splitter);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
break;
case DM_GETAVATAR:
@@ -1063,14 +1063,14 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) GetWindowText(m_hwnd, oldtitle, _countof(oldtitle));
if (mir_wstrcmp(newtitle, oldtitle)) { //swt() flickers even if the title hasn't actually changed
SetWindowText(m_pOwner->GetHwnd(), newtitle);
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
}
break;
case DM_NEWTIMEZONE:
m_hTimeZone = TimeZone_CreateByContact(m_hContact, 0, TZF_KNOWNONLY);
m_wMinute = 61;
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ Resize();
break;
case DM_CASCADENEWWINDOW:
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 3a37e0b295..f079b19fd3 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -304,7 +304,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CopySettingsStruct(&settings, &tempSettings[iUser]->settings);
flags = tempSettings[iUser]->flags;
}
- ShowMultipleControls(hwndDlg, outgoingConnectionsControls, _countof(outgoingConnectionsControls), flags&NUF_OUTGOING ? SW_SHOW : SW_HIDE);
+ ShowMultipleControls(hwndDlg, outgoingConnectionsControls, _countof(outgoingConnectionsControls), flags & NUF_OUTGOING ? SW_SHOW : SW_HIDE);
CheckDlgButton(hwndDlg, IDC_USEPROXY, settings.useProxy);
SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_RESETCONTENT, 0, 0);
if (settings.proxyType == 0) AddProxyTypeItem(hwndDlg, 0, settings.proxyType);
@@ -323,7 +323,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_PROXYDNS, settings.dnsThroughProxy);
CheckDlgButton(hwndDlg, IDC_VALIDATESSL, settings.validateSSL);
- ShowMultipleControls(hwndDlg, incomingConnectionsControls, _countof(incomingConnectionsControls), flags&NUF_INCOMING ? SW_SHOW : SW_HIDE);
+ ShowMultipleControls(hwndDlg, incomingConnectionsControls, _countof(incomingConnectionsControls), flags & NUF_INCOMING ? SW_SHOW : SW_HIDE);
CheckDlgButton(hwndDlg, IDC_SPECIFYPORTS, settings.specifyIncomingPorts);
SetDlgItemTextA(hwndDlg, IDC_PORTSRANGE, settings.szIncomingPorts ? settings.szIncomingPorts : "");
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 1e918e3dde..3faa2c9e46 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -883,7 +883,7 @@ public: m_hCurrentPage = p->hTreeItem;
m_pageTree.SelectItem(m_hCurrentPage);
if (opd)
- opd->pDialog->Show(SW_HIDE);
+ opd->pDialog->Hide();
m_currentPage = i;
if (opd)
opd->pDialog->Show();
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
|