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 | |
parent | b9e9f7760aa47c8ac230ffcfaba04a196897a712 (diff) |
- fix for button codes in tabSRMM;
- CSrmmBaseDialog::ProcessHotkeys to receives control keys statuses as well
-rw-r--r-- | include/m_chat_int.h | 2 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 113562 -> 113582 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 109068 -> 109088 bytes | |||
-rw-r--r-- | plugins/Scriver/src/chat_window.cpp | 2 | ||||
-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 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 4 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 4 | ||||
-rw-r--r-- | src/mir_app/src/srmm_base.cpp | 5 |
14 files changed, 40 insertions, 45 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index e787173971..203c6b343b 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -402,7 +402,7 @@ protected: virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void DoEventHook(int iType, const USERINFO *pUser, const wchar_t *pszText, INT_PTR dwItem);
- bool ProcessHotkeys(int key);
+ bool ProcessHotkeys(int key, bool bShift, bool bCtrl, bool bAlt);
void RefreshButtonStatus(void);
protected:
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 41af1a5183..8c0e0abcfb 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex fa88f295f8..0adb28ee39 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index a57895fc2b..d0bd3109b5 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -194,7 +194,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w dat->szSearchResult = nullptr;
}
- if (pDlg->ProcessHotkeys(wParam))
+ if (pDlg->ProcessHotkeys(wParam, isShift, isCtrl, isAlt))
return TRUE;
if (wParam == 0x4e && isCtrl && !isAlt) { // ctrl-n (nicklist)
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
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 5fdab6eb00..00d2d4ad99 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -269,7 +269,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w dat->szTabSave[0] = '\0'; } - if (pDlg->ProcessHotkeys(wParam)) + if (pDlg->ProcessHotkeys(wParam, isShift, isCtrl, isAlt)) return TRUE; if (wParam == 0x46 && isCtrl && !isAlt) { // ctrl-f (paste clean text) diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index da3ee660ea..db7b8fded0 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -429,5 +429,5 @@ 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
-?ProcessHotkeys@CSrmmBaseDialog@@IAE_NH@Z @433 NONAME
-?RefreshButtonStatus@CSrmmBaseDialog@@IAEXXZ @434 NONAME
+?RefreshButtonStatus@CSrmmBaseDialog@@IAEXXZ @433 NONAME
+?ProcessHotkeys@CSrmmBaseDialog@@IAE_NH_N00@Z @434 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index cd572cd7e2..06e3fcb09b 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -429,5 +429,5 @@ 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
-?ProcessHotkeys@CSrmmBaseDialog@@IEAA_NH@Z @433 NONAME
-?RefreshButtonStatus@CSrmmBaseDialog@@IEAAXXZ @434 NONAME
+?RefreshButtonStatus@CSrmmBaseDialog@@IEAAXXZ @433 NONAME
+?ProcessHotkeys@CSrmmBaseDialog@@IEAA_NH_N00@Z @434 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 81c4af1b38..6299bb6bf0 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -311,11 +311,8 @@ void CSrmmBaseDialog::onClick_BIU(CCtrlButton *pButton) ///////////////////////////////////////////////////////////////////////////////////////// -bool CSrmmBaseDialog::ProcessHotkeys(int key) +bool CSrmmBaseDialog::ProcessHotkeys(int key, bool /*isShift*/, bool isCtrl, bool isAlt) { - BOOL isCtrl = GetKeyState(VK_CONTROL) & 0x8000; - BOOL isAlt = GetKeyState(VK_MENU) & 0x8000; - if (key == VK_F4 && isCtrl && !isAlt) { // ctrl-F4 (close tab) CloseTab(); return true; |