From 5268eaf791d272a8e723d9c3533ab714427bb114 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 17 Oct 2024 19:41:54 +0300 Subject: =?UTF-8?q?fixes=20#4743=20(StdMsg,=20Scriver:=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B5=20"=D0=BE=D1=82=D0=B6=D0=B8=D0=BC=D0=B0=D1=8E=D1=82?= =?UTF-8?q?=D1=81=D1=8F")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/TabSRMM/src/buttonsbar.cpp | 2 +- plugins/TabSRMM/src/generic_msghandlers.cpp | 2 +- plugins/TabSRMM/src/msgdialog.cpp | 47 ++--------------------------- plugins/TabSRMM/src/resource.h | 1 - 4 files changed, 4 insertions(+), 48 deletions(-) (limited to 'plugins/TabSRMM') diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 28bb14993e..95a49fe61b 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -40,7 +40,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) g_plugin.addButton(&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID | BBBF_NOREADONLY; - bbd.dwButtonID = IDC_FONTSTRIKEOUT; + bbd.dwButtonID = IDC_SRMM_STRIKEOUT; bbd.dwDefPos = 70; bbd.hIcon = g_plugin.getIconHandle(IDI_STRIKEOUT); bbd.pwszTooltip = LPGENW("Strike-through text"); diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 12f4643670..562349588c 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -172,7 +172,7 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara case IDC_SRMM_BOLD: case IDC_SRMM_ITALICS: case IDC_SRMM_UNDERLINE: - case IDC_FONTSTRIKEOUT: + case IDC_SRMM_STRIKEOUT: if (m_bSendFormat) { // dont use formatting if disabled auto *pCtrl = (CCtrlButton*)FindControl(cmd); if (!pCtrl->Enabled()) diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index a0fdd09f57..2a1f028379 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -35,7 +35,7 @@ LIST g_arUnreadWindows(1, PtrKeySortT); static int g_cLinesPerPage = 0; static int g_iWheelCarryover = 0; -static const UINT formatControls[] = { IDC_SRMM_BOLD, IDC_SRMM_ITALICS, IDC_SRMM_UNDERLINE, IDC_FONTSTRIKEOUT }; +static const UINT formatControls[] = { IDC_SRMM_BOLD, IDC_SRMM_ITALICS, IDC_SRMM_UNDERLINE, IDC_SRMM_STRIKEOUT }; static const UINT addControls[] = { IDC_ADD, IDC_CANCELADD }; static const UINT btnControls[] = { IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER, IDC_ADD, IDC_CANCELADD }; static const UINT errorControls[] = { IDC_STATICERRORICON, IDC_STATICTEXT, IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER }; @@ -326,7 +326,7 @@ CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) : m_btnAdd(this, IDC_ADD), m_btnQuote(this, IDC_QUOTE), m_btnCancelAdd(this, IDC_CANCELADD), - m_btnStrikeout(this, IDC_FONTSTRIKEOUT) + m_btnStrikeout(this, IDC_SRMM_STRIKEOUT) { m_hContact = hContact; @@ -571,9 +571,6 @@ bool CMsgDialog::OnInitDialog() UpdateTitle(); m_hTabIcon = m_hTabStatusIcon; - if (!m_bSendFormat) - ShowMultipleControls(m_hwnd, formatControls, _countof(formatControls), SW_HIDE); - UpdateNickList(); UpdateChatLog(); } @@ -1665,46 +1662,6 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter) return 0; } } - - if ((msg == WM_LBUTTONDOWN || msg == WM_KEYUP || msg == WM_LBUTTONUP) && pFilter->nmhdr.idFrom == IDC_SRMM_MESSAGE) { - int bBold = IsDlgButtonChecked(m_hwnd, IDC_SRMM_BOLD); - int bItalic = IsDlgButtonChecked(m_hwnd, IDC_SRMM_ITALICS); - int bUnder = IsDlgButtonChecked(m_hwnd, IDC_SRMM_UNDERLINE); - int bStrikeout = IsDlgButtonChecked(m_hwnd, IDC_FONTSTRIKEOUT); - - CHARFORMAT2 cf2; - cf2.cbSize = sizeof(CHARFORMAT2); - cf2.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_UNDERLINETYPE | CFM_STRIKEOUT; - cf2.dwEffects = 0; - m_message.SendMsg(EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2); - if (cf2.dwEffects & CFE_BOLD) { - if (bBold == BST_UNCHECKED) - CheckDlgButton(m_hwnd, IDC_SRMM_BOLD, BST_CHECKED); - } - else if (bBold == BST_CHECKED) - CheckDlgButton(m_hwnd, IDC_SRMM_BOLD, BST_UNCHECKED); - - if (cf2.dwEffects & CFE_ITALIC) { - if (bItalic == BST_UNCHECKED) - CheckDlgButton(m_hwnd, IDC_SRMM_ITALICS, BST_CHECKED); - } - else if (bItalic == BST_CHECKED) - CheckDlgButton(m_hwnd, IDC_SRMM_ITALICS, BST_UNCHECKED); - - if (cf2.dwEffects & CFE_UNDERLINE && (cf2.bUnderlineType & CFU_UNDERLINE || cf2.bUnderlineType & CFU_UNDERLINEWORD)) { - if (bUnder == BST_UNCHECKED) - CheckDlgButton(m_hwnd, IDC_SRMM_UNDERLINE, BST_CHECKED); - } - else if (bUnder == BST_CHECKED) - CheckDlgButton(m_hwnd, IDC_SRMM_UNDERLINE, BST_UNCHECKED); - - if (cf2.dwEffects & CFE_STRIKEOUT) { - if (bStrikeout == BST_UNCHECKED) - CheckDlgButton(m_hwnd, IDC_FONTSTRIKEOUT, BST_CHECKED); - } - else if (bStrikeout == BST_CHECKED) - CheckDlgButton(m_hwnd, IDC_FONTSTRIKEOUT, BST_UNCHECKED); - } switch (msg) { case WM_LBUTTONDOWN: diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index b9eb8f84a4..50b07bab75 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -193,7 +193,6 @@ #define IDC_ADD 1101 #define IDC_RTL 1103 #define IDC_CANCELADD 1112 -#define IDC_FONTSTRIKEOUT 1113 #define IDC_MATH_BKGCOLOUR 1124 #define IDC_FONTCOLOR 1127 #define IDC_LOGFROZENTEXT 1128 -- cgit v1.2.3