diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-09 20:29:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-09 20:29:02 +0300 |
commit | e5fdfcde3880eb7edaf573fb883dd4ef86972082 (patch) | |
tree | c5d4ee388876f78024a82c4bd8ee9712e3877dbb /src/core/stdmsg | |
parent | 2d737d50469b965c2787823a94757f4c9f0a7107 (diff) |
moving session data into dialog classes
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/chat_util.cpp | 52 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 85 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 3 |
3 files changed, 70 insertions, 70 deletions
diff --git a/src/core/stdmsg/src/chat_util.cpp b/src/core/stdmsg/src/chat_util.cpp index b9a44e45f6..f4d514d635 100644 --- a/src/core/stdmsg/src/chat_util.cpp +++ b/src/core/stdmsg/src/chat_util.cpp @@ -21,20 +21,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw) +void CChatRoomDlg::Log_StreamInEvent(LOGINFO *lin, BOOL bRedraw) { - if (hwndDlg == 0 || lin == 0 || si == 0) + if (m_hwnd == nullptr || lin == nullptr || m_si == nullptr) return; - if (!bRedraw && si->iType == GCW_CHATROOM && si->bFilterEnabled && (si->iLogFilterFlags & lin->iType) == 0) + if (!bRedraw && m_si->iType == GCW_CHATROOM && m_bFilterEnabled && (m_iLogFilterFlags & lin->iType) == 0) return; - HWND hwndRich = GetDlgItem(hwndDlg, IDC_LOG); - LOGSTREAMDATA streamData; memset(&streamData, 0, sizeof(streamData)); - streamData.hwnd = hwndRich; - streamData.si = si; + streamData.hwnd = m_log.GetHwnd(); + streamData.si = m_si; streamData.lin = lin; streamData.bStripFormat = FALSE; @@ -47,20 +45,20 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra SCROLLINFO scroll; scroll.cbSize = sizeof(SCROLLINFO); scroll.fMask = SIF_RANGE | SIF_POS | SIF_PAGE; - GetScrollInfo(GetDlgItem(hwndDlg, IDC_LOG), SB_VERT, &scroll); + GetScrollInfo(m_log.GetHwnd(), SB_VERT, &scroll); POINT point = {}; - SendMessage(hwndRich, EM_GETSCROLLPOS, 0, (LPARAM)&point); + SendMessage(m_log.GetHwnd(), EM_GETSCROLLPOS, 0, (LPARAM)&point); // do not scroll to bottom if there is a selection CHARRANGE oldsel, sel; - SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&oldsel); + SendMessage(m_log.GetHwnd(), EM_EXGETSEL, 0, (LPARAM)&oldsel); if (oldsel.cpMax != oldsel.cpMin) - SendMessage(hwndRich, WM_SETREDRAW, FALSE, 0); + SendMessage(m_log.GetHwnd(), WM_SETREDRAW, FALSE, 0); //set the insertion point at the bottom - sel.cpMin = sel.cpMax = GetRichTextLength(hwndRich); - SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&sel); + sel.cpMin = sel.cpMax = GetRichTextLength(m_log.GetHwnd()); + SendMessage(m_log.GetHwnd(), EM_EXSETSEL, 0, (LPARAM)&sel); // fix for the indent... must be a M$ bug if (sel.cpMax == 0) @@ -75,14 +73,14 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra pci->logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY); pci->logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX); ReleaseDC(NULL, hdc); - SendMessage(hwndRich, WM_SETREDRAW, FALSE, 0); + SendMessage(m_log.GetHwnd(), WM_SETREDRAW, FALSE, 0); bFlag = TRUE; } // stream in the event(s) streamData.lin = lin; streamData.bRedraw = bRedraw; - SendMessage(hwndRich, EM_STREAMIN, wp, (LPARAM)&stream); + SendMessage(m_log.GetHwnd(), EM_STREAMIN, wp, (LPARAM)&stream); // do smileys if (SmileyAddInstalled && (bRedraw || (lin->ptszText && lin->iType != GC_EVENT_JOIN && lin->iType != GC_EVENT_NICK && lin->iType != GC_EVENT_ADDSTATUS && lin->iType != GC_EVENT_REMOVESTATUS))) { @@ -94,33 +92,33 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra SMADD_RICHEDIT3 sm = {}; sm.cbSize = sizeof(sm); - sm.hwndRichEditControl = hwndRich; - sm.Protocolname = si->pszModule; + sm.hwndRichEditControl = m_log.GetHwnd(); + sm.Protocolname = m_si->pszModule; sm.rangeToReplace = bRedraw ? NULL : &newsel; sm.disableRedraw = TRUE; - sm.hContact = si->hContact; + sm.hContact = m_si->hContact; CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&sm); } // scroll log to bottom if the log was previously scrolled to bottom, else restore old position if (bRedraw || (UINT)scroll.nPos >= (UINT)scroll.nMax - scroll.nPage - 5 || scroll.nMax - scroll.nMin - scroll.nPage < 50) - SendMessage(GetParent(hwndRich), GC_SCROLLTOBOTTOM, 0, 0); + SendMessage(GetParent(m_log.GetHwnd()), GC_SCROLLTOBOTTOM, 0, 0); else - SendMessage(hwndRich, EM_SETSCROLLPOS, 0, (LPARAM)&point); + SendMessage(m_log.GetHwnd(), EM_SETSCROLLPOS, 0, (LPARAM)&point); // do we need to restore the selection if (oldsel.cpMax != oldsel.cpMin) { - SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&oldsel); - SendMessage(hwndRich, WM_SETREDRAW, TRUE, 0); - InvalidateRect(hwndRich, NULL, TRUE); + SendMessage(m_log.GetHwnd(), EM_EXSETSEL, 0, (LPARAM)&oldsel); + SendMessage(m_log.GetHwnd(), WM_SETREDRAW, TRUE, 0); + InvalidateRect(m_log.GetHwnd(), NULL, TRUE); } // need to invalidate the window if (bFlag) { - sel.cpMin = sel.cpMax = GetRichTextLength(hwndRich); - SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&sel); - SendMessage(hwndRich, WM_SETREDRAW, TRUE, 0); - InvalidateRect(hwndRich, NULL, TRUE); + sel.cpMin = sel.cpMax = GetRichTextLength(m_log.GetHwnd()); + SendMessage(m_log.GetHwnd(), EM_EXSETSEL, 0, (LPARAM)&sel); + SendMessage(m_log.GetHwnd(), WM_SETREDRAW, TRUE, 0); + InvalidateRect(m_log.GetHwnd(), NULL, TRUE); } } diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index cf7cf376ac..7292b9aa00 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -42,7 +42,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc) BOOL bFormat = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowFormatButtons", 1); BOOL bToolbar = bFormat || bControl; BOOL bSend = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowSend", 0); - BOOL bNick = si->iType != GCW_SERVER && si->bNicklistEnabled; + BOOL bNick = si->iType != GCW_SERVER && m_bNicklistEnabled; switch (urc->wId) { case IDOK: @@ -95,6 +95,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { MESSAGESUBDATA *dat = (MESSAGESUBDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA); HWND hwndDlg = GetParent(hwnd); + CChatRoomDlg *pDlg = (CChatRoomDlg*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); CHARRANGE sel; switch (msg) { @@ -494,8 +495,8 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, UINT u = IsDlgButtonChecked(hwndDlg, IDC_COLOR); if (index >= 0) { - dat->si->bFGSet = true; - dat->si->iFG = index; + pDlg->m_bFGSet = true; + pDlg->m_iFG = index; } if (u == BST_UNCHECKED && cf.crTextColor != g_Settings.MessageAreaColor) @@ -510,8 +511,8 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, UINT u = IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR); if (index >= 0) { - dat->si->bBGSet = TRUE; - dat->si->iBG = index; + pDlg->m_bBGSet = TRUE; + pDlg->m_iBG = index; } if (u == BST_UNCHECKED && cf.crBackColor != crB) CheckDlgButton(hwndDlg, IDC_BKGCOLOR, BST_CHECKED); @@ -559,23 +560,23 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, MessageSubclassProc, msg, wParam, lParam); } -static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK CChatRoomDlg::FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - static SESSION_INFO *si = NULL; + static CChatRoomDlg *pDlg = NULL; switch (uMsg) { case WM_INITDIALOG: - si = (SESSION_INFO*)lParam; - CheckDlgButton(hwndDlg, IDC_1, si->iLogFilterFlags & GC_EVENT_ACTION ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_2, si->iLogFilterFlags & GC_EVENT_MESSAGE ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_3, si->iLogFilterFlags & GC_EVENT_NICK ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_4, si->iLogFilterFlags & GC_EVENT_JOIN ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_5, si->iLogFilterFlags & GC_EVENT_PART ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_6, si->iLogFilterFlags & GC_EVENT_TOPIC ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_7, si->iLogFilterFlags & GC_EVENT_ADDSTATUS ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_8, si->iLogFilterFlags & GC_EVENT_INFORMATION ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_9, si->iLogFilterFlags & GC_EVENT_QUIT ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_10, si->iLogFilterFlags & GC_EVENT_KICK ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_11, si->iLogFilterFlags & GC_EVENT_NOTICE ? BST_CHECKED : BST_UNCHECKED); + pDlg = (CChatRoomDlg*)lParam; + CheckDlgButton(hwndDlg, IDC_1, pDlg->m_iLogFilterFlags & GC_EVENT_ACTION ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_2, pDlg->m_iLogFilterFlags & GC_EVENT_MESSAGE ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_3, pDlg->m_iLogFilterFlags & GC_EVENT_NICK ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_4, pDlg->m_iLogFilterFlags & GC_EVENT_JOIN ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_5, pDlg->m_iLogFilterFlags & GC_EVENT_PART ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_6, pDlg->m_iLogFilterFlags & GC_EVENT_TOPIC ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_7, pDlg->m_iLogFilterFlags & GC_EVENT_ADDSTATUS ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_8, pDlg->m_iLogFilterFlags & GC_EVENT_INFORMATION ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_9, pDlg->m_iLogFilterFlags & GC_EVENT_QUIT ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_10, pDlg->m_iLogFilterFlags & GC_EVENT_KICK ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_11, pDlg->m_iLogFilterFlags & GC_EVENT_NOTICE ? BST_CHECKED : BST_UNCHECKED); break; case WM_CTLCOLOREDIT: @@ -615,7 +616,7 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP iFlags |= GC_EVENT_REMOVESTATUS; SendMessage(GetParent(hwndDlg), GC_CHANGEFILTERFLAG, 0, iFlags); - if (si->bFilterEnabled) + if (pDlg->m_bFilterEnabled) SendMessage(GetParent(hwndDlg), GC_REDRAWLOG, 0, 0); PostMessage(hwndDlg, WM_CLOSE, 0, 0); } @@ -826,7 +827,7 @@ static void __cdecl phase2(void * lParam) ///////////////////////////////////////////////////////////////////////////////////////// CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) : - CSrmmBaseDialog(g_hInst, g_Settings.bTabsEnable ? IDD_CHANNEL_TAB : IDD_CHANNEL), + CSrmmBaseDialog(g_hInst, g_Settings.bTabsEnable ? IDD_CHANNEL_TAB : IDD_CHANNEL, si), m_nickList(this, IDC_LIST), m_message(this, IDC_MESSAGE), m_log(this, IDC_LOG), @@ -848,10 +849,8 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) : m_splitterX(this, IDC_SPLITTERX), m_splitterY(this, IDC_SPLITTERY) { - m_si = si; m_pLog = &m_log; m_pEntry = &m_message; - m_hContact = si->hContact; m_autoClose = 0; m_forceResizable = true; @@ -972,9 +971,9 @@ void CChatRoomDlg::OnClick_Color(CCtrlButton *pButton) if (IsDlgButtonChecked(m_hwnd, IDC_COLOR)) { if (db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0) SendMessage(m_hwnd, GC_SHOWCOLORCHOOSER, 0, IDC_COLOR); - else if (m_si->bFGSet) { + else if (m_bFGSet) { cf.dwMask = CFM_COLOR; - cf.crTextColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_si->iFG]; + cf.crTextColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_iFG]; SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); } } @@ -997,9 +996,9 @@ void CChatRoomDlg::OnClick_BkColor(CCtrlButton *pButton) if (IsDlgButtonChecked(m_hwnd, IDC_BKGCOLOR)) { if (db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0) SendMessage(m_hwnd, GC_SHOWCOLORCHOOSER, 0, IDC_BKGCOLOR); - else if (m_si->bBGSet) { + else if (m_bBGSet) { cf.dwMask = CFM_BACKCOLOR; - cf.crBackColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_si->iBG]; + cf.crBackColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_iBG]; SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); } } @@ -1015,9 +1014,9 @@ void CChatRoomDlg::OnClick_Filter(CCtrlButton *pButton) if (!pButton->Enabled()) return; - m_si->bFilterEnabled = !m_si->bFilterEnabled; - SendDlgItemMessage(m_hwnd, IDC_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_si->bFilterEnabled ? "filter" : "filter2", FALSE)); - if (m_si->bFilterEnabled && db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0) + m_bFilterEnabled = !m_bFilterEnabled; + SendDlgItemMessage(m_hwnd, IDC_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_bFilterEnabled ? "filter" : "filter2", FALSE)); + if (m_bFilterEnabled && db_get_b(NULL, CHAT_MODULE, "RightClickFilter", 0) == 0) SendMessage(m_hwnd, GC_SHOWFILTERMENU, 0, 0); else SendMessage(m_hwnd, GC_REDRAWLOG, 0, 0); @@ -1038,8 +1037,8 @@ void CChatRoomDlg::OnClick_NickList(CCtrlButton *pButton) if (!pButton->Enabled() || m_si->iType == GCW_SERVER) return; - m_si->bNicklistEnabled = !m_si->bNicklistEnabled; - pButton->SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_si->bNicklistEnabled ? "nicklist" : "nicklist2", FALSE)); + m_bNicklistEnabled = !m_bNicklistEnabled; + pButton->SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_bNicklistEnabled ? "nicklist" : "nicklist2", FALSE)); SendMessage(m_hwnd, GC_SCROLLTOBOTTOM, 0, 0); SendMessage(m_hwnd, WM_SIZE, 0, 0); @@ -1207,8 +1206,8 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) switch (uMsg) { case GC_SETWNDPROPS: - SendDlgItemMessage(m_hwnd, IDC_SHOWNICKLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_si->bNicklistEnabled ? "nicklist" : "nicklist2", FALSE)); - SendDlgItemMessage(m_hwnd, IDC_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_si->bFilterEnabled ? "filter" : "filter2", FALSE)); + SendDlgItemMessage(m_hwnd, IDC_SHOWNICKLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_bNicklistEnabled ? "nicklist" : "nicklist2", FALSE)); + SendDlgItemMessage(m_hwnd, IDC_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(m_bFilterEnabled ? "filter" : "filter2", FALSE)); { MODULEINFO *mi = pci->MM_FindModule(m_si->pszModule); EnableWindow(m_btnBold.GetHwnd(), mi->bBold); @@ -1325,7 +1324,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL bControl = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowTopButtons", 1); BOOL bFormat = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowFormatButtons", 1); BOOL bSend = (BOOL)db_get_b(NULL, CHAT_MODULE, "ShowSend", 0); - BOOL bNick = m_si->iType != GCW_SERVER && m_si->bNicklistEnabled; + 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); @@ -1340,7 +1339,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) ShowWindow(m_btnOk.GetHwnd(), bSend ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(m_hwnd, IDC_SPLITTERX), bNick ? SW_SHOW : SW_HIDE); if (m_si->iType != GCW_SERVER) - ShowWindow(m_nickList.GetHwnd(), m_si->bNicklistEnabled ? SW_SHOW : SW_HIDE); + ShowWindow(m_nickList.GetHwnd(), m_bNicklistEnabled ? SW_SHOW : SW_HIDE); else ShowWindow(m_nickList.GetHwnd(), SW_HIDE); @@ -1381,13 +1380,13 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; pLog = pLog->next; - if (m_si->iType != GCW_CHATROOM || !m_si->bFilterEnabled || (m_si->iLogFilterFlags&pLog->iType) != 0) + if (m_si->iType != GCW_CHATROOM || !m_bFilterEnabled || (m_iLogFilterFlags&pLog->iType) != 0) index++; } - Log_StreamInEvent(m_hwnd, pLog, m_si, TRUE); + Log_StreamInEvent(pLog, TRUE); mir_forkthread(phase2, m_si); } - else Log_StreamInEvent(m_hwnd, m_si->pLogEnd, m_si, TRUE); + else Log_StreamInEvent(m_si->pLogEnd, TRUE); } else SendMessage(m_hwnd, GC_CONTROL_MSG, WINDOW_CLEARLOG, 0); break; @@ -1395,12 +1394,12 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case GC_REDRAWLOG2: m_si->LastTime = 0; if (m_si->pLog) - Log_StreamInEvent(m_hwnd, m_si->pLogEnd, m_si, TRUE); + Log_StreamInEvent(m_si->pLogEnd, TRUE); break; case GC_ADDLOG: if (m_si->pLogEnd) - Log_StreamInEvent(m_hwnd, m_si->pLog, m_si, FALSE); + Log_StreamInEvent(m_si->pLog, FALSE); else SendMessage(m_hwnd, GC_CONTROL_MSG, WINDOW_CLEARLOG, 0); break; @@ -1572,12 +1571,12 @@ LABEL_SHOWWINDOW: return 0; case GC_CHANGEFILTERFLAG: - m_si->iLogFilterFlags = lParam; + m_iLogFilterFlags = lParam; break; case GC_SHOWFILTERMENU: { - HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_FILTER), m_hwnd, FilterWndProc, (LPARAM)m_si); + HWND hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_FILTER), m_hwnd, FilterWndProc, (LPARAM)this); TranslateDialogDefault(hwnd); GetWindowRect(m_btnFilter.GetHwnd(), &rc); SetWindowPos(hwnd, HWND_TOP, rc.left - 85, (IsWindowVisible(m_btnFilter.GetHwnd()) || IsWindowVisible(m_btnBold.GetHwnd())) ? rc.top - 206 : rc.top - 186, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW); diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index f15624007b..b18ac615ae 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -173,6 +173,8 @@ class CChatRoomDlg : public CSrmmBaseDialog {
friend struct CTabbedWindow;
+ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
HWND m_hwndStatus;
CCtrlEdit m_message, m_log;
@@ -186,6 +188,7 @@ class CChatRoomDlg : public CSrmmBaseDialog { return (g_Settings.bTabsEnable) ? GetParent(m_hwndParent) : m_hwnd;
}
+ void Log_StreamInEvent(LOGINFO *lin, BOOL bRedraw);
void SaveWindowPosition(bool bUpdateSession);
void SetWindowPosition();
|