summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-17 19:41:54 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-17 19:41:54 +0300
commit5268eaf791d272a8e723d9c3533ab714427bb114 (patch)
tree78b14bcc8abb5ebb06f2b7501b6743ce5a611dd4 /plugins
parentbc2acff2ff61f3f929081798181422e6aceed4fa (diff)
fixes #4743 (StdMsg, Scriver: при отправке сообщения кнопки форматирования не "отжимаются")
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/msgdialog.cpp23
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp2
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp47
-rw-r--r--plugins/TabSRMM/src/resource.h1
5 files changed, 7 insertions, 68 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 2477dcbfa6..3778b66d69 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -1043,29 +1043,12 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
pNmhdr = (LPNMHDR)lParam;
switch (pNmhdr->idFrom) {
case IDC_SRMM_LOG:
- switch (pNmhdr->code) {
- case EN_MSGFILTER:
- {
- int result = InputAreaShortcuts(m_message.GetHwnd(), ((MSGFILTER *)lParam)->msg, ((MSGFILTER *)lParam)->wParam, ((MSGFILTER *)lParam)->lParam);
- if (result != -1) {
- SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, TRUE);
- return TRUE;
- }
- }
-
- switch (((MSGFILTER *)lParam)->msg) {
- case WM_RBUTTONUP:
+ if (pNmhdr->code == EN_MSGFILTER) {
+ int result = InputAreaShortcuts(m_message.GetHwnd(), ((MSGFILTER *)lParam)->msg, ((MSGFILTER *)lParam)->wParam, ((MSGFILTER *)lParam)->lParam);
+ if (result != -1) {
SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, TRUE);
return TRUE;
}
- break;
- }
- break;
-
- case IDC_SRMM_MESSAGE:
- if (pNmhdr->code == EN_MSGFILTER && ((MSGFILTER *)lParam)->msg == WM_RBUTTONUP) {
- SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, TRUE);
- return TRUE;
}
break;
}
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<void> 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