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 --- 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 +- 6 files changed, 82 insertions(+), 50 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3