summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-21 18:23:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-21 18:23:08 +0300
commitb3a736917686b19b55c684c1b15c1e83cd0261e5 (patch)
tree2b71bed0ce0058f33a389a46b2be7dc67accab0b
parent03ba85dcd2d47cf31d6181b40620e278f7f30427 (diff)
some common code moved into mir_app
-rw-r--r--include/m_chat_int.h19
-rw-r--r--libs/win32/mir_app.libbin111648 -> 112836 bytes
-rw-r--r--libs/win64/mir_app.libbin107088 -> 108306 bytes
-rw-r--r--plugins/Scriver/src/chat_window.cpp165
-rw-r--r--plugins/Scriver/src/msgs.cpp18
-rw-r--r--plugins/Scriver/src/msgs.h8
-rw-r--r--plugins/Scriver/src/resource.h6
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp2
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp6
-rw-r--r--plugins/TabSRMM/src/chat_resource.h4
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp271
-rw-r--r--plugins/TabSRMM/src/msgs.cpp6
-rw-r--r--plugins/TabSRMM/src/msgs.h9
-rw-r--r--plugins/TabSRMM/src/resource.h2
-rw-r--r--src/core/stdmsg/src/chat_window.cpp150
-rw-r--r--src/core/stdmsg/src/msgs.cpp12
-rw-r--r--src/core/stdmsg/src/msgs.h2
-rw-r--r--src/core/stdmsg/src/resource.h6
-rw-r--r--src/core/stdmsg/src/stdafx.h6
-rw-r--r--src/mir_app/src/colorchooser.cpp2
-rw-r--r--src/mir_app/src/mir_app.def7
-rw-r--r--src/mir_app/src/mir_app64.def7
-rw-r--r--src/mir_app/src/srmm_base.cpp96
-rw-r--r--src/mir_app/src/srmm_util.cpp17
24 files changed, 345 insertions, 476 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h
index 743078d476..64fe186bb3 100644
--- a/include/m_chat_int.h
+++ b/include/m_chat_int.h
@@ -386,8 +386,17 @@ EXTERN_C MIR_APP_DLL(void) Chat_UpdateOptions();
/////////////////////////////////////////////////////////////////////////////////////////
+#define IDC_SRMM_COLOR 3001
+#define IDC_SRMM_BKGCOLOR 3002
+#define IDC_SRMM_BOLD 3003
+#define IDC_SRMM_ITALICS 3004
+#define IDC_SRMM_UNDERLINE 3005
+#define IDC_SRMM_FILTER 3006
+
class MIR_APP_EXPORT CSrmmBaseDialog : public CDlgBase
{
+ CSrmmBaseDialog(const CSrmmBaseDialog&);
+ CSrmmBaseDialog& operator=(const CSrmmBaseDialog&);
protected:
CSrmmBaseDialog(HINSTANCE hInst, int idDialog, SESSION_INFO *si = nullptr);
@@ -399,6 +408,14 @@ protected:
protected:
CCtrlEdit *m_pLog, *m_pEntry;
SESSION_INFO *m_si;
+ COLORREF m_clrInputBG, m_clrInputFG;
+
+ CCtrlButton m_btnColor, m_btnBkColor, m_btnFilter;
+ CCtrlButton m_btnBold, m_btnItalic, m_btnUnderline;
+
+ void onClick_BIU(CCtrlButton *pButton);
+ void onClick_Color(CCtrlButton *pButton);
+ void onClick_BkColor(CCtrlButton *pButton);
public:
MCONTACT m_hContact;
@@ -406,7 +423,6 @@ public:
bool m_bFilterEnabled, m_bNicklistEnabled;
bool m_bFGSet, m_bBGSet;
COLORREF m_iFG, m_iBG;
- CCtrlButton *m_pFilter, *m_pColor, *m_pBkColor;
void ClearLog();
void RedrawLog2();
@@ -414,6 +430,7 @@ public:
virtual void AddLog();
virtual void CloseTab() {}
+ virtual void LoadSettings() PURE;
virtual void RedrawLog() {}
virtual void ScrollToBottom() {}
virtual void ShowFilterMenu() {}
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 9867d9809c..29d1f9202b 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index ebdb8c3b3f..64bcea9325 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp
index 580505535c..c8fd483e3c 100644
--- a/plugins/Scriver/src/chat_window.cpp
+++ b/plugins/Scriver/src/chat_window.cpp
@@ -194,52 +194,52 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
dat->szSearchResult = nullptr;
}
if (wParam == 0x49 && isCtrl && !isAlt) { // ctrl-i (italics)
- CheckDlgButton(GetParent(hwnd), IDC_ITALICS, IsDlgButtonChecked(GetParent(hwnd), IDC_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_ITALICS, IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_ITALICS, 0), 0);
return TRUE;
}
if (wParam == 0x42 && isCtrl && !isAlt) { // ctrl-b (bold)
- CheckDlgButton(GetParent(hwnd), IDC_BOLD, IsDlgButtonChecked(GetParent(hwnd), IDC_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_BOLD, 0), 0);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BOLD, IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_BOLD, 0), 0);
return TRUE;
}
if (wParam == 0x55 && isCtrl && !isAlt) { // ctrl-u (paste clean text)
- CheckDlgButton(GetParent(hwnd), IDC_UNDERLINE, IsDlgButtonChecked(GetParent(hwnd), IDC_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_UNDERLINE, 0), 0);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_UNDERLINE, IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_UNDERLINE, 0), 0);
return TRUE;
}
if (wParam == 0x4b && isCtrl && !isAlt) { // ctrl-k (paste clean text)
- CheckDlgButton(GetParent(hwnd), IDC_COLOR, IsDlgButtonChecked(GetParent(hwnd), IDC_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_COLOR, IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_COLOR, 0), 0);
return TRUE;
}
if (wParam == VK_SPACE && isCtrl && !isAlt) { // ctrl-space (paste clean text)
- CheckDlgButton(GetParent(hwnd), IDC_BKGCOLOR, BST_UNCHECKED);
- CheckDlgButton(GetParent(hwnd), IDC_COLOR, BST_UNCHECKED);
- CheckDlgButton(GetParent(hwnd), IDC_BOLD, BST_UNCHECKED);
- CheckDlgButton(GetParent(hwnd), IDC_UNDERLINE, BST_UNCHECKED);
- CheckDlgButton(GetParent(hwnd), IDC_ITALICS, BST_UNCHECKED);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_BOLD, 0), 0);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_UNDERLINE, 0), 0);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BKGCOLOR, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_COLOR, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BOLD, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_UNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_ITALICS, BST_UNCHECKED);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_BKGCOLOR, 0), 0);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_COLOR, 0), 0);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_BOLD, 0), 0);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_UNDERLINE, 0), 0);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_ITALICS, 0), 0);
return TRUE;
}
if (wParam == 0x4c && isCtrl && !isAlt) { // ctrl-l (paste clean text)
- CheckDlgButton(GetParent(hwnd), IDC_BKGCOLOR, IsDlgButtonChecked(GetParent(hwnd), IDC_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BKGCOLOR, IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_BKGCOLOR, 0), 0);
return TRUE;
}
if (wParam == 0x46 && isCtrl && !isAlt) { // ctrl-f (paste clean text)
- if (IsWindowEnabled(GetDlgItem(GetParent(hwnd), IDC_FILTER)))
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_FILTER, 0), 0);
+ if (IsWindowEnabled(GetDlgItem(GetParent(hwnd), IDC_SRMM_FILTER)))
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(IDC_SRMM_FILTER, 0), 0);
return TRUE;
}
@@ -301,7 +301,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
if (pci->MM_FindModule(si->pszModule) && pci->MM_FindModule(si->pszModule)->bColor) {
int index = pci->GetColorIndex(si->pszModule, cf.crTextColor);
- u = IsDlgButtonChecked(GetParent(hwnd), IDC_COLOR);
+ u = IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_COLOR);
if (index >= 0) {
pDlg->m_bFGSet = true;
@@ -309,54 +309,54 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
}
if (u == BST_UNCHECKED && cf.crTextColor != cr)
- CheckDlgButton(GetParent(hwnd), IDC_COLOR, BST_CHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_COLOR, BST_CHECKED);
else if (u == BST_CHECKED && cf.crTextColor == cr)
- CheckDlgButton(GetParent(hwnd), IDC_COLOR, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_COLOR, BST_UNCHECKED);
}
if (pci->MM_FindModule(si->pszModule) && pci->MM_FindModule(si->pszModule)->bBkgColor) {
int index = pci->GetColorIndex(si->pszModule, cf.crBackColor);
COLORREF crB = db_get_dw(0, SRMM_MODULE, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
- u = IsDlgButtonChecked(GetParent(hwnd), IDC_BKGCOLOR);
+ u = IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_BKGCOLOR);
if (index >= 0) {
pDlg->m_bBGSet = TRUE;
pDlg->m_iBG = index;
}
if (u == BST_UNCHECKED && cf.crBackColor != crB)
- CheckDlgButton(GetParent(hwnd), IDC_BKGCOLOR, BST_CHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BKGCOLOR, BST_CHECKED);
else if (u == BST_CHECKED && cf.crBackColor == crB)
- CheckDlgButton(GetParent(hwnd), IDC_BKGCOLOR, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BKGCOLOR, BST_UNCHECKED);
}
if (pci->MM_FindModule(si->pszModule) && pci->MM_FindModule(si->pszModule)->bBold) {
- u = IsDlgButtonChecked(GetParent(hwnd), IDC_BOLD);
+ u = IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_BOLD);
u2 = cf.dwEffects;
u2 &= CFE_BOLD;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(GetParent(hwnd), IDC_BOLD, BST_CHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BOLD, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(GetParent(hwnd), IDC_BOLD, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_BOLD, BST_UNCHECKED);
}
if (pci->MM_FindModule(si->pszModule) && pci->MM_FindModule(si->pszModule)->bItalics) {
- u = IsDlgButtonChecked(GetParent(hwnd), IDC_ITALICS);
+ u = IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_ITALICS);
u2 = cf.dwEffects;
u2 &= CFE_ITALIC;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(GetParent(hwnd), IDC_ITALICS, BST_CHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_ITALICS, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(GetParent(hwnd), IDC_ITALICS, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_ITALICS, BST_UNCHECKED);
}
if (pci->MM_FindModule(si->pszModule) && pci->MM_FindModule(si->pszModule)->bUnderline) {
- u = IsDlgButtonChecked(GetParent(hwnd), IDC_UNDERLINE);
+ u = IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_UNDERLINE);
u2 = cf.dwEffects;
u2 &= CFE_UNDERLINE;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(GetParent(hwnd), IDC_UNDERLINE, BST_CHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_UNDERLINE, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(GetParent(hwnd), IDC_UNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(GetParent(hwnd), IDC_SRMM_UNDERLINE, BST_UNCHECKED);
}
}
break;
@@ -871,21 +871,12 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
m_splitterY(this, IDC_SPLITTERY),
m_btnOk(this, IDOK),
- m_btnBold(this, IDC_BOLD),
- m_btnColor(this, IDC_COLOR),
- m_btnFilter(this, IDC_FILTER),
- m_btnItalic(this, IDC_ITALICS),
m_btnHistory(this, IDC_HISTORY),
m_btnChanMgr(this, IDC_CHANMGR),
- m_btnBkColor(this, IDC_BKGCOLOR),
- m_btnShowList(this, IDC_SHOWNICKLIST),
- m_btnUnderline(this, IDC_UNDERLINE)
+ m_btnShowList(this, IDC_SHOWNICKLIST)
{
m_pLog = &m_log;
m_pEntry = &m_message;
- m_pColor = &m_btnColor;
- m_pBkColor = &m_btnBkColor;
- m_pFilter = &m_btnFilter;
m_btnOk.OnClick = Callback(this, &CChatRoomDlg::onClick_Ok);
m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::onClick_Filter);
@@ -893,13 +884,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
m_btnChanMgr.OnClick = Callback(this, &CChatRoomDlg::onClick_ChanMgr);
m_btnShowList.OnClick = Callback(this, &CChatRoomDlg::onClick_ShowList);
- m_btnBold.OnClick = Callback(this, &CChatRoomDlg::onClick_BIU);
- m_btnItalic.OnClick = Callback(this, &CChatRoomDlg::onClick_BIU);
- m_btnUnderline.OnClick = Callback(this, &CChatRoomDlg::onClick_BIU);
-
- m_btnColor.OnClick = Callback(this, &CChatRoomDlg::onClick_Color);
- m_btnBkColor.OnClick = Callback(this, &CChatRoomDlg::onClick_BkColor);
-
m_nickList.OnDblClick = Callback(this, &CChatRoomDlg::onDblClick_List);
m_message.OnChange = Callback(this, &CChatRoomDlg::onChange_Message);
@@ -1125,79 +1109,6 @@ void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton)
RedrawLog();
}
-void CChatRoomDlg::onClick_BIU(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE;
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_BOLD))
- cf.dwEffects |= CFE_BOLD;
- if (IsDlgButtonChecked(m_hwnd, IDC_ITALICS))
- cf.dwEffects |= CFE_ITALIC;
- if (IsDlgButtonChecked(m_hwnd, IDC_UNDERLINE))
- cf.dwEffects |= CFE_UNDERLINE;
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
-}
-
-void CChatRoomDlg::onClick_Color(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- MODULEINFO *pInfo = pci->MM_FindModule(m_si->pszModule);
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_COLOR)) {
- if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0)
- ShowColorChooser(IDC_COLOR);
- else if (m_bFGSet) {
- cf.dwMask = CFM_COLOR;
- cf.crTextColor = pInfo->crColors[m_iFG];
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
- }
- else {
- COLORREF cr;
- LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &cr);
- cf.dwMask = CFM_COLOR;
- cf.crTextColor = cr;
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
-}
-
-void CChatRoomDlg::onClick_BkColor(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- MODULEINFO *pInfo = pci->MM_FindModule(m_si->pszModule);
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_BKGCOLOR)) {
- if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0)
- ShowColorChooser(IDC_BKGCOLOR);
- else if (m_bBGSet) {
- cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = pInfo->crColors[m_iBG];
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
- }
- else {
- cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = db_get_dw(0, SRMM_MODULE, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
-}
-
void CChatRoomDlg::onChange_Message(CCtrlEdit *pEdit)
{
cmdListCurrent = nullptr;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index bd80189c9f..a4cc4edb4c 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -383,6 +383,12 @@ void CScriverWindow::CloseTab()
Close();
}
+void CScriverWindow::LoadSettings()
+{
+ m_clrInputBG = db_get_dw(0, SRMM_MODULE, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &m_clrInputFG);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// status icons processing
@@ -478,35 +484,35 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
// chat buttons
bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID;
- bbd.dwButtonID = IDC_BOLD;
+ bbd.dwButtonID = IDC_SRMM_BOLD;
bbd.dwDefPos = 10;
bbd.hIcon = IcoLib_GetIconHandle("chat_bold");
bbd.pwszText = LPGENW("&Bold");
bbd.pwszTooltip = LPGENW("Make the text bold (CTRL+B)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_ITALICS;
+ bbd.dwButtonID = IDC_SRMM_ITALICS;
bbd.dwDefPos = 15;
bbd.hIcon = IcoLib_GetIconHandle("chat_italics");
bbd.pwszText = LPGENW("&Italic");
bbd.pwszTooltip = LPGENW("Make the text italicized (CTRL+I)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_UNDERLINE;
+ bbd.dwButtonID = IDC_SRMM_UNDERLINE;
bbd.dwDefPos = 20;
bbd.hIcon = IcoLib_GetIconHandle("chat_underline");
bbd.pwszText = LPGENW("&Underline");
bbd.pwszTooltip = LPGENW("Make the text underlined (CTRL+U)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_COLOR;
+ bbd.dwButtonID = IDC_SRMM_COLOR;
bbd.dwDefPos = 25;
bbd.hIcon = IcoLib_GetIconHandle("chat_fgcol");
bbd.pwszText = LPGENW("&Color");
bbd.pwszTooltip = LPGENW("Select a foreground color for the text (CTRL+K)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_BKGCOLOR;
+ bbd.dwButtonID = IDC_SRMM_BKGCOLOR;
bbd.dwDefPos = 30;
bbd.hIcon = IcoLib_GetIconHandle("chat_bkgcol");
bbd.pwszText = LPGENW("&Background color");
@@ -528,7 +534,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
bbd.pwszTooltip = LPGENW("Show/hide the nick list (CTRL+N)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_FILTER;
+ bbd.dwButtonID = IDC_SRMM_FILTER;
bbd.dwDefPos = 10;
bbd.hIcon = IcoLib_GetIconHandle("chat_filter");
bbd.pwszText = LPGENW("&Filter");
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index 6985abec11..9656a9b54d 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -92,6 +92,7 @@ protected:
public:
virtual void CloseTab() override;
+ virtual void LoadSettings() override;
ParentWindowData *m_pParent;
int m_minLogBoxHeight, m_minEditBoxHeight;
@@ -177,8 +178,7 @@ public:
class CChatRoomDlg : public CScriverWindow
{
CCtrlEdit m_message, m_log;
- CCtrlButton m_btnOk, m_btnHistory, m_btnShowList, m_btnFilter, m_btnChanMgr;
- CCtrlButton m_btnColor, m_btnBkColor, m_btnBold, m_btnItalic, m_btnUnderline;
+ CCtrlButton m_btnOk, m_btnHistory, m_btnShowList, m_btnChanMgr;
CCtrlListBox m_nickList;
CSplitter m_splitterX, m_splitterY;
@@ -217,10 +217,6 @@ public:
void onClick_ChanMgr(CCtrlButton*);
void onClick_ShowList(CCtrlButton*);
- void onClick_BIU(CCtrlButton*);
- void onClick_Color(CCtrlButton*);
- void onClick_BkColor(CCtrlButton*);
-
void onDblClick_List(CCtrlListBox*);
void OnSplitterX(CSplitter*);
diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h
index b93c734738..0e6cdd399c 100644
--- a/plugins/Scriver/src/resource.h
+++ b/plugins/Scriver/src/resource.h
@@ -89,19 +89,13 @@
#define IDC_LIMITCHATSTABSNUM 1014
#define IDC_LIMITCHATSTABSNUMSPIN 1015
#define IDC_SMILEY 1016
-#define IDC_UNDERLINE 1017
-#define IDC_COLOR 1018
-#define IDC_BKGCOLOR 1019
#define IDC_SHOWNAMES 1020
-#define IDC_BOLD 1021
#define IDC_USETABS 1022
#define IDC_SHOWSECONDS 1023
#define IDC_USELONGDATE 1024
#define IDC_USERELATIVEDATE 1025
#define IDC_USEIEVIEW 1026
#define IDC_FONTSCOLORS 1027
-#define IDC_ITALICS 1028
-#define IDC_FILTER 1029
#define IDC_CHANMGR 1030
#define IDC_SHOWLOGICONS 1032
#define IDC_SHOWTIMES 1033
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 65b8ed9564..a46028ccbd 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -359,7 +359,7 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW &
if (!noerr) {
static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
wchar_t msgtxt[1024];
- mir_snwprintf(msgtxt, TranslateW(errmsg), modpath.c_str(), packname);
+ mir_snwprintf(msgtxt, TranslateW(errmsg), modpath.c_str(), packname.c_str());
ReportError(msgtxt);
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 2ea44eae73..c8a37d33d7 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -105,14 +105,14 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM)
Srmm_AddButton(&bbd);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CREATEBYID;
- bbd.dwButtonID = IDC_COLOR;
+ bbd.dwButtonID = IDC_SRMM_COLOR;
bbd.pszModuleName = "Tabsrmm";
bbd.dwDefPos = 80;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14];
bbd.pwszTooltip = LPGENW("Select font color");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_BKGCOLOR;
+ bbd.dwButtonID = IDC_SRMM_BKGCOLOR;
bbd.dwDefPos = 81;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16];
bbd.pwszTooltip = LPGENW("Change background color");
@@ -125,7 +125,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM)
bbd.pwszTooltip = LPGENW("Toggle nick list");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_FILTER;
+ bbd.dwButtonID = IDC_SRMM_FILTER;
bbd.dwDefPos = 24;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18];
bbd.pwszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate");
diff --git a/plugins/TabSRMM/src/chat_resource.h b/plugins/TabSRMM/src/chat_resource.h
index ee8255a0db..2516ff30d4 100644
--- a/plugins/TabSRMM/src/chat_resource.h
+++ b/plugins/TabSRMM/src/chat_resource.h
@@ -59,10 +59,6 @@
#define IDC_HIGHLIGHTME 1094
#define IDC_ADDHIGHLIGHTEDITLIST 1095
#define IDC_MUC_OPENLOGBASEDIR 1096
-#define IDC_BOLD 1106
-#define IDC_ITALICS 1107
-#define IDC_UNDERLINE 1108
-#define IDC_COLOR 1110
#define IDC_1 1200
#define IDC_2 1201
#define IDC_3 1202
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp
index acfc53f0b9..68a9e5a15d 100644
--- a/plugins/TabSRMM/src/chat_window.cpp
+++ b/plugins/TabSRMM/src/chat_window.cpp
@@ -472,25 +472,25 @@ LBL_SkipEnd:
LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- CChatRoomDlg *mwdat = (CChatRoomDlg*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
- if (mwdat == nullptr)
+ CChatRoomDlg *pDlg = (CChatRoomDlg*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ if (pDlg == nullptr)
return 0;
MESSAGESUBDATA *dat = (MESSAGESUBDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (mwdat->m_bkeyProcessed && (msg == WM_KEYUP)) {
- GetKeyboardState(mwdat->kstate);
- if (!(mwdat->kstate[VK_CONTROL] & 0x80) && !(mwdat->kstate[VK_SHIFT] & 0x80))
- mwdat->m_bkeyProcessed = false;
+ if (pDlg->m_bkeyProcessed && (msg == WM_KEYUP)) {
+ GetKeyboardState(pDlg->kstate);
+ if (!(pDlg->kstate[VK_CONTROL] & 0x80) && !(pDlg->kstate[VK_SHIFT] & 0x80))
+ pDlg->m_bkeyProcessed = false;
return 0;
}
switch (msg) {
case WM_NCCALCSIZE:
- return CSkin::NcCalcRichEditFrame(hwnd, mwdat, ID_EXTBKINPUTAREA, msg, wParam, lParam, MessageSubclassProc);
+ return CSkin::NcCalcRichEditFrame(hwnd, pDlg, ID_EXTBKINPUTAREA, msg, wParam, lParam, MessageSubclassProc);
case WM_NCPAINT:
- return CSkin::DrawRichEditFrame(hwnd, mwdat, ID_EXTBKINPUTAREA, msg, wParam, lParam, MessageSubclassProc);
+ return CSkin::DrawRichEditFrame(hwnd, pDlg, ID_EXTBKINPUTAREA, msg, wParam, lParam, MessageSubclassProc);
case EM_SUBCLASSED:
dat = (MESSAGESUBDATA*)mir_calloc(sizeof(MESSAGESUBDATA));
@@ -507,7 +507,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
RemoveMenu(hSubMenu, 8, MF_BYPOSITION);
RemoveMenu(hSubMenu, 4, MF_BYPOSITION);
- MODULEINFO *mi = pci->MM_FindModule(mwdat->m_si->pszModule);
+ MODULEINFO *mi = pci->MM_FindModule(pDlg->m_si->pszModule);
EnableMenuItem(hSubMenu, IDM_PASTEFORMATTED, MF_BYCOMMAND | ((mi && mi->bBold) ? MF_ENABLED : MF_GRAYED));
TranslateMenu(hSubMenu);
@@ -521,7 +521,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
MessageWindowPopupData mwpd = { sizeof(mwpd) };
mwpd.uType = MSG_WINDOWPOPUP_SHOWING;
mwpd.uFlags = MSG_WINDOWPOPUP_INPUT;
- mwpd.hContact = mwdat->m_hContact;
+ mwpd.hContact = pDlg->m_hContact;
mwpd.hwnd = hwnd;
mwpd.hMenu = hSubMenu;
mwpd.pt = pt;
@@ -558,7 +558,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
return TRUE;
case WM_MOUSEWHEEL:
- if (mwdat->DM_MouseWheelHandler(wParam, lParam) == 0)
+ if (pDlg->DM_MouseWheelHandler(wParam, lParam) == 0)
return 0;
dat->lastEnterTime = 0;
@@ -572,82 +572,82 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
break;
case WM_SYSKEYDOWN:
- mwdat->m_bkeyProcessed = false;
+ pDlg->m_bkeyProcessed = false;
if (ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_MESSAGE)) {
- mwdat->m_bkeyProcessed = true;
+ pDlg->m_bkeyProcessed = true;
return 0;
}
break;
case WM_SYSCHAR:
- if (mwdat->m_bkeyProcessed) {
- mwdat->m_bkeyProcessed = false; // preceeding key event has been processed by miranda hotkey service
+ if (pDlg->m_bkeyProcessed) {
+ pDlg->m_bkeyProcessed = false; // preceeding key event has been processed by miranda hotkey service
return 0;
}
if ((wParam >= '0' && wParam <= '9') && (GetKeyState(VK_MENU) & 0x8000)) { // ALT-1 -> ALT-0 direct tab selection
BYTE bChar = (BYTE)wParam;
int iIndex = (bChar == '0') ? 10 : bChar - (BYTE)'0';
- SendMessage(mwdat->m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_BY_INDEX, (LPARAM)iIndex);
+ SendMessage(pDlg->m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_BY_INDEX, (LPARAM)iIndex);
return 0;
}
break;
case WM_CHAR:
bool isShift, isAlt, isCtrl;
- mwdat->KbdState(isShift, isCtrl, isAlt);
+ pDlg->KbdState(isShift, isCtrl, isAlt);
- if (PluginConfig.m_bSoundOnTyping && !isAlt && !isCtrl && !(mwdat->m_pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_bAllowTab))
+ if (PluginConfig.m_bSoundOnTyping && !isAlt && !isCtrl && !(pDlg->m_pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_bAllowTab))
SkinPlaySound("SoundOnTyping");
if (isCtrl && !isAlt && !isShift) {
- MODULEINFO *mi = pci->MM_FindModule(mwdat->m_si->pszModule);
+ MODULEINFO *mi = pci->MM_FindModule(pDlg->m_si->pszModule);
if (mi == nullptr)
return 0;
switch (wParam) {
case 0x09: // ctrl-i (italics)
if (mi->bItalics) {
- CheckDlgButton(hwndParent, IDC_ITALICS, IsDlgButtonChecked(hwndParent, IDC_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
+ CheckDlgButton(hwndParent, IDC_SRMM_ITALICS, IsDlgButtonChecked(hwndParent, IDC_SRMM_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_ITALICS, 0), 0);
}
return 0;
case 0x02: // ctrl-b (bold)
if (mi->bBold) {
- CheckDlgButton(hwndParent, IDC_BOLD, IsDlgButtonChecked(hwndParent, IDC_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_BOLD, 0), 0);
+ CheckDlgButton(hwndParent, IDC_SRMM_BOLD, IsDlgButtonChecked(hwndParent, IDC_SRMM_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BOLD, 0), 0);
}
return 0;
case 0x20: // ctrl-space clear formatting
if (mi->bBold && mi->bItalics && mi->bUnderline) {
- CheckDlgButton(hwndParent, IDC_BKGCOLOR, BST_UNCHECKED);
- CheckDlgButton(hwndParent, IDC_COLOR, BST_UNCHECKED);
- CheckDlgButton(hwndParent, IDC_BOLD, BST_UNCHECKED);
- CheckDlgButton(hwndParent, IDC_UNDERLINE, BST_UNCHECKED);
- CheckDlgButton(hwndParent, IDC_ITALICS, BST_UNCHECKED);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_BOLD, 0), 0);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_UNDERLINE, 0), 0);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
+ CheckDlgButton(hwndParent, IDC_SRMM_BKGCOLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_COLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_BOLD, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_UNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_ITALICS, BST_UNCHECKED);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BKGCOLOR, 0), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_COLOR, 0), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BOLD, 0), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_UNDERLINE, 0), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_ITALICS, 0), 0);
}
return 0;
case 0x0c: // ctrl-l background color
if (mi->bBkgColor) {
- CheckDlgButton(hwndParent, IDC_BKGCOLOR, IsDlgButtonChecked(hwndParent, IDC_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
+ CheckDlgButton(hwndParent, IDC_SRMM_BKGCOLOR, IsDlgButtonChecked(hwndParent, IDC_SRMM_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BKGCOLOR, 0), 0);
}
return 0;
case 0x15: // ctrl-u underlined
if (mi->bUnderline) {
- CheckDlgButton(hwndParent, IDC_UNDERLINE, IsDlgButtonChecked(hwndParent, IDC_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_UNDERLINE, 0), 0);
+ CheckDlgButton(hwndParent, IDC_SRMM_UNDERLINE, IsDlgButtonChecked(hwndParent, IDC_SRMM_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_UNDERLINE, 0), 0);
}
return 0; // ctrl-k color
case 0x0b:
if (mi->bColor) {
- CheckDlgButton(hwndParent, IDC_COLOR, IsDlgButtonChecked(hwndParent, IDC_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
+ CheckDlgButton(hwndParent, IDC_SRMM_COLOR, IsDlgButtonChecked(hwndParent, IDC_SRMM_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_SRMM_COLOR, 0), 0);
}
return 0;
case 0x17:
@@ -658,14 +658,14 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
break;
case WM_KEYDOWN:
- mwdat->KbdState(isShift, isCtrl, isAlt);
+ pDlg->KbdState(isShift, isCtrl, isAlt);
// sound on typing..
if (PluginConfig.m_bSoundOnTyping && !isAlt && wParam == VK_DELETE)
SkinPlaySound("SoundOnTyping");
if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) {
- mwdat->m_bInsertMode = !mwdat->m_bInsertMode;
+ pDlg->m_bInsertMode = !pDlg->m_bInsertMode;
SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM)hwnd);
}
if (wParam == VK_CAPITAL || wParam == VK_NUMLOCK)
@@ -690,7 +690,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
else if (wParam == VK_HOME)
wp = MAKEWPARAM(SB_TOP, 0);
else if (wParam == VK_END) {
- mwdat->DM_ScrollToBottom(0, 0);
+ pDlg->DM_ScrollToBottom(0, 0);
return 0;
}
else if (wParam == VK_DOWN)
@@ -735,24 +735,24 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
else dat->lastEnterTime = 0;
if ((wParam == VK_NEXT && isCtrl && !isShift) || (wParam == VK_TAB && isCtrl && !isShift)) { // CTRL-TAB (switch tab/window)
- SendMessage(mwdat->m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_NEXT, 0);
+ SendMessage(pDlg->m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_NEXT, 0);
return TRUE;
}
if ((wParam == VK_PRIOR && isCtrl && !isShift) || (wParam == VK_TAB && isCtrl && isShift)) { // CTRL_SHIFT-TAB (switch tab/window)
- SendMessage(mwdat->m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_PREV, 0);
+ SendMessage(pDlg->m_pContainer->m_hwnd, DM_SELECTTAB, DM_SELECT_PREV, 0);
return TRUE;
}
if (wParam == VK_TAB && !isCtrl && !isShift) { // tab-autocomplete
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
- bool fCompleted = TabAutoComplete(hwnd, dat, mwdat->m_si);
+ bool fCompleted = TabAutoComplete(hwnd, dat, pDlg->m_si);
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE);
if (!fCompleted && !PluginConfig.m_bAllowTab) {
- if ((GetSendButtonState(mwdat->GetHwnd()) != PBS_DISABLED))
- SetFocus(GetDlgItem(mwdat->GetHwnd(), IDOK));
+ if ((GetSendButtonState(pDlg->GetHwnd()) != PBS_DISABLED))
+ SetFocus(GetDlgItem(pDlg->GetHwnd(), IDOK));
else
- SetFocus(GetDlgItem(mwdat->GetHwnd(), IDC_LOG));
+ SetFocus(GetDlgItem(pDlg->GetHwnd(), IDC_LOG));
}
return 0;
}
@@ -776,16 +776,16 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
}
if (wParam == VK_UP && isCtrl && !isAlt) {
- char *lpPrevCmd = pci->SM_GetPrevCommand(mwdat->m_si->ptszID, mwdat->m_si->pszModule);
+ char *lpPrevCmd = pci->SM_GetPrevCommand(pDlg->m_si->ptszID, pDlg->m_si->pszModule);
- if (!mwdat->m_si->lpCurrentCommand || !mwdat->m_si->lpCurrentCommand->last) {
+ if (!pDlg->m_si->lpCurrentCommand || !pDlg->m_si->lpCurrentCommand->last) {
// Next command is not defined. It means currently entered text is not saved in the history and it
// need to be saved in the window context.
char *enteredText = Message_GetFromStream(hwndParent);
- if (mwdat->m_enteredText)
- mir_free(mwdat->m_enteredText);
+ if (pDlg->m_enteredText)
+ mir_free(pDlg->m_enteredText);
- mwdat->m_enteredText = enteredText;
+ pDlg->m_enteredText = enteredText;
}
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
@@ -820,14 +820,14 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
ste.flags = ST_DEFAULT;
ste.codepage = CP_ACP;
- char *lpPrevCmd = pci->SM_GetNextCommand(mwdat->m_si->ptszID, mwdat->m_si->pszModule);
+ char *lpPrevCmd = pci->SM_GetNextCommand(pDlg->m_si->ptszID, pDlg->m_si->pszModule);
if (lpPrevCmd)
SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)lpPrevCmd);
- else if (mwdat->m_enteredText) {
+ else if (pDlg->m_enteredText) {
// If we cannot load the message from history, load the last edited text.
- SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)mwdat->m_enteredText);
- mir_free(mwdat->m_enteredText);
- mwdat->m_enteredText = nullptr;
+ SendMessage(hwnd, EM_SETTEXTEX, (WPARAM)&ste, (LPARAM)pDlg->m_enteredText);
+ mir_free(pDlg->m_enteredText);
+ pDlg->m_enteredText = nullptr;
}
GETTEXTLENGTHEX gtl = { 0 };
@@ -862,78 +862,77 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
cf.dwEffects = 0;
SendMessage(hwnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
{
- MODULEINFO *mi = pci->MM_FindModule(mwdat->m_si->pszModule);
+ MODULEINFO *mi = pci->MM_FindModule(pDlg->m_si->pszModule);
if (mi == nullptr)
break;
if (mi->bColor) {
- int index = Chat_GetColorIndex(mwdat->m_si->pszModule, cf.crTextColor);
- UINT u = IsDlgButtonChecked(GetParent(hwnd), IDC_COLOR);
+ int index = Chat_GetColorIndex(pDlg->m_si->pszModule, cf.crTextColor);
+ UINT u = IsDlgButtonChecked(GetParent(hwnd), IDC_SRMM_COLOR);
if (index >= 0) {
- mwdat->m_bFGSet = true;
- mwdat->m_iFG = index;
+ pDlg->m_bFGSet = true;
+ pDlg->m_iFG = index;
}
if (u == BST_UNCHECKED && cf.crTextColor != cr)
- CheckDlgButton(hwndParent, IDC_COLOR, BST_CHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_COLOR, BST_CHECKED);
else if (u == BST_CHECKED && cf.crTextColor == cr)
- CheckDlgButton(hwndParent, IDC_COLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_COLOR, BST_UNCHECKED);
}
if (mi->bBkgColor) {
- int index = Chat_GetColorIndex(mwdat->m_si->pszModule, cf.crBackColor);
- COLORREF crB = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
- UINT u = IsDlgButtonChecked(hwndParent, IDC_BKGCOLOR);
+ int index = Chat_GetColorIndex(pDlg->m_si->pszModule, cf.crBackColor);
+ UINT u = IsDlgButtonChecked(hwndParent, IDC_SRMM_BKGCOLOR);
if (index >= 0) {
- mwdat->m_bBGSet = true;
- mwdat->m_iBG = index;
+ pDlg->m_bBGSet = true;
+ pDlg->m_iBG = index;
}
- if (u == BST_UNCHECKED && cf.crBackColor != crB)
- CheckDlgButton(hwndParent, IDC_BKGCOLOR, BST_CHECKED);
- else if (u == BST_CHECKED && cf.crBackColor == crB)
- CheckDlgButton(hwndParent, IDC_BKGCOLOR, BST_UNCHECKED);
+ if (u == BST_UNCHECKED && cf.crBackColor != pDlg->m_clrInputBG)
+ CheckDlgButton(hwndParent, IDC_SRMM_BKGCOLOR, BST_CHECKED);
+ else if (u == BST_CHECKED && cf.crBackColor == pDlg->m_clrInputBG)
+ CheckDlgButton(hwndParent, IDC_SRMM_BKGCOLOR, BST_UNCHECKED);
}
if (mi->bBold) {
- UINT u = IsDlgButtonChecked(hwndParent, IDC_BOLD);
+ UINT u = IsDlgButtonChecked(hwndParent, IDC_SRMM_BOLD);
UINT u2 = cf.dwEffects;
u2 &= CFE_BOLD;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(hwndParent, IDC_BOLD, BST_CHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_BOLD, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(hwndParent, IDC_BOLD, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_BOLD, BST_UNCHECKED);
}
if (mi->bItalics) {
- UINT u = IsDlgButtonChecked(hwndParent, IDC_ITALICS);
+ UINT u = IsDlgButtonChecked(hwndParent, IDC_SRMM_ITALICS);
UINT u2 = cf.dwEffects;
u2 &= CFE_ITALIC;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(hwndParent, IDC_ITALICS, BST_CHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_ITALICS, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(hwndParent, IDC_ITALICS, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_ITALICS, BST_UNCHECKED);
}
if (mi->bUnderline) {
- UINT u = IsDlgButtonChecked(hwndParent, IDC_UNDERLINE);
+ UINT u = IsDlgButtonChecked(hwndParent, IDC_SRMM_UNDERLINE);
if (cf.dwEffects & CFE_UNDERLINE && (cf.bUnderlineType & CFU_UNDERLINE || cf.bUnderlineType & CFU_UNDERLINEWORD)) {
if (u == BST_UNCHECKED)
- CheckDlgButton(hwndParent, IDC_UNDERLINE, BST_CHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_UNDERLINE, BST_CHECKED);
}
else {
if (u == BST_CHECKED)
- CheckDlgButton(hwndParent, IDC_UNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(hwndParent, IDC_SRMM_UNDERLINE, BST_UNCHECKED);
}
}
}
break;
case WM_INPUTLANGCHANGE:
- if (PluginConfig.m_bAutoLocaleSupport && GetFocus() == hwnd && mwdat->m_pContainer->m_hwndActive == hwndParent && GetForegroundWindow() == mwdat->m_pContainer->m_hwnd && GetActiveWindow() == mwdat->m_pContainer->m_hwnd) {
- mwdat->DM_SaveLocale(wParam, lParam);
+ if (PluginConfig.m_bAutoLocaleSupport && GetFocus() == hwnd && pDlg->m_pContainer->m_hwndActive == hwndParent && GetForegroundWindow() == pDlg->m_pContainer->m_hwnd && GetActiveWindow() == pDlg->m_pContainer->m_hwnd) {
+ pDlg->DM_SaveLocale(wParam, lParam);
SendMessage(hwnd, EM_SETLANGOPTIONS, 0, (LPARAM)SendMessage(hwnd, EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
return 1;
}
@@ -1088,14 +1087,14 @@ INT_PTR CALLBACK CChatRoomDlg::FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- CChatRoomDlg *mwdat = (CChatRoomDlg*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ CChatRoomDlg *pDlg = (CChatRoomDlg*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
switch (msg) {
case WM_NCCALCSIZE:
- return CSkin::NcCalcRichEditFrame(hwnd, mwdat, ID_EXTBKHISTORY, msg, wParam, lParam, LogSubclassProc);
+ return CSkin::NcCalcRichEditFrame(hwnd, pDlg, ID_EXTBKHISTORY, msg, wParam, lParam, LogSubclassProc);
case WM_NCPAINT:
- return CSkin::DrawRichEditFrame(hwnd, mwdat, ID_EXTBKHISTORY, msg, wParam, lParam, LogSubclassProc);
+ return CSkin::DrawRichEditFrame(hwnd, pDlg, ID_EXTBKHISTORY, msg, wParam, lParam, LogSubclassProc);
case WM_COPY:
return Utils::WMCopyHandler(hwnd, LogSubclassProc, msg, wParam, lParam);
@@ -1154,16 +1153,16 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
break;
case WM_SYSKEYDOWN:
- mwdat->m_bkeyProcessed = false;
+ pDlg->m_bkeyProcessed = false;
if (ProcessHotkeysByMsgFilter(hwnd, msg, wParam, lParam, IDC_LOG)) {
- mwdat->m_bkeyProcessed = true;
+ pDlg->m_bkeyProcessed = true;
return 0;
}
break;
case WM_SYSCHAR:
- if (mwdat->m_bkeyProcessed) {
- mwdat->m_bkeyProcessed = false;
+ if (pDlg->m_bkeyProcessed) {
+ pDlg->m_bkeyProcessed = false;
return 0;
}
break;
@@ -1181,7 +1180,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case WM_CHAR:
bool isCtrl, isShift, isAlt;
- mwdat->KbdState(isShift, isCtrl, isAlt);
+ pDlg->KbdState(isShift, isCtrl, isAlt);
if (wParam == 0x03 && isCtrl) // Ctrl+C
return Utils::WMCopyHandler(hwnd, LogSubclassProc, msg, wParam, lParam);
@@ -1500,20 +1499,10 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
: CTabBaseDlg(IDD_CHANNEL, si),
m_btnOk(this, IDOK),
m_list(this, IDC_LIST),
- m_btnBold(this, IDC_BOLD),
- m_btnColor(this, IDC_COLOR),
- m_btnFilter(this, IDC_FILTER),
- m_btnItalic(this, IDC_ITALICS),
m_btnHistory(this, IDC_HISTORY),
- m_btnBkColor(this, IDC_BKGCOLOR),
m_btnChannelMgr(this, IDC_CHANMGR),
- m_btnUnderline(this, IDC_UNDERLINE),
m_btnNickList(this, IDC_SHOWNICKLIST)
{
- m_pColor = &m_btnColor;
- m_pBkColor = &m_btnBkColor;
- m_pFilter = &m_btnFilter;
-
m_szProto = GetContactProto(m_hContact);
m_bFilterEnabled = db_get_b(m_hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled) != 0;
Chat_SetFilters(m_si);
@@ -1524,10 +1513,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_ShowNickList);
m_btnChannelMgr.OnClick = Callback(this, &CChatRoomDlg::onClick_ChanMgr);
- m_btnColor.OnClick = Callback(this, &CChatRoomDlg::onClick_Color);
- m_btnBkColor.OnClick = Callback(this, &CChatRoomDlg::onClick_BkColor);
- m_btnBold.OnClick = m_btnItalic.OnClick = m_btnUnderline.OnClick = Callback(this, &CChatRoomDlg::onClick_BIU);
-
m_message.OnChange = Callback(this, &CChatRoomDlg::onChange_Message);
m_list.OnDblClick = Callback(this, &CChatRoomDlg::onDblClick_List);
@@ -1793,78 +1778,6 @@ void CChatRoomDlg::onClick_ChanMgr(CCtrlButton *pButton)
DoEventHook(GC_USER_CHANMGR, nullptr, nullptr, 0);
}
-void CChatRoomDlg::onClick_BIU(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE;
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_BOLD))
- cf.dwEffects |= CFE_BOLD;
- if (IsDlgButtonChecked(m_hwnd, IDC_ITALICS))
- cf.dwEffects |= CFE_ITALIC;
- if (IsDlgButtonChecked(m_hwnd, IDC_UNDERLINE))
- cf.dwEffects |= CFE_UNDERLINE;
-
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
-}
-
-void CChatRoomDlg::onClick_Color(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_COLOR)) {
- if (M.GetByte(CHAT_MODULE, "RightClickFilter", 0) == 0)
- ShowColorChooser(IDC_COLOR);
- else if (m_bFGSet) {
- cf.dwMask = CFM_COLOR;
- cf.crTextColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_iFG];
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
- }
- else {
- COLORREF cr;
- LoadLogfont(FONTSECTION_IM, MSGFONTID_MESSAGEAREA, nullptr, &cr, FONTMODULE);
- cf.dwMask = CFM_COLOR;
- cf.crTextColor = cr;
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
-}
-
-void CChatRoomDlg::onClick_BkColor(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_BKGCOLOR)) {
- if (M.GetByte(CHAT_MODULE, "RightClickFilter", 0) == 0)
- ShowColorChooser(IDC_BKGCOLOR);
- else if (m_bBGSet) {
- cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_iBG];
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
- }
- else {
- cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
-}
-
void CChatRoomDlg::onChange_Message(CCtrlEdit*)
{
if (m_pContainer->m_hwndActive == m_hwnd)
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 616fde47f3..8583720511 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -148,6 +148,12 @@ CTabBaseDlg::~CTabBaseDlg()
if (m_hTaskbarIcon) DestroyIcon(m_hTaskbarIcon);
}
+void CTabBaseDlg::LoadSettings()
+{
+ m_clrInputBG = m_pContainer->theme.inputbg;
+ LoadLogfont(FONTSECTION_IM, MSGFONTID_MESSAGEAREA, nullptr, &m_clrInputFG, FONTMODULE);
+}
+
void CTabBaseDlg::OnInitDialog()
{
SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index a96d0e5f9f..c009e50a5d 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -242,6 +242,8 @@ class CTabBaseDlg : public CSrmmBaseDialog
protected:
CCtrlEdit m_log, m_message;
+ virtual void LoadSettings() override;
+
void DM_AddDivider();
void DM_DismissTip(const POINT& pt);
void DM_ErrorDetected(int type, int flag);
@@ -481,8 +483,7 @@ public:
class CChatRoomDlg : public CTabBaseDlg
{
HWND m_hwndFilter;
- CCtrlButton m_btnFilter, m_btnHistory, m_btnChannelMgr, m_btnNickList, m_btnOk;
- CCtrlButton m_btnBold, m_btnItalic, m_btnUnderline, m_btnColor, m_btnBkColor;
+ CCtrlButton m_btnHistory, m_btnChannelMgr, m_btnNickList, m_btnOk;
CCtrlListBox m_list;
static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -523,10 +524,6 @@ public:
void onClick_ChanMgr(CCtrlButton*);
void onClick_ShowNickList(CCtrlButton*);
- void onClick_BIU(CCtrlButton*);
- void onClick_Color(CCtrlButton*);
- void onClick_BkColor(CCtrlButton*);
-
void onChange_Message(CCtrlEdit*);
void onDblClick_List(CCtrlListBox*);
diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h
index 1c4027ffcb..d90bf10cdf 100644
--- a/plugins/TabSRMM/src/resource.h
+++ b/plugins/TabSRMM/src/resource.h
@@ -99,7 +99,6 @@
#define IDC_CLOSE 1024
#define IDC_SAVE 1025
#define IDC_CHKACTR_DISMISS 1026
-#define IDC_BKGCOLOR 1027
#define IDC_CHKACTR_OPEN 1028
#define IDC_CONTACTPIC 1029
#define IDC_SHOWNICKLIST 1030
@@ -110,7 +109,6 @@
#define IDC_CHKPREVIEW 1034
#define IDC_CHKINFINITE 1035
#define IDC_PANELSTATUS 1036
-#define IDC_FILTER 1037
#define IDC_CHKDEFAULTCOL_MESSAGE 1038
#define IDC_CHKDEFAULTCOL_MUC 1039
#define IDC_CHKDEFAULTCOL_ERR 1040
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index eac363e812..bb721319a0 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -280,52 +280,52 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
if (wParam == 0x49 && isCtrl && !isAlt) { // ctrl-i (italics)
- CheckDlgButton(hwndDlg, IDC_ITALICS, IsDlgButtonChecked(hwndDlg, IDC_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
+ CheckDlgButton(hwndDlg, IDC_SRMM_ITALICS, IsDlgButtonChecked(hwndDlg, IDC_SRMM_ITALICS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_ITALICS, 0), 0);
return TRUE;
}
if (wParam == 0x42 && isCtrl && !isAlt) { // ctrl-b (bold)
- CheckDlgButton(hwndDlg, IDC_BOLD, IsDlgButtonChecked(hwndDlg, IDC_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BOLD, 0), 0);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BOLD, IsDlgButtonChecked(hwndDlg, IDC_SRMM_BOLD) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BOLD, 0), 0);
return TRUE;
}
if (wParam == 0x55 && isCtrl && !isAlt) { // ctrl-u (paste clean text)
- CheckDlgButton(hwndDlg, IDC_UNDERLINE, IsDlgButtonChecked(hwndDlg, IDC_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_UNDERLINE, 0), 0);
+ CheckDlgButton(hwndDlg, IDC_SRMM_UNDERLINE, IsDlgButtonChecked(hwndDlg, IDC_SRMM_UNDERLINE) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_UNDERLINE, 0), 0);
return TRUE;
}
if (wParam == 0x4b && isCtrl && !isAlt) { // ctrl-k (paste clean text)
- CheckDlgButton(hwndDlg, IDC_COLOR, IsDlgButtonChecked(hwndDlg, IDC_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
+ CheckDlgButton(hwndDlg, IDC_SRMM_COLOR, IsDlgButtonChecked(hwndDlg, IDC_SRMM_COLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_COLOR, 0), 0);
return TRUE;
}
if (wParam == VK_SPACE && isCtrl && !isAlt) { // ctrl-space (paste clean text)
- CheckDlgButton(hwndDlg, IDC_BKGCOLOR, BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_COLOR, BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_BOLD, BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_UNDERLINE, BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ITALICS, BST_UNCHECKED);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_COLOR, 0), 0);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BOLD, 0), 0);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_UNDERLINE, 0), 0);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ITALICS, 0), 0);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BKGCOLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_COLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BOLD, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_UNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_ITALICS, BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BKGCOLOR, 0), 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_COLOR, 0), 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BOLD, 0), 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_UNDERLINE, 0), 0);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_ITALICS, 0), 0);
return TRUE;
}
if (wParam == 0x4c && isCtrl && !isAlt) { // ctrl-l (paste clean text)
- CheckDlgButton(hwndDlg, IDC_BKGCOLOR, IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BKGCOLOR, 0), 0);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BKGCOLOR, IsDlgButtonChecked(hwndDlg, IDC_SRMM_BKGCOLOR) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_BKGCOLOR, 0), 0);
return TRUE;
}
if (wParam == 0x46 && isCtrl && !isAlt) { // ctrl-f (paste clean text)
- if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FILTER)))
- SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_FILTER, 0), 0);
+ if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_SRMM_FILTER)))
+ SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SRMM_FILTER, 0), 0);
return TRUE;
}
@@ -492,7 +492,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
if (pmi->bColor) {
int index = GetColorIndex(dat->si->pszModule, cf.crTextColor);
- UINT u = IsDlgButtonChecked(hwndDlg, IDC_COLOR);
+ UINT u = IsDlgButtonChecked(hwndDlg, IDC_SRMM_COLOR);
if (index >= 0) {
pDlg->m_bFGSet = true;
@@ -500,54 +500,54 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
if (u == BST_UNCHECKED && cf.crTextColor != g_Settings.MessageAreaColor)
- CheckDlgButton(hwndDlg, IDC_COLOR, BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_COLOR, BST_CHECKED);
else if (u == BST_CHECKED && cf.crTextColor == g_Settings.MessageAreaColor)
- CheckDlgButton(hwndDlg, IDC_COLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_COLOR, BST_UNCHECKED);
}
if (pmi->bBkgColor) {
int index = GetColorIndex(dat->si->pszModule, cf.crBackColor);
COLORREF crB = (COLORREF)db_get_dw(0, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
- UINT u = IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR);
+ UINT u = IsDlgButtonChecked(hwndDlg, IDC_SRMM_BKGCOLOR);
if (index >= 0) {
pDlg->m_bBGSet = TRUE;
pDlg->m_iBG = index;
}
if (u == BST_UNCHECKED && cf.crBackColor != crB)
- CheckDlgButton(hwndDlg, IDC_BKGCOLOR, BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BKGCOLOR, BST_CHECKED);
else if (u == BST_CHECKED && cf.crBackColor == crB)
- CheckDlgButton(hwndDlg, IDC_BKGCOLOR, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BKGCOLOR, BST_UNCHECKED);
}
if (pmi->bBold) {
- UINT u = IsDlgButtonChecked(hwndDlg, IDC_BOLD);
+ UINT u = IsDlgButtonChecked(hwndDlg, IDC_SRMM_BOLD);
UINT u2 = cf.dwEffects;
u2 &= CFE_BOLD;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(hwndDlg, IDC_BOLD, BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BOLD, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(hwndDlg, IDC_BOLD, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_BOLD, BST_UNCHECKED);
}
if (pmi->bItalics) {
- UINT u = IsDlgButtonChecked(hwndDlg, IDC_ITALICS);
+ UINT u = IsDlgButtonChecked(hwndDlg, IDC_SRMM_ITALICS);
UINT u2 = cf.dwEffects;
u2 &= CFE_ITALIC;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(hwndDlg, IDC_ITALICS, BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_ITALICS, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(hwndDlg, IDC_ITALICS, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_ITALICS, BST_UNCHECKED);
}
if (pmi->bUnderline) {
- UINT u = IsDlgButtonChecked(hwndDlg, IDC_UNDERLINE);
+ UINT u = IsDlgButtonChecked(hwndDlg, IDC_SRMM_UNDERLINE);
UINT u2 = cf.dwEffects;
u2 &= CFE_UNDERLINE;
if (u == BST_UNCHECKED && u2)
- CheckDlgButton(hwndDlg, IDC_UNDERLINE, BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_UNDERLINE, BST_CHECKED);
else if (u == BST_CHECKED && u2 == 0)
- CheckDlgButton(hwndDlg, IDC_UNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SRMM_UNDERLINE, BST_UNCHECKED);
}
}
break;
@@ -819,14 +819,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
m_btnOk(this, IDOK),
- m_btnBold(this, IDC_BOLD),
- m_btnItalic(this, IDC_ITALICS),
- m_btnUnderline(this, IDC_UNDERLINE),
-
- m_btnColor(this, IDC_COLOR),
- m_btnBkColor(this, IDC_BKGCOLOR),
-
- m_btnFilter(this, IDC_FILTER),
m_btnHistory(this, IDC_HISTORY),
m_btnNickList(this, IDC_SHOWNICKLIST),
m_btnChannelMgr(this, IDC_CHANMGR),
@@ -836,9 +828,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
{
m_pLog = &m_log;
m_pEntry = &m_message;
- m_pColor = &m_btnColor;
- m_pBkColor = &m_btnBkColor;
- m_pFilter = &m_btnFilter;
m_autoClose = 0;
m_forceResizable = true;
@@ -847,9 +836,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
m_btnItalic.OnClick = Callback(this, &CChatRoomDlg::onClick_Bold);
m_btnUnderline.OnClick = Callback(this, &CChatRoomDlg::onClick_Bold);
- m_btnColor.OnClick = Callback(this, &CChatRoomDlg::onClick_Color);
- m_btnBkColor.OnClick = Callback(this, &CChatRoomDlg::onClick_BkColor);
-
m_btnOk.OnClick = Callback(this, &CChatRoomDlg::onClick_Ok);
m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::onClick_Filter);
@@ -953,63 +939,13 @@ void CChatRoomDlg::onClick_Bold(CCtrlButton *pButton)
cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE;
cf.dwEffects = 0;
switch (pButton->GetCtrlId()) {
- case IDC_BOLD: cf.dwEffects |= CFE_BOLD; break;
- case IDC_ITALICS: cf.dwEffects |= CFE_ITALIC; break;
- case IDC_UNDERLINE: cf.dwEffects |= CFE_UNDERLINE; break;
+ case IDC_SRMM_BOLD: cf.dwEffects |= CFE_BOLD; break;
+ case IDC_SRMM_ITALICS: cf.dwEffects |= CFE_ITALIC; break;
+ case IDC_SRMM_UNDERLINE: cf.dwEffects |= CFE_UNDERLINE; break;
}
m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
-void CChatRoomDlg::onClick_Color(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_COLOR)) {
- if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0)
- ShowColorChooser(IDC_COLOR);
- else if (m_bFGSet) {
- cf.dwMask = CFM_COLOR;
- cf.crTextColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_iFG];
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
- }
- else {
- cf.dwMask = CFM_COLOR;
- cf.crTextColor = g_Settings.MessageAreaColor;
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
-}
-
-void CChatRoomDlg::onClick_BkColor(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwEffects = 0;
-
- if (IsDlgButtonChecked(m_hwnd, IDC_BKGCOLOR)) {
- if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0)
- ShowColorChooser(IDC_BKGCOLOR);
- else if (m_bBGSet) {
- cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = pci->MM_FindModule(m_si->pszModule)->crColors[m_iBG];
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
- }
- else {
- cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = (COLORREF)db_get_dw(0, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
- }
-}
-
void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton)
{
if (!pButton->Enabled())
@@ -1208,6 +1144,12 @@ void CChatRoomDlg::CloseTab()
Close();
}
+void CChatRoomDlg::LoadSettings()
+{
+ m_clrInputBG = db_get_dw(0, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
+ LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &m_clrInputFG);
+}
+
void CChatRoomDlg::RedrawLog()
{
m_si->LastTime = 0;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 4e46cc2188..e81d16e3a9 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -316,35 +316,35 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
// chat buttons
bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID;
- bbd.dwButtonID = IDC_BOLD;
+ bbd.dwButtonID = IDC_SRMM_BOLD;
bbd.dwDefPos = 10;
bbd.hIcon = GetIconHandle("bold");
bbd.pwszText = LPGENW("&Bold");
bbd.pwszTooltip = LPGENW("Make the text bold (CTRL+B)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_ITALICS;
+ bbd.dwButtonID = IDC_SRMM_ITALICS;
bbd.dwDefPos = 15;
bbd.hIcon = GetIconHandle("italics");
bbd.pwszText = LPGENW("&Italic");
bbd.pwszTooltip = LPGENW("Make the text italicized (CTRL+I)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_UNDERLINE;
+ bbd.dwButtonID = IDC_SRMM_UNDERLINE;
bbd.dwDefPos = 20;
bbd.hIcon = GetIconHandle("underline");
bbd.pwszText = LPGENW("&Underline");
bbd.pwszTooltip = LPGENW("Make the text underlined (CTRL+U)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_COLOR;
+ bbd.dwButtonID = IDC_SRMM_COLOR;
bbd.dwDefPos = 25;
bbd.hIcon = GetIconHandle("fgcol");
bbd.pwszText = LPGENW("&Color");
bbd.pwszTooltip = LPGENW("Select a foreground color for the text (CTRL+K)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_BKGCOLOR;
+ bbd.dwButtonID = IDC_SRMM_BKGCOLOR;
bbd.dwDefPos = 30;
bbd.hIcon = GetIconHandle("bkgcol");
bbd.pwszText = LPGENW("&Background color");
@@ -366,7 +366,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
bbd.pwszTooltip = LPGENW("Show/hide the nick list (CTRL+N)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_FILTER;
+ bbd.dwButtonID = IDC_SRMM_FILTER;
bbd.dwDefPos = 10;
bbd.hIcon = GetIconHandle("filter");
bbd.pwszText = LPGENW("&Filter");
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index f170e5213f..5d12330fe3 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -102,6 +102,7 @@ public:
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ virtual void LoadSettings() override {}
virtual void UpdateTitle() override {}
void OnSplitterMoved(CSplitter*);
@@ -119,7 +120,6 @@ public:
INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int DbEventIsForMsgWindow(DBEVENTINFO *dbei);
int DbEventIsShown(DBEVENTINFO *dbei);
-void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend);
int SendMessageDirect(const wchar_t *szMsg, MCONTACT hContact);
INT_PTR SendMessageCmd(MCONTACT hContact, char *msg, int isWchar);
diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h
index 9a6ad1345f..d07e2b302a 100644
--- a/src/core/stdmsg/src/resource.h
+++ b/src/core/stdmsg/src/resource.h
@@ -70,15 +70,9 @@
#define IDC_AUTOMIN 1005
#define IDC_DONOTSTEALFOCUS 1006
#define IDC_SPLITTERY 1008
-#define IDC_BOLD 1010
-#define IDC_ITALICS 1011
-#define IDC_UNDERLINE 1012
-#define IDC_FILTER 1013
#define IDC_CHANMGR 1014
#define IDC_SHOWNICKLIST 1016
-#define IDC_COLOR 1017
#define IDC_CHECKBOXES 1018
-#define IDC_BKGCOLOR 1019
#define IDC_NICKLISTBKG 1021
#define IDC_HISTORY 1022
#define IDC_NICKROW 1024
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index 7e7f77e9c7..ec0d18a764 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -219,8 +219,7 @@ class CChatRoomDlg : public CSrmmBaseDialog
CCtrlEdit m_message, m_log;
CCtrlListBox m_nickList;
CCtrlButton m_btnOk;
- CCtrlButton m_btnFilter, m_btnChannelMgr, m_btnNickList, m_btnHistory;
- CCtrlButton m_btnBold, m_btnItalic, m_btnUnderline, m_btnColor, m_btnBkColor;
+ CCtrlButton m_btnChannelMgr, m_btnNickList, m_btnHistory;
CSplitter m_splitterX, m_splitterY;
HWND getCaptionWindow() const
@@ -242,6 +241,7 @@ public:
virtual int Resizer(UTILRESIZECONTROL *urc) override;
virtual void CloseTab() override;
+ virtual void LoadSettings() override;
virtual void RedrawLog() override;
virtual void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
virtual void ScrollToBottom() override;
@@ -252,8 +252,6 @@ public:
virtual void UpdateTitle() override;
void onClick_Bold(CCtrlButton*);
- void onClick_Color(CCtrlButton*);
- void onClick_BkColor(CCtrlButton*);
void onClick_Ok(CCtrlButton*);
diff --git a/src/mir_app/src/colorchooser.cpp b/src/mir_app/src/colorchooser.cpp
index 731239b8c1..6422e4020a 100644
--- a/src/mir_app/src/colorchooser.cpp
+++ b/src/mir_app/src/colorchooser.cpp
@@ -267,6 +267,6 @@ public:
void CSrmmBaseDialog::ShowColorChooser(int iCtrlId)
{
- CColorChooserDlg *pDialog = new CColorChooserDlg(m_si, iCtrlId == m_pColor->GetCtrlId(), m_hwnd, m_pEntry->GetHwnd(), GetDlgItem(m_hwnd, iCtrlId));
+ CColorChooserDlg *pDialog = new CColorChooserDlg(m_si, iCtrlId == IDC_SRMM_COLOR, m_hwnd, m_pEntry->GetHwnd(), GetDlgItem(m_hwnd, iCtrlId));
pDialog->Show();
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 1d15af6551..fb6970252c 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -400,9 +400,9 @@ ProtoGetAvatarFormatByMimeType @400
ProtoGetAvatarMimeType @401
?set_uin@DB_AUTH_BLOB@@QAEXK@Z @402 NONAME
??0CSrmmBaseDialog@@IAE@PAUHINSTANCE__@@HPAUSESSION_INFO@@@Z @403 NONAME
-??0CSrmmBaseDialog@@QAE@ABV0@@Z @404 NONAME
+??0CSrmmBaseDialog@@AAE@ABV0@@Z @404 NONAME
??1CSrmmBaseDialog@@UAE@XZ @405 NONAME
-??4CSrmmBaseDialog@@QAEAAV0@ABV0@@Z @406 NONAME
+??4CSrmmBaseDialog@@AAEAAV0@ABV0@@Z @406 NONAME
??_7CSrmmBaseDialog@@6B@ @407 NONAME
?DlgProc@CSrmmBaseDialog@@MAEHIIJ@Z @408 NONAME
??2CSrmmBaseDialog@@SAPAXI@Z @409 NONAME
@@ -426,3 +426,6 @@ _Srmm_ButtonSubclassProc@16 @423 NONAME
?ScrollToBottom@CSrmmBaseDialog@@UAEXXZ @427 NONAME
?UpdateNickList@CSrmmBaseDialog@@UAEXXZ @428 NONAME
Clist_ClearSearch @429 NONAME
+?onClick_BIU@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @430 NONAME
+?onClick_BkColor@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @431 NONAME
+?onClick_Color@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @432 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 0802a90a7f..7f8659dd96 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -400,9 +400,9 @@ ProtoGetAvatarFormatByMimeType @400
ProtoGetAvatarMimeType @401
?set_uin@DB_AUTH_BLOB@@QEAAXK@Z @402 NONAME
??0CSrmmBaseDialog@@IEAA@PEAUHINSTANCE__@@HPEAUSESSION_INFO@@@Z @403 NONAME
-??0CSrmmBaseDialog@@QEAA@AEBV0@@Z @404 NONAME
+??0CSrmmBaseDialog@@AEAA@AEBV0@@Z @404 NONAME
??1CSrmmBaseDialog@@UEAA@XZ @405 NONAME
-??4CSrmmBaseDialog@@QEAAAEAV0@AEBV0@@Z @406 NONAME
+??4CSrmmBaseDialog@@AEAAAEAV0@AEBV0@@Z @406 NONAME
??_7CSrmmBaseDialog@@6B@ @407 NONAME
?DlgProc@CSrmmBaseDialog@@MEAA_JI_K_J@Z @408 NONAME
??2CSrmmBaseDialog@@SAPEAX_K@Z @409 NONAME
@@ -426,3 +426,6 @@ Srmm_ButtonSubclassProc @423 NONAME
?ScrollToBottom@CSrmmBaseDialog@@UEAAXXZ @427 NONAME
?UpdateNickList@CSrmmBaseDialog@@UEAAXXZ @428 NONAME
Clist_ClearSearch @429 NONAME
+?onClick_BIU@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @430 NONAME
+?onClick_BkColor@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @431 NONAME
+?onClick_Color@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @432 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index 8df17b3fd7..d95ed32a65 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -29,18 +29,27 @@ extern HCURSOR g_hCurHyperlinkHand;
CSrmmBaseDialog::CSrmmBaseDialog(HINSTANCE hInst, int idDialog, SESSION_INFO *si)
: CDlgBase(hInst, idDialog),
+ m_btnFilter(this, IDC_SRMM_FILTER),
+ m_btnColor(this, IDC_SRMM_COLOR),
+ m_btnBkColor(this, IDC_SRMM_BKGCOLOR),
+ m_btnBold(this, IDC_SRMM_BOLD),
+ m_btnItalic(this, IDC_SRMM_ITALICS),
+ m_btnUnderline(this, IDC_SRMM_UNDERLINE),
+
m_si(si),
m_pLog(nullptr),
m_pEntry(nullptr),
- m_pFilter(nullptr),
- m_pColor(nullptr),
- m_pBkColor(nullptr),
- m_hContact(0)
+ m_hContact(0),
+ m_clrInputBG(GetSysColor(COLOR_WINDOW))
{
m_bFilterEnabled = db_get_b(0, CHAT_MODULE, "FilterEnabled", 0) != 0;
m_bNicklistEnabled = db_get_b(0, CHAT_MODULE, "ShowNicklist", 1) != 0;
m_iLogFilterFlags = db_get_dw(0, CHAT_MODULE, "FilterFlags", 0x03E0);
+ m_btnColor.OnClick = Callback(this, &CSrmmBaseDialog::onClick_Color);
+ m_btnBkColor.OnClick = Callback(this, &CSrmmBaseDialog::onClick_BkColor);
+ m_btnBold.OnClick = m_btnItalic.OnClick = m_btnUnderline.OnClick = Callback(this, &CSrmmBaseDialog::onClick_BIU);
+
if (si) {
m_hContact = si->hContact;
@@ -58,6 +67,18 @@ CSrmmBaseDialog::CSrmmBaseDialog(HINSTANCE hInst, int idDialog, SESSION_INFO *si
}
}
+CSrmmBaseDialog::CSrmmBaseDialog(const CSrmmBaseDialog&) :
+ CDlgBase(0, 0),
+ m_btnColor(0, 0), m_btnBkColor(0, 0), m_btnFilter(0, 0),
+ m_btnBold(0, 0), m_btnItalic(0, 0), m_btnUnderline(0, 0)
+{
+}
+
+CSrmmBaseDialog& CSrmmBaseDialog::operator=(const CSrmmBaseDialog&)
+{
+ return *this;
+}
+
INT_PTR CSrmmBaseDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
@@ -180,3 +201,70 @@ void CSrmmBaseDialog::RedrawLog2()
if (m_si->pLog)
StreamInEvents(m_si->pLogEnd, TRUE);
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void CSrmmBaseDialog::onClick_Color(CCtrlButton *pButton)
+{
+ if (!pButton->Enabled())
+ return;
+
+ CHARFORMAT2 cf;
+ cf.cbSize = sizeof(CHARFORMAT2);
+ cf.dwEffects = 0;
+ cf.dwMask = CFM_COLOR;
+
+ if (IsDlgButtonChecked(m_hwnd, pButton->GetCtrlId())) {
+ if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0) {
+ ShowColorChooser(pButton->GetCtrlId());
+ return;
+ }
+ if (m_bFGSet)
+ cf.crTextColor = chatApi.MM_FindModule(m_si->pszModule)->crColors[m_iFG];
+ }
+ else cf.crTextColor = m_clrInputFG;
+
+ m_pEntry->SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
+}
+
+void CSrmmBaseDialog::onClick_BkColor(CCtrlButton *pButton)
+{
+ if (!pButton->Enabled())
+ return;
+
+ CHARFORMAT2 cf;
+ cf.cbSize = sizeof(CHARFORMAT2);
+ cf.dwEffects = 0;
+ cf.dwMask = CFM_BACKCOLOR;
+
+ if (IsDlgButtonChecked(m_hwnd, pButton->GetCtrlId())) {
+ if (!db_get_b(0, CHAT_MODULE, "RightClickFilter", 0)) {
+ ShowColorChooser(pButton->GetCtrlId());
+ return;
+ }
+ if (m_bBGSet)
+ cf.crBackColor = chatApi.MM_FindModule(m_si->pszModule)->crColors[m_iBG];
+ }
+ else cf.crBackColor = m_clrInputBG;
+
+ m_pEntry->SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
+}
+
+void CSrmmBaseDialog::onClick_BIU(CCtrlButton *pButton)
+{
+ if (!pButton->Enabled())
+ return;
+
+ CHARFORMAT2 cf;
+ cf.cbSize = sizeof(CHARFORMAT2);
+ cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE;
+ cf.dwEffects = 0;
+
+ if (IsDlgButtonChecked(m_hwnd, IDC_SRMM_BOLD))
+ cf.dwEffects |= CFE_BOLD;
+ if (IsDlgButtonChecked(m_hwnd, IDC_SRMM_ITALICS))
+ cf.dwEffects |= CFE_ITALIC;
+ if (IsDlgButtonChecked(m_hwnd, IDC_SRMM_UNDERLINE))
+ cf.dwEffects |= CFE_UNDERLINE;
+ m_pEntry->SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
+}
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp
index e9aeffc33c..d1b8be54cd 100644
--- a/src/mir_app/src/srmm_util.cpp
+++ b/src/mir_app/src/srmm_util.cpp
@@ -82,12 +82,19 @@ EXTERN_C MIR_APP_DLL(LRESULT) CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT m
if (pDlg == nullptr)
break;
- if (hwnd == pDlg->m_pFilter->GetHwnd())
+ switch (GetDlgCtrlID(hwnd)) {
+ case IDC_SRMM_FILTER:
pDlg->ShowFilterMenu();
- else if (hwnd == pDlg->m_pColor->GetHwnd())
- pDlg->ShowColorChooser(pDlg->m_pColor->GetCtrlId());
- else if (hwnd == pDlg->m_pBkColor->GetHwnd())
- pDlg->ShowColorChooser(pDlg->m_pBkColor->GetCtrlId());
+ break;
+
+ case IDC_SRMM_COLOR:
+ pDlg->ShowColorChooser(IDC_SRMM_COLOR);
+ break;
+
+ case IDC_SRMM_BKGCOLOR:
+ pDlg->ShowColorChooser(IDC_SRMM_BKGCOLOR);
+ break;
+ }
}
break;
}