diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-21 22:11:50 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-21 22:11:50 +0300 |
commit | 2dda3af35cf70b8ed614f88455a30090e5befc2f (patch) | |
tree | dfdb314943eab15ee185087ff3a6c1c510ed0e04 /plugins/TabSRMM/src | |
parent | b9e9f7760aa47c8ac230ffcfaba04a196897a712 (diff) |
- fix for button codes in tabSRMM;
- CSrmmBaseDialog::ProcessHotkeys to receives control keys statuses as well
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 24 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 26 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/resource.h | 3 |
6 files changed, 32 insertions, 34 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index c8a37d33d7..832f985288 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -21,19 +21,19 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) Srmm_AddButton(&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_FONTBOLD; + bbd.dwButtonID = IDC_SRMM_BOLD; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; bbd.pwszTooltip = LPGENW("Bold text"); Srmm_AddButton(&bbd); - bbd.dwButtonID = IDC_FONTITALIC; + bbd.dwButtonID = IDC_SRMM_ITALICS; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; bbd.pwszTooltip = LPGENW("Italic text"); Srmm_AddButton(&bbd); - bbd.dwButtonID = IDC_FONTUNDERLINE; + bbd.dwButtonID = IDC_SRMM_UNDERLINE; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; bbd.pwszTooltip = LPGENW("Underlined text"); diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index efd524d576..331bd3da2e 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -607,8 +607,6 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w return 0; } - if (pDlg->ProcessHotkeys(wParam)) - return true; break; case WM_KEYDOWN: @@ -618,6 +616,9 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w if (PluginConfig.m_bSoundOnTyping && !isAlt && wParam == VK_DELETE) SkinPlaySound("SoundOnTyping"); + if (pDlg->ProcessHotkeys(wParam, isShift, isCtrl, isAlt)) + return true; + if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) { pDlg->m_bInsertMode = !pDlg->m_bInsertMode; SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM)hwnd); diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 17e24dac43..4855dc94c7 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -173,9 +173,9 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar HMENU submenu; switch (cmd) { - case IDC_FONTBOLD: - case IDC_FONTITALIC: - case IDC_FONTUNDERLINE: + case IDC_SRMM_BOLD: + case IDC_SRMM_ITALICS: + case IDC_SRMM_UNDERLINE: case IDC_FONTSTRIKEOUT: if (m_SendFormat != 0) { // dont use formatting if disabled CHARFORMAT2 cf, cfOld; @@ -190,28 +190,28 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar BOOL isStrikeout = (cfOld.dwEffects & CFM_STRIKEOUT) && (cfOld.dwMask & CFM_STRIKEOUT); int ctrlId = LOWORD(wParam); - if (ctrlId == IDC_FONTBOLD && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_FONTBOLD))) + if (ctrlId == IDC_SRMM_BOLD && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_SRMM_BOLD))) break; - if (ctrlId == IDC_FONTITALIC && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_FONTITALIC))) + if (ctrlId == IDC_SRMM_ITALICS && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_SRMM_ITALICS))) break; - if (ctrlId == IDC_FONTUNDERLINE && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_FONTUNDERLINE))) + if (ctrlId == IDC_SRMM_UNDERLINE && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_SRMM_UNDERLINE))) break; if (ctrlId == IDC_FONTSTRIKEOUT && !IsWindowEnabled(GetDlgItem(m_hwnd, IDC_FONTSTRIKEOUT))) break; - if (ctrlId == IDC_FONTBOLD) { + if (ctrlId == IDC_SRMM_BOLD) { cf.dwEffects = isBold ? 0 : CFE_BOLD; cf.dwMask = CFM_BOLD; - CheckDlgButton(m_hwnd, IDC_FONTBOLD, !isBold ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(m_hwnd, IDC_SRMM_BOLD, !isBold ? BST_CHECKED : BST_UNCHECKED); } - else if (ctrlId == IDC_FONTITALIC) { + else if (ctrlId == IDC_SRMM_ITALICS) { cf.dwEffects = isItalic ? 0 : CFE_ITALIC; cf.dwMask = CFM_ITALIC; - CheckDlgButton(m_hwnd, IDC_FONTITALIC, !isItalic ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(m_hwnd, IDC_SRMM_ITALICS, !isItalic ? BST_CHECKED : BST_UNCHECKED); } - else if (ctrlId == IDC_FONTUNDERLINE) { + else if (ctrlId == IDC_SRMM_UNDERLINE) { cf.dwEffects = isUnderline ? 0 : CFE_UNDERLINE; cf.dwMask = CFM_UNDERLINE; - CheckDlgButton(m_hwnd, IDC_FONTUNDERLINE, !isUnderline ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(m_hwnd, IDC_SRMM_UNDERLINE, !isUnderline ? BST_CHECKED : BST_UNCHECKED); } else if (ctrlId == IDC_FONTSTRIKEOUT) { cf.dwEffects = isStrikeout ? 0 : CFM_STRIKEOUT; diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 0c1c6fbad8..32ebdcf0ee 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -33,7 +33,7 @@ bool IsStringValidLink(wchar_t *pszText);
static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
-static const UINT formatControls[] = { IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTSTRIKEOUT };
+static const UINT formatControls[] = { IDC_SRMM_BOLD, IDC_SRMM_ITALICS, IDC_SRMM_UNDERLINE, IDC_FONTSTRIKEOUT };
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 };
@@ -552,15 +552,15 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar switch (wParam) {
case 0x02: // bold
if (mwdat->m_SendFormat)
- SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTBOLD, IDC_MESSAGE), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_SRMM_BOLD, IDC_MESSAGE), 0);
return 0;
case 0x09:
if (mwdat->m_SendFormat)
- SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTITALIC, IDC_MESSAGE), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_SRMM_ITALICS, IDC_MESSAGE), 0);
return 0;
case 21:
if (mwdat->m_SendFormat)
- SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTUNDERLINE, IDC_MESSAGE), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_SRMM_UNDERLINE, IDC_MESSAGE), 0);
return 0;
case 0x0b:
SetWindowText(hwnd, L"");
@@ -2102,9 +2102,9 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter) }
if ((msg == WM_LBUTTONDOWN || msg == WM_KEYUP || msg == WM_LBUTTONUP) && pFilter->nmhdr.idFrom == IDC_MESSAGE) {
- int bBold = IsDlgButtonChecked(m_hwnd, IDC_FONTBOLD);
- int bItalic = IsDlgButtonChecked(m_hwnd, IDC_FONTITALIC);
- int bUnder = IsDlgButtonChecked(m_hwnd, IDC_FONTUNDERLINE);
+ 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;
@@ -2114,24 +2114,24 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter) m_message.SendMsg(EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2);
if (cf2.dwEffects & CFE_BOLD) {
if (bBold == BST_UNCHECKED)
- CheckDlgButton(m_hwnd, IDC_FONTBOLD, BST_CHECKED);
+ CheckDlgButton(m_hwnd, IDC_SRMM_BOLD, BST_CHECKED);
}
else if (bBold == BST_CHECKED)
- CheckDlgButton(m_hwnd, IDC_FONTBOLD, BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SRMM_BOLD, BST_UNCHECKED);
if (cf2.dwEffects & CFE_ITALIC) {
if (bItalic == BST_UNCHECKED)
- CheckDlgButton(m_hwnd, IDC_FONTITALIC, BST_CHECKED);
+ CheckDlgButton(m_hwnd, IDC_SRMM_ITALICS, BST_CHECKED);
}
else if (bItalic == BST_CHECKED)
- CheckDlgButton(m_hwnd, IDC_FONTITALIC, BST_UNCHECKED);
+ 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_FONTUNDERLINE, BST_CHECKED);
+ CheckDlgButton(m_hwnd, IDC_SRMM_UNDERLINE, BST_CHECKED);
}
else if (bUnder == BST_CHECKED)
- CheckDlgButton(m_hwnd, IDC_FONTUNDERLINE, BST_UNCHECKED);
+ CheckDlgButton(m_hwnd, IDC_SRMM_UNDERLINE, BST_UNCHECKED);
if (cf2.dwEffects & CFE_STRIKEOUT) {
if (bStrikeout == BST_UNCHECKED)
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 5d77ec81db..30edac5603 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1181,7 +1181,7 @@ void CTabBaseDlg::PlayIncomingSound() const // reads send format and configures the toolbar buttons
// if mode == 0, int only configures the buttons and does not change send format
-static UINT controls[] = { IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTSTRIKEOUT };
+static UINT controls[] = { IDC_SRMM_BOLD, IDC_SRMM_ITALICS, IDC_SRMM_UNDERLINE, IDC_FONTSTRIKEOUT };
void CTabBaseDlg::GetSendFormat()
{
diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index d90bf10cdf..4bff4ada73 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -181,9 +181,6 @@ #define IDC_DELAY_ERR 1102
#define IDC_RTL 1103
#define IDC_PIC 1104
-#define IDC_FONTBOLD 1106
-#define IDC_FONTITALIC 1107
-#define IDC_FONTUNDERLINE 1108
#define IDC_HISTORY 1111
#define IDC_CANCELADD 1112
#define IDC_FONTSTRIKEOUT 1113
|