diff options
-rw-r--r-- | plugins/Scriver/src/chat_window.cpp | 6 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 9 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 49 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 1 | ||||
-rw-r--r-- | src/core/stdmsg/src/tabs.cpp | 6 |
9 files changed, 39 insertions, 50 deletions
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 5b2fbf80ff..2eedb41373 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -166,11 +166,11 @@ void CChatRoomDlg::MessageDialogResize(int w, int h) if (m_pParent->iSplitterY < hSplitterMinBottom)
m_pParent->iSplitterY = hSplitterMinBottom;
- ShowWindow(m_splitterX.GetHwnd(), bNick ? SW_SHOW : SW_HIDE);
+ m_splitterX.Show(bNick);
if (m_si->iType != GCW_SERVER)
- ShowWindow(m_nickList.GetHwnd(), m_bNicklistEnabled ? SW_SHOW : SW_HIDE);
+ m_nickList.Show(m_bNicklistEnabled);
else
- ShowWindow(m_nickList.GetHwnd(), SW_HIDE);
+ m_nickList.Hide();
if (m_si->iType == GCW_SERVER) {
m_btnNickList.Enable(false);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 7968f3da0c..bccea21bef 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -720,13 +720,10 @@ void CSrmmWindow::SetDialogToType() else
ShowWindow(m_hwndInfo, SW_HIDE);
- ShowWindow(m_message.GetHwnd(), SW_SHOW);
- if (m_hwndIeview != nullptr)
- ShowWindow(m_log.GetHwnd(), SW_HIDE);
- else
- ShowWindow(m_log.GetHwnd(), SW_SHOW);
+ m_message.Show();
+ m_log.Show(m_hwndIeview == nullptr);
- ShowWindow(m_splitter.GetHwnd(), SW_SHOW);
+ m_splitter.Show();
UpdateReadChars();
EnableWindow(GetDlgItem(m_hwnd, IDOK), GetRichTextLength(m_message.GetHwnd(), 1200, FALSE) ? TRUE : FALSE);
SendMessage(m_hwnd, DM_CLISTSETTINGSCHANGED, 0, 0);
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 403f6f86be..e1315d7dee 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -255,7 +255,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc) Utils::showDlgControl(m_hwnd, IDC_SPLITTERY, SW_HIDE); if (m_si->iType != GCW_SERVER) { - Utils::showDlgControl(m_hwnd, IDC_SRMM_NICKLIST, m_bNicklistEnabled ? SW_SHOW : SW_HIDE); + m_nickList.Show(m_bNicklistEnabled); Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, m_bNicklistEnabled ? SW_SHOW : SW_HIDE); m_btnNickList.Enable(true); @@ -267,7 +267,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc) } } else { - Utils::showDlgControl(m_hwnd, IDC_SRMM_NICKLIST, SW_HIDE); + m_nickList.Hide(); Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, SW_HIDE); } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index fedb3d4aab..05993c906a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -386,9 +386,9 @@ void CTabBaseDlg::SetDialogToType() Utils::enableDlgControl(m_hwnd, IDC_TIME, true);
if (m_hwndIEView || m_hwndHPP) {
- Utils::showDlgControl(m_hwnd, IDC_SRMM_LOG, SW_HIDE);
+ m_log.Hide();
m_log.Enable(false);
- Utils::showDlgControl(m_hwnd, IDC_SRMM_MESSAGE, SW_SHOW);
+ m_message.Show();
}
else ShowMultipleControls(m_hwnd, sendControls, _countof(sendControls), SW_SHOW);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 2f16a2a7cc..0f2784c6a7 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1065,7 +1065,7 @@ void CTabBaseDlg::SetMessageLog() ieWindow.cy = 200;
CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow);
m_hwndIEView = ieWindow.hwnd;
- Utils::showDlgControl(m_hwnd, IDC_SRMM_LOG, SW_HIDE);
+ m_log.Hide();
m_log.Enable(false);
}
else if (iLogMode == WANT_HPP_LOG && m_hwndHPP == nullptr) {
@@ -1078,7 +1078,7 @@ void CTabBaseDlg::SetMessageLog() ieWindow.cy = 10;
CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
m_hwndHPP = ieWindow.hwnd;
- Utils::showDlgControl(m_hwnd, IDC_SRMM_LOG, SW_HIDE);
+ m_log.Hide();
m_log.Enable(false);
}
}
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 675b28e2f7..c0b40134fe 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -63,7 +63,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) : m_btnOk.OnClick = Callback(this, &CChatRoomDlg::onClick_Ok); m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::onClick_Filter); - m_btnChannelMgr.OnClick = Callback(this, &CChatRoomDlg::onClick_Options); m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_NickList); m_splitterX.OnChange = Callback(this, &CChatRoomDlg::onSplitterX); @@ -165,12 +164,6 @@ void CChatRoomDlg::onClick_NickList(CCtrlButton *pButton) SendMessage(m_hwnd, WM_SIZE, 0, 0); } -void CChatRoomDlg::onClick_Options(CCtrlButton *pButton) -{ - if (pButton->Enabled()) - Chat_DoEventHook(m_si, GC_USER_CHANMGR, nullptr, nullptr, 0); -} - void CChatRoomDlg::onClick_Ok(CCtrlButton *pButton) { if (!pButton->Enabled()) @@ -257,7 +250,7 @@ void CChatRoomDlg::SetWindowPosition() if (db_get_b(0, CHAT_MODULE, "SavePosition", 0)) { if (RestoreWindowPosition(m_hwnd, m_hContact, true)) { - ShowWindow(m_hwnd, SW_HIDE); + Show(SW_HIDE); return; } SetWindowPos(m_hwnd, 0, (screen.right - screen.left) / 2 - (550) / 2, (screen.bottom - screen.top) / 2 - (400) / 2, (550), (400), SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE); @@ -794,7 +787,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) } if (wParam == 0x4f && isCtrl && !isAlt) { // ctrl-o (options) - onClick_Options(&m_btnChannelMgr); + onClick_ChanMgr(&m_btnChannelMgr); return TRUE; } @@ -1007,33 +1000,33 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) bool bControl = db_get_b(0, CHAT_MODULE, "ShowTopButtons", 1) != 0; bool bNick = m_si->iType != GCW_SERVER && m_bNicklistEnabled; - ShowWindow(m_btnBold.GetHwnd(), bFormat ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnItalic.GetHwnd(), bFormat ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnUnderline.GetHwnd(), bFormat ? SW_SHOW : SW_HIDE); + m_btnBold.Show(bFormat); + m_btnItalic.Show(bFormat); + m_btnUnderline.Show(bFormat); - ShowWindow(m_btnColor.GetHwnd(), bFormat ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnBkColor.GetHwnd(), bFormat ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnHistory.GetHwnd(), bControl ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnNickList.GetHwnd(), bControl ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnFilter.GetHwnd(), bControl ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnChannelMgr.GetHwnd(), bControl ? SW_SHOW : SW_HIDE); - ShowWindow(m_btnOk.GetHwnd(), bSend ? SW_SHOW : SW_HIDE); - ShowWindow(GetDlgItem(m_hwnd, IDC_SPLITTERX), bNick ? SW_SHOW : SW_HIDE); + m_btnColor.Show(bFormat); + m_btnBkColor.Show(bFormat); + m_btnHistory.Show(bControl); + m_btnNickList.Show(bControl); + m_btnFilter.Show(bControl); + m_btnChannelMgr.Show(bControl); + m_btnOk.Show(bSend); + m_splitterX.Show(bNick); if (m_si->iType != GCW_SERVER) - ShowWindow(m_nickList.GetHwnd(), m_bNicklistEnabled ? SW_SHOW : SW_HIDE); + m_nickList.Show(m_bNicklistEnabled); else - ShowWindow(m_nickList.GetHwnd(), SW_HIDE); + m_nickList.Hide(); if (m_si->iType == GCW_SERVER) { - EnableWindow(m_btnNickList.GetHwnd(), false); - EnableWindow(m_btnFilter.GetHwnd(), false); - EnableWindow(m_btnChannelMgr.GetHwnd(), false); + m_btnNickList.Enable(false); + m_btnFilter.Enable(false); + m_btnChannelMgr.Enable(false); } else { - EnableWindow(m_btnNickList.GetHwnd(), true); - EnableWindow(m_btnFilter.GetHwnd(), true); + m_btnNickList.Enable(true); + m_btnFilter.Enable(true); if (m_si->iType == GCW_CHATROOM) - EnableWindow(m_btnChannelMgr.GetHwnd(), pci->MM_FindModule(m_si->pszModule)->bChanMgr); + m_btnChannelMgr.Enable(pci->MM_FindModule(m_si->pszModule)->bChanMgr); } CSrmmBaseDialog::DlgProc(uMsg, wParam, lParam); // call built-in resizer diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 7e2fb62a34..5de597765b 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -385,7 +385,7 @@ void CSrmmWindow::onClick_Ok(CCtrlButton *pButton) if (g_dat.bAutoClose)
DestroyWindow(m_hwnd);
else if (g_dat.bAutoMin)
- ShowWindow(m_hwnd, SW_MINIMIZE);
+ Show(SW_MINIMIZE);
}
}
@@ -417,8 +417,8 @@ void CSrmmWindow::OnOptionsApplied(bool bUpdateAvatar) }
ShowWindow(GetDlgItem(m_hwnd, IDCANCEL), SW_HIDE);
- ShowWindow(GetDlgItem(m_hwnd, IDC_SPLITTERY), SW_SHOW);
- ShowWindow(GetDlgItem(m_hwnd, IDOK), g_dat.bSendButton ? SW_SHOW : SW_HIDE);
+ m_splitter.Show();
+ m_btnOk.Show(g_dat.bSendButton);
m_btnOk.Enable(GetWindowTextLength(m_message.GetHwnd()) != 0);
if (m_avatarPic == NULL || !g_dat.bShowAvatar)
ShowWindow(GetDlgItem(m_hwnd, IDC_AVATAR), SW_HIDE);
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 6ea8005aa1..f4b1f2768c 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -251,7 +251,6 @@ public: void onClick_Ok(CCtrlButton*);
void onClick_Filter(CCtrlButton*);
- void onClick_Options(CCtrlButton*);
void onClick_NickList(CCtrlButton*);
void onSplitterX(CSplitter*);
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index e12a1c2495..40f5312476 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -187,7 +187,7 @@ void CTabbedWindow::AddPage(SESSION_INFO *si, int insertAt) mir_wstrncpy(szTemp + 20, L"...", 4); if (!IsWindowVisible(m_hwnd)) - ShowWindow(m_hwnd, SW_SHOW); + Show(SW_SHOW); CChatRoomDlg *pTab = new CChatRoomDlg(si); m_tab.AddPage(szTemp, NULL, pTab); @@ -541,7 +541,7 @@ void ShowRoom(SESSION_INFO *si) SetWindowLongPtr(si->pDlg->GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(si->pDlg->GetHwnd(), GWL_EXSTYLE) | WS_EX_APPWINDOW); if (IsIconic(si->pDlg->GetHwnd())) - ShowWindow(si->pDlg->GetHwnd(), SW_NORMAL); - ShowWindow(si->pDlg->GetHwnd(), SW_SHOW); + si->pDlg->Show(SW_NORMAL); + si->pDlg->Show(SW_SHOW); SetForegroundWindow(si->pDlg->GetHwnd()); } |