From 0805744c4b2f73149d27f5fbadb767d3d5bd50b1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 3 Dec 2023 15:47:12 +0300 Subject: SRMM: quote panel --- include/chat_resource.h | 2 ++ include/m_srmm_int.h | 6 +++++ libs/win32/mir_app.lib | Bin 273752 -> 274492 bytes libs/win64/mir_app.lib | Bin 273000 -> 273756 bytes plugins/Scriver/res/resource.rc | 6 +++++ plugins/Scriver/src/msgdialog.cpp | 25 +++++++++++-------- plugins/TabSRMM/res/msgwindow.rc | 45 ++++++++++++++++++++------------- plugins/TabSRMM/src/msgdialog.cpp | 51 ++++++++++++++++++++++---------------- plugins/TabSRMM/src/msgs.h | 3 ++- plugins/TabSRMM/src/resource.h | 2 +- src/core/stdmsg/res/resource.rc | 17 +++++++------ src/core/stdmsg/src/msgdialog.cpp | 42 +++++++++++++++++++++++-------- src/core/stdmsg/src/msgs.h | 2 +- src/core/stdmsg/src/resource.h | 16 +++++++++++- src/mir_app/src/mir_app.def | 2 ++ src/mir_app/src/mir_app64.def | 2 ++ src/mir_app/src/srmm_base.cpp | 32 ++++++++++++++++++++++++ 17 files changed, 183 insertions(+), 70 deletions(-) diff --git a/include/chat_resource.h b/include/chat_resource.h index fc31071881..e0b898ed95 100644 --- a/include/chat_resource.h +++ b/include/chat_resource.h @@ -34,3 +34,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IDC_SRMM_NICKLIST 3010 #define IDC_SRMM_LOG 3011 #define IDC_SRMM_MESSAGE 3012 +#define IDC_SRMM_QUOTE 3013 +#define IDC_SRMM_CLOSEQUOTE 3014 diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index a21098ea32..58ecb1ed7d 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -311,6 +311,7 @@ protected: CCtrlRichEdit m_message; SESSION_INFO *m_si; COLORREF m_clrInputBG, m_clrInputFG; + MEVENT m_hQuoteEvent = 0; // user typing support; uint32_t m_nLastTyping = 0; @@ -322,6 +323,9 @@ protected: int m_iNickSearch = -1; CMStringW m_wszNickSearch; + CCtrlBase m_Quote; + CCtrlMButton m_btnCloseQuote; + CCtrlButton m_btnColor, m_btnBkColor, m_btnOk; CCtrlButton m_btnBold, m_btnItalic, m_btnUnderline; CCtrlButton m_btnHistory, m_btnChannelMgr, m_btnNickList, m_btnFilter; @@ -332,6 +336,7 @@ protected: void onClick_ChanMgr(CCtrlButton *); void onClick_History(CCtrlButton *); + void onClick_CloseQuote(CCtrlButton *); void onDblClick_List(CCtrlListBox *); @@ -350,6 +355,7 @@ public: void RedrawLog(); void ScheduleRedrawLog(); void SetMessageText(const wchar_t *pwszText, bool bAppend = true); + void SetQuoteEvent(MEVENT hEvent); void ShowColorChooser(int iCtrlId); void UpdateChatOptions(); void UpdateNickList(void); diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index c97fb46afb..c32b73bb0c 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index e320520823..4daf508061 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/Scriver/res/resource.rc b/plugins/Scriver/res/resource.rc index bf7dfc57b8..f54c7adcf5 100644 --- a/plugins/Scriver/res/resource.rc +++ b/plugins/Scriver/res/resource.rc @@ -10,6 +10,8 @@ // Generated from the TEXTINCLUDE 2 resource. // #include +#include "..\..\include\chat_resource.h" +#include "..\..\include\statusmodes.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -220,6 +222,8 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_CLIPSIBLINGS | WS_VSCROLL | WS_TABSTOP | 0x844,1,41,181,28,WS_EX_STATICEDGE CONTROL "",IDC_SRMM_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,87,181,13,WS_EX_ACCEPTFILES | WS_EX_STATICEDGE + CONTROL "",IDC_SRMM_QUOTE,"RichEdit50W",ES_AUTOHSCROLL | WS_DISABLED | WS_BORDER | WS_TABSTOP,0,95,235,16 + CONTROL "",IDC_SRMM_CLOSEQUOTE,"MButtonClass", WS_TABSTOP,237,97,16,16 CONTROL "",IDC_SPLITTERX,"Static",SS_ENHMETAFILE,172,23,10,73 CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE | WS_CLIPSIBLINGS,0,85,183,2 LISTBOX IDC_SRMM_NICKLIST,182,23,69,73,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE @@ -400,6 +404,8 @@ END 2 TEXTINCLUDE BEGIN "#include \r\n" + "#include ""..\\..\\include\\chat_resource.h""\r\n" + "#include ""..\\..\\include\\statusmodes.h""\r\n" "\0" END diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index cf42f54796..8821644dcd 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -558,6 +558,7 @@ void CMsgDialog::MessageDialogResize(int w, int h) else pdat->iSplitterY = hSplitterPos; + HDWP hdwp; if (isChat()) { bool bNick = m_si->iType != GCW_SERVER && m_bNicklistEnabled; @@ -587,14 +588,10 @@ void CMsgDialog::MessageDialogResize(int w, int h) logY = 0; logH = h - hSplitterPos - toolbarHeight - infobarInnerHeight - SPLITTER_HEIGHT; - HDWP hdwp = BeginDeferWindowPos(6); + hdwp = BeginDeferWindowPos(8); hdwp = DeferWindowPos(hdwp, hwndLog, nullptr, 1, 0, bNick ? w - pdat->iSplitterX - 1 : messageEditWidth, logH, SWP_NOZORDER); hdwp = DeferWindowPos(hdwp, m_nickList.GetHwnd(), nullptr, w - pdat->iSplitterX + 2, 0, pdat->iSplitterX - 3, logH, SWP_NOZORDER); hdwp = DeferWindowPos(hdwp, m_splitterX.GetHwnd(), nullptr, w - pdat->iSplitterX, 1, 2, logH, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, m_message.GetHwnd(), nullptr, 1, h - hSplitterPos - 1, messageEditWidth, hSplitterPos, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, GetDlgItem(m_hwnd, IDC_AVATAR), nullptr, w - avatarWidth - 1, h - (avatarHeight + avatarWidth) / 2 - 1, avatarWidth, avatarWidth, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, m_splitterY.GetHwnd(), nullptr, 0, h - hSplitterPos - SPLITTER_HEIGHT - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER); - EndDeferWindowPos(hdwp); RedrawWindow(m_nickList.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE); } @@ -602,17 +599,25 @@ void CMsgDialog::MessageDialogResize(int w, int h) logY = infobarInnerHeight; logH = h - hSplitterPos - toolbarHeight - infobarInnerHeight - SPLITTER_HEIGHT; - HDWP hdwp = BeginDeferWindowPos(5); + hdwp = BeginDeferWindowPos(7); hdwp = DeferWindowPos(hdwp, m_hwndInfo, nullptr, 1, 0, w - 2, infobarInnerHeight - 2, SWP_NOZORDER); hdwp = DeferWindowPos(hdwp, hwndLog, nullptr, 1, logY, w - 2, logH, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, m_message.GetHwnd(), nullptr, 1, h - hSplitterPos - 1, messageEditWidth, hSplitterPos, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, GetDlgItem(m_hwnd, IDC_AVATAR), nullptr, w - avatarWidth - 1, h - (avatarHeight + avatarWidth) / 2 - 1, avatarWidth, avatarWidth, SWP_NOZORDER); - hdwp = DeferWindowPos(hdwp, m_splitterY.GetHwnd(), nullptr, 0, h - hSplitterPos - SPLITTER_HEIGHT - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER); - EndDeferWindowPos(hdwp); RefreshInfobar(); } + int yTop = h - hSplitterPos - 1; + if (m_hQuoteEvent) { + hdwp = DeferWindowPos(hdwp, m_message.GetHwnd(), nullptr, 1, yTop + 22, messageEditWidth, hSplitterPos + 22, SWP_NOZORDER); + hdwp = DeferWindowPos(hdwp, m_Quote.GetHwnd(), nullptr, 1, yTop, messageEditWidth - 22, 22, SWP_NOZORDER); + hdwp = DeferWindowPos(hdwp, m_btnCloseQuote.GetHwnd(), nullptr, messageEditWidth - 21, yTop, 22, 22, SWP_NOZORDER); + } + else hdwp = DeferWindowPos(hdwp, m_message.GetHwnd(), nullptr, 1, yTop, messageEditWidth, hSplitterPos, SWP_NOZORDER); + + hdwp = DeferWindowPos(hdwp, GetDlgItem(m_hwnd, IDC_AVATAR), nullptr, w - avatarWidth - 1, h - (avatarHeight + avatarWidth) / 2 - 1, avatarWidth, avatarWidth, SWP_NOZORDER); + hdwp = DeferWindowPos(hdwp, m_splitterY.GetHwnd(), nullptr, 0, h - hSplitterPos - SPLITTER_HEIGHT - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER); + EndDeferWindowPos(hdwp); + m_pLog->Resize(); RedrawWindow(GetDlgItem(m_hwnd, IDC_AVATAR), nullptr, nullptr, RDW_INVALIDATE); diff --git a/plugins/TabSRMM/res/msgwindow.rc b/plugins/TabSRMM/res/msgwindow.rc index 4319b689a1..53b2525700 100644 --- a/plugins/TabSRMM/res/msgwindow.rc +++ b/plugins/TabSRMM/res/msgwindow.rc @@ -1,6 +1,5 @@ // Microsoft Visual C++ generated resource script. // -#include #include "..\src\resource.h" #define APSTUDIO_READONLY_SYMBOLS @@ -8,11 +7,9 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#define APSTUDIO_HIDDEN_SYMBOLS -#include "richedit.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "..\..\..\include\statusmodes.h" -#include "..\..\..\include\chat_resource.h" +#include +#include "..\..\include\chat_resource.h" +#include "..\..\include\statusmodes.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -21,10 +18,8 @@ // Neutral resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #pragma code_page(1251) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -36,19 +31,21 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,46,187,1 - CONTROL "",IDC_SRMM_MESSAGE,"RichEdit50W",ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_WANTRETURN | WS_VSCROLL | WS_TABSTOP,0,48,144,31,WS_EX_ACCEPTFILES | WS_EX_STATICEDGE + CONTROL "",IDC_SRMM_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,48,144,31,WS_EX_ACCEPTFILES | WS_EX_STATICEDGE CONTROL "",IDC_CONTACTPIC,"Button",BS_OWNERDRAW,155,48,34,31 CONTROL "",IDC_MULTISPLITTER,"Static",SS_ENHMETAFILE,186,0,2,30 - CONTROL "&Retry",IDC_RETRY,"MButtonClass",WS_TABSTOP,26,10,65,12,0x18000000L - CONTROL "&Cancel",IDC_CANCELSEND,"MButtonClass", WS_TABSTOP, 96,10,65,12,0x18000000L - CONTROL "&Send",IDC_MSGSENDLATER,"MButtonClass",WS_TABSTOP,166,10,65,12,0x18000000L + CONTROL "&Retry",IDC_RETRY,"MButtonClass",WS_TABSTOP,26,10,65,12,WS_EX_NOACTIVATE | 0x10000000L + CONTROL "&Cancel",IDC_CANCELSEND,"MButtonClass",WS_TABSTOP,96,10,65,12,WS_EX_NOACTIVATE | 0x10000000L + CONTROL "&Send",IDC_MSGSENDLATER,"MButtonClass",WS_TABSTOP,166,10,65,12,WS_EX_NOACTIVATE | 0x10000000L CONTROL "",IDC_STATICTEXT,"Static",SS_OWNERDRAW | WS_GROUP,27,0,160,9 CONTROL "",IDC_STATICERRORICON,"Static",SS_OWNERDRAW,4,3,20,20 - CONTROL "",IDC_SRMM_LOG,"RichEdit50W",ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_READONLY | WS_VSCROLL | WS_TABSTOP,0,0,188,30,WS_EX_STATICEDGE - CONTROL "&Add",IDC_ADD,"MButtonClass",WS_TABSTOP,155,64,16,14,0x18000000L - CONTROL "&Remove",IDC_CANCELADD,"MButtonClass",WS_TABSTOP,171,64,16,14,0x18000000L + CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x944,0,0,188,30,WS_EX_STATICEDGE + CONTROL "&Add",IDC_ADD,"MButtonClass",WS_TABSTOP,155,64,16,14,WS_EX_NOACTIVATE | 0x10000000L + CONTROL "&Remove",IDC_CANCELADD,"MButtonClass",WS_TABSTOP,171,64,16,14,WS_EX_NOACTIVATE | 0x10000000L CONTROL "",IDC_LOGFROZENTEXT,"Static",SS_OWNERDRAW | WS_GROUP,10,3,188,18 CONTROL "",IDC_PANELSPLITTER,"Static",SS_ENHMETAFILE,0,32,188,1,WS_EX_TRANSPARENT + CONTROL "",IDC_SRMM_QUOTE,"RichEdit50W",ES_AUTOHSCROLL | WS_DISABLED | WS_BORDER | WS_TABSTOP,0,95,235,16 + CONTROL "",IDC_SRMM_CLOSEQUOTE,"MButtonClass", WS_TABSTOP,237,97,16,16 END @@ -65,8 +62,9 @@ END 2 TEXTINCLUDE BEGIN - "#include ""richedit.h""\r\n" - "#include ""..\\..\\..\\include\\statusmodes.h""\r\n" + "#include \r\n" + "#include ""..\\..\\include\\chat_resource.h""\r\n" + "#include ""..\\..\\include\\statusmodes.h""\r\n" "\0" END @@ -79,4 +77,17 @@ END #endif // APSTUDIO_INVOKED #endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index f7c0315bed..63f63baa4c 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1235,13 +1235,9 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) urc->rcItem.right = urc->dlgNewSize.cx; if (m_bShowAvatar) urc->rcItem.right -= m_pic.cx + 2; - if (isChat()) { - urc->rcItem.bottom = urc->dlgNewSize.cy; - urc->rcItem.top = urc->dlgNewSize.cy - m_iSplitterY + 3 + DPISCALEY_S(23); - } - else { - urc->rcItem.top -= m_iSplitterY - m_originalSplitterY; - } + + urc->rcItem.bottom = urc->dlgNewSize.cy; + urc->rcItem.top = urc->dlgNewSize.cy - m_iSplitterY + 3 + DPISCALEY_S(23); if (bBottomToolbar && bShowToolbar) urc->rcItem.bottom -= DPISCALEY_S(22); @@ -1249,7 +1245,8 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) if (m_bIsAutosizingInput) urc->rcItem.top -= DPISCALEY_S(1); - msgTop = urc->rcItem.top; + m_rcMessage = urc->rcItem; + if (CSkin::m_skinEnabled) { CSkinItem *item = &SkinItems[ID_EXTBKINPUTAREA]; if (!item->IGNORED) { @@ -1259,9 +1256,21 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) urc->rcItem.bottom -= item->MARGIN_BOTTOM; } } - if (isChat()) - return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; - return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM; + return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; + + case IDC_SRMM_QUOTE: + urc->rcItem = m_rcMessage; + urc->rcItem.top -= 22; + urc->rcItem.bottom = m_rcMessage.top; + urc->rcItem.right -= 22; + return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; + + case IDC_SRMM_CLOSEQUOTE: + urc->rcItem = m_rcMessage; + urc->rcItem.top -= 22; + urc->rcItem.bottom = m_rcMessage.top; + urc->rcItem.left = m_rcMessage.right - 22; + return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; case IDC_MULTISPLITTER: if (bInfoPanel) @@ -1273,8 +1282,8 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) case IDC_LOGFROZENTEXT: urc->rcItem.right = urc->dlgNewSize.cx - 50; - urc->rcItem.bottom = msgTop - (bBottomToolbar ? 0 : 28); - urc->rcItem.top = msgTop - 16 - (bBottomToolbar ? 0 : 28); + urc->rcItem.bottom = m_rcMessage.top - (bBottomToolbar ? 0 : 28); + urc->rcItem.top = m_rcMessage.top - 16 - (bBottomToolbar ? 0 : 28); if (!bShowToolbar && !bBottomToolbar) { urc->rcItem.bottom += 21; urc->rcItem.top += 21; @@ -1282,8 +1291,8 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM; case IDC_ADD: - urc->rcItem.bottom = msgTop - (bBottomToolbar ? 0 : 28); - urc->rcItem.top = msgTop - 18 - (bBottomToolbar ? 0 : 28); + urc->rcItem.bottom = m_rcMessage.top - (bBottomToolbar ? 0 : 28); + urc->rcItem.top = m_rcMessage.top - 18 - (bBottomToolbar ? 0 : 28); urc->rcItem.right = urc->dlgNewSize.cx - 28; urc->rcItem.left = urc->rcItem.right - 20; if (!bShowToolbar && !bBottomToolbar) { @@ -1293,8 +1302,8 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM; case IDC_CANCELADD: - urc->rcItem.bottom = msgTop - (bBottomToolbar ? 0 : 28); - urc->rcItem.top = msgTop - 18 - (bBottomToolbar ? 0 : 28); + urc->rcItem.bottom = m_rcMessage.top - (bBottomToolbar ? 0 : 28); + urc->rcItem.top = m_rcMessage.top - 18 - (bBottomToolbar ? 0 : 28); urc->rcItem.right = urc->dlgNewSize.cx - 4; urc->rcItem.left = urc->rcItem.right - 20; if (!bShowToolbar && !bBottomToolbar) { @@ -1310,8 +1319,8 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) case IDC_CANCELSEND: case IDC_MSGSENDLATER: if (m_bErrorState) { - urc->rcItem.bottom = msgTop - 5 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); - urc->rcItem.top = msgTop - 25 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); + urc->rcItem.bottom = m_rcMessage.top - 5 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); + urc->rcItem.top = m_rcMessage.top - 25 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); } if (!bShowToolbar && !bBottomToolbar) { urc->rcItem.bottom += 21; @@ -1322,8 +1331,8 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc) case IDC_STATICTEXT: case IDC_STATICERRORICON: if (m_bErrorState) { - urc->rcItem.bottom = msgTop - 28 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); - urc->rcItem.top = msgTop - 45 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); + urc->rcItem.bottom = m_rcMessage.top - 28 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); + urc->rcItem.top = m_rcMessage.top - 45 - (bBottomToolbar ? 0 : 28) - ((m_bNotOnList || m_bScrollingDisabled) ? 20 : 0); } if (!bShowToolbar && !bBottomToolbar) { urc->rcItem.bottom += 21; diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index b79202723e..79c2d3c554 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -488,6 +488,7 @@ class CMsgDialog : public CSrmmBaseDialog uint32_t m_iSplitterSaved; POINT m_ptTipActivation; + RECT m_rcMessage; protected: void GetMYUIN(); @@ -538,7 +539,7 @@ public: char m_szMicroLf[128]; int m_iMultiSplit; - int msgTop, rcLogBottom; + int rcLogBottom; bool m_bActivate, m_bWantPopup, m_bIsMeta; wchar_t* wszInitialText; diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index ef89b80bd7..36d480b7a9 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -2,8 +2,8 @@ // Microsoft Visual C++ generated include file. // Used by W:\miranda-ng\plugins\TabSRMM\res\resource.rc // -#define IDD_TEMPLATEEDIT 1 #define VS_VERSION_INFO 1 +#define IDD_TEMPLATEEDIT 1 #define IDD_USERPREFS 2 #define IDOK2 2 #define IDD_USERPREFS1 3 diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc index 5a567442a8..48b936936b 100644 --- a/src/core/stdmsg/res/resource.rc +++ b/src/core/stdmsg/res/resource.rc @@ -1,7 +1,6 @@ // Microsoft Visual C++ generated resource script. // #include "..\src\resource.h" -#include "..\..\include\chat_resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -9,6 +8,7 @@ // Generated from the TEXTINCLUDE 2 resource. // #include +#include "..\..\include\chat_resource.h" #include "..\..\include\statusmodes.h" ///////////////////////////////////////////////////////////////////////////// @@ -82,12 +82,14 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "",IDC_SRMM_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,1,111,208,29,WS_EX_ACCEPTFILES | WS_EX_STATICEDGE LTEXT "",IDC_FRAME,1,111,208,29,NOT WS_VISIBLE | WS_CLIPSIBLINGS - DEFPUSHBUTTON "&Send",IDOK,212,111,39,29 - CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,1,16,250,91,WS_EX_STATICEDGE - CONTROL "",IDC_SPLITTERX,"Static",SS_ENHMETAFILE,172,23,10,73 - CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,108,251,2 + DEFPUSHBUTTON "&Send",IDOK,212,110,39,29 + CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,1,5,175,91,WS_EX_STATICEDGE + CONTROL "",IDC_SPLITTERX,"Static",SS_ENHMETAFILE,180,4,2,89 + CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,108,251,1 LISTBOX IDC_SRMM_NICKLIST,182,2,69,94,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE CONTROL "",IDC_AVATAR,"Button",BS_OWNERDRAW | NOT WS_VISIBLE,1,127,6,13 + CONTROL "",IDC_SRMM_QUOTE,"RichEdit50W",ES_AUTOHSCROLL | WS_DISABLED | WS_BORDER | WS_TABSTOP,0,95,235,16 + CONTROL "",IDC_SRMM_CLOSEQUOTE,"MButtonClass", WS_TABSTOP,237,97,16,16 END IDD_OPT_MSGHIST DIALOGEX 0, 0, 311, 171 @@ -336,13 +338,14 @@ END 1 TEXTINCLUDE BEGIN - "..\\sxr\\resource.h\0" + "..\\src\\resource.h\0" END 2 TEXTINCLUDE BEGIN "#include \r\n" - "#include ""statusmodes.h""\r\n" + "#include ""..\\..\\include\\chat_resource.h""\r\n" + "#include ""..\\..\\include\\statusmodes.h""\r\n" "\0" END diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index ad51592f24..c9caf7fe33 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -489,16 +489,34 @@ LBL_CalcBottom: return RD_ANCHORX_WIDTH | RD_ANCHORY_CUSTOM; case IDC_SRMM_MESSAGE: - case IDC_FRAME: urc->rcItem.right = bSend ? urc->dlgNewSize.cx - 64 : urc->dlgNewSize.cx; urc->rcItem.top = underTB; + if (m_hQuoteEvent) + urc->rcItem.top += 22; urc->rcItem.bottom = urc->dlgNewSize.cy - 1; if (g_plugin.bShowAvatar && m_avatarPic) urc->rcItem.left = m_avatarWidth + 4; - if (urc->wId == IDC_FRAME) { - urc->rcItem.left--; urc->rcItem.top--; - urc->rcItem.right++; urc->rcItem.bottom++; - } + m_rcMessage = urc->rcItem; + return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; + + case IDC_SRMM_QUOTE: + urc->rcItem = m_rcMessage; + urc->rcItem.top -= 22; + urc->rcItem.bottom = m_rcMessage.top; + urc->rcItem.right -= 22; + return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; + + case IDC_SRMM_CLOSEQUOTE: + urc->rcItem = m_rcMessage; + urc->rcItem.top -= 22; + urc->rcItem.bottom = m_rcMessage.top; + urc->rcItem.left = m_rcMessage.right - 22; + return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; + + case IDC_FRAME: + urc->rcItem = m_rcMessage; + urc->rcItem.left--; urc->rcItem.top--; + urc->rcItem.right++; urc->rcItem.bottom++; return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM; case IDC_AVATAR: @@ -871,12 +889,14 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) } break; - case WM_SETFOCUS: { - const char* enc = (const char*)CallProtoService(m_szProto, PS_GETCAPS, PFLAG_GETCURRENTENCRYPTION, m_hContact); - if (enc == (const char *)CALLSERVICE_NOTFOUND) - enc = nullptr; - ShowWindow(GetDlgItem(m_hwnd, IDC_FRAME), enc ? SW_SHOW : SW_HIDE); - } + case WM_SETFOCUS: + { + const char *enc = (const char *)CallProtoService(m_szProto, PS_GETCAPS, PFLAG_GETCURRENTENCRYPTION, m_hContact); + if (enc == (const char *)CALLSERVICE_NOTFOUND) + enc = nullptr; + ShowWindow(GetDlgItem(m_hwnd, IDC_FRAME), enc ? SW_SHOW : SW_HIDE); + } + break; case WM_KEYDOWN: bool isShift = (GetKeyState(VK_SHIFT) & 0x8000) != 0; diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 48c68fe5a9..5e40d57e0a 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -60,7 +60,7 @@ class CMsgDialog : public CSrmmBaseDialog int m_iSplitterX, m_iSplitterY; SIZE m_minEditBoxSize; RECT m_minEditInit; - RECT m_rcLog; + RECT m_rcLog, m_rcMessage; // tab autocomplete int m_iTabStart = 0; diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h index e0436a8abd..aaefd5ce20 100644 --- a/src/core/stdmsg/src/resource.h +++ b/src/core/stdmsg/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by resource.rc +// Used by W:\miranda-ng\src\core\stdmsg\res\resource.rc // #define IDD_MSGSENDERROR 102 #define IDD_OPTIONS2 103 @@ -151,6 +151,20 @@ #define IDC_USETABS 1620 #define IDC_CLOSETABS 1621 #define IDC_TABSBOTTOM 1623 +#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 +#define IDC_SRMM_CHANMGR 3007 +#define IDC_SRMM_SHOWNICKLIST 3008 +#define IDC_SRMM_HISTORY 3009 +#define IDC_SRMM_NICKLIST 3010 +#define IDC_SRMM_LOG 3011 +#define IDC_SRMM_MESSAGE 3012 +#define IDC_SRMM_QUOTE 3013 +#define IDC_SRMM_CLOSEQUOTE 3014 #define IDM_CUT 40000 #define IDM_COPY 40001 #define IDM_PASTE 40002 diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 33ebc19958..ba74665e56 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -912,3 +912,5 @@ Clist_GroupSaveExpanded @1003 NONAME ?IsReadonly@Contact@@YG_NI@Z @1030 NONAME ?Readonly@Contact@@YGXI_N@Z @1031 NONAME ?addButton@CMPluginBase@@QAEPAXPBUBBButton@@@Z @1032 NONAME +?SetQuoteEvent@CSrmmBaseDialog@@QAEXI@Z @1033 NONAME +?onClick_CloseQuote@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @1034 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index fc9a419bce..257fa93dfd 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -912,3 +912,5 @@ Clist_GroupSaveExpanded @1003 NONAME ?IsReadonly@Contact@@YA_NI@Z @1030 NONAME ?Readonly@Contact@@YAXI_N@Z @1031 NONAME ?addButton@CMPluginBase@@QEAAPEAXPEBUBBButton@@@Z @1032 NONAME +?SetQuoteEvent@CSrmmBaseDialog@@QEAAXI@Z @1033 NONAME +?onClick_CloseQuote@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @1034 NONAME diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 025ae2466c..a744a3e9e3 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -49,6 +49,9 @@ CSrmmBaseDialog::CSrmmBaseDialog(CMPluginBase &pPlugin, int idDialog, SESSION_IN m_btnItalic(this, IDC_SRMM_ITALICS), m_btnUnderline(this, IDC_SRMM_UNDERLINE), + m_Quote(this, IDC_SRMM_QUOTE), + m_btnCloseQuote(this, IDC_SRMM_CLOSEQUOTE, SKINICON_OTHER_DELETE, LPGEN("Remove quoting")), + m_si(si), m_hContact(0), m_clrInputBG(GetSysColor(COLOR_WINDOW)) @@ -60,6 +63,8 @@ CSrmmBaseDialog::CSrmmBaseDialog(CMPluginBase &pPlugin, int idDialog, SESSION_IN m_btnHistory.OnClick = Callback(this, &CSrmmBaseDialog::onClick_History); m_btnChannelMgr.OnClick = Callback(this, &CSrmmBaseDialog::onClick_ChanMgr); + m_btnCloseQuote.OnClick = Callback(this, &CSrmmBaseDialog::onClick_CloseQuote); + m_nickList.OnDblClick = Callback(this, &CSrmmBaseDialog::onDblClick_List); timerRedraw.OnEvent = Callback(this, &CSrmmBaseDialog::OnRedrawTimer); @@ -519,6 +524,9 @@ bool CSrmmBaseDialog::OnInitDialog() WindowList_Add(g_hWindowList, m_hwnd, m_hContact); SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); + m_btnCloseQuote.Hide(); + m_Quote.Hide(); + m_bReadOnly = Contact::IsReadonly(m_hContact); if (m_bReadOnly) m_message.Hide(); @@ -874,6 +882,14 @@ void CSrmmBaseDialog::onClick_ChanMgr(CCtrlButton *pButton) Chat_DoEventHook(m_si, GC_USER_CHANMGR, nullptr, nullptr, 0); } +void CSrmmBaseDialog::onClick_CloseQuote(CCtrlButton*) +{ + m_Quote.Hide(); + m_btnCloseQuote.Hide(); + m_hQuoteEvent = 0; + Resize(); +} + void CSrmmBaseDialog::onDblClick_List(CCtrlListBox *pList) { TVHITTESTINFO hti; @@ -1068,3 +1084,19 @@ void CSrmmBaseDialog::RefreshButtonStatus() m_btnUnderline.Push(false); } } + +void CSrmmBaseDialog::SetQuoteEvent(MEVENT hEvent) +{ + DB::EventInfo dbei(hEvent); + if (dbei) { + CMStringW wszText(TranslateT("In reply to")); + wszText += L": "; + wszText += ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)).get(); + m_Quote.SetText(wszText); + + m_hQuoteEvent = hEvent; + m_Quote.Show(); + m_btnCloseQuote.Show(); + Resize(); + } +} -- cgit v1.2.3