diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-24 12:41:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-24 12:41:14 +0300 |
commit | 35ec83f41f78aff503d1bfa16714aadee360d2f7 (patch) | |
tree | 88cf6888fd2c5cedd4d04cfc7691e7e177bde7fe /plugins/Scriver | |
parent | fc86783e3a70b466e101c20f3d9fe6382bff6d09 (diff) |
m_message & m_log moved inside mir_app
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/res/resource.rc | 10 | ||||
-rw-r--r-- | plugins/Scriver/src/chat_window.cpp | 24 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 16 | ||||
-rw-r--r-- | plugins/Scriver/src/msgoptions.cpp | 20 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/resource.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/tabs.cpp | 2 |
8 files changed, 31 insertions, 47 deletions
diff --git a/plugins/Scriver/res/resource.rc b/plugins/Scriver/res/resource.rc index 97fc4a8d18..5821ba6db7 100644 --- a/plugins/Scriver/res/resource.rc +++ b/plugins/Scriver/res/resource.rc @@ -131,7 +131,7 @@ BEGIN EDITTEXT IDC_INDENTSIZE,262,79,33,12,ES_RIGHT | ES_NUMBER | WS_DISABLED
CONTROL "Spin1",IDC_INDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | WS_DISABLED,290,79,10,12
CONTROL "Customize fonts and colors",IDC_FONTSCOLORS,"Hyperlink",0x0,8,91,200,8
- CONTROL "",IDC_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,8,105,288,68,WS_EX_STATICEDGE
+ CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,8,105,288,68,WS_EX_STATICEDGE
GROUPBOX "Preload",IDC_STATIC,0,181,304,50
CONTROL "Unread events only",IDC_LOADUNREAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,192,138,10
CONTROL "Last",IDC_LOADCOUNT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,204,138,10
@@ -203,8 +203,8 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN EXSTYLE WS_EX_ACCEPTFILES
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_LOG,"RichEdit50W",WS_CLIPSIBLINGS | WS_VSCROLL | WS_TABSTOP | 0x844,1,41,181,28,WS_EX_STATICEDGE
- CONTROL "",IDC_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,87,181,13,WS_EX_ACCEPTFILES | WS_EX_STATICEDGE
+ 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_SPLITTERY,"Static",SS_ENHMETAFILE | WS_CLIPSIBLINGS,0,85,183,2
CONTROL "",IDC_AVATAR,"Static",SS_OWNERDRAW,180,80,0,0
END
@@ -226,8 +226,8 @@ IDD_CHANNEL DIALOGEX 0, 0, 252, 140 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "",IDC_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,128,127,12,WS_EX_STATICEDGE
- CONTROL "",IDC_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,8,23,164,73,WS_EX_STATICEDGE
+ CONTROL "",IDC_SRMM_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,128,127,12,WS_EX_STATICEDGE
+ CONTROL "",IDC_SRMM_LOG,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x844,8,23,164,73,WS_EX_STATICEDGE
CONTROL "",IDC_SPLITTERX,"Static",SS_ENHMETAFILE,172,23,10,73
CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,102,251,6
LISTBOX IDC_SRMM_NICKLIST,182,23,69,73,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index bb9b543bea..5453087d6f 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -217,18 +217,10 @@ void CChatRoomDlg::MessageDialogResize(int w, int h) CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
: CScriverWindow(IDD_CHANNEL, si),
-
- m_log(this, IDC_LOG),
- m_message(this, IDC_MESSAGE),
-
m_splitterX(this, IDC_SPLITTERX),
m_splitterY(this, IDC_SPLITTERY),
-
m_btnOk(this, IDOK)
{
- m_pLog = &m_log;
- m_pEntry = &m_message;
-
m_btnOk.OnClick = Callback(this, &CChatRoomDlg::onClick_Ok);
m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::onClick_Filter);
m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_ShowList);
@@ -376,7 +368,7 @@ void CChatRoomDlg::onClick_Ok(CCtrlButton *pButton) EnableWindow(m_message.GetHwnd(), FALSE);
m_message.SendMsg(EM_SETREADONLY, TRUE, 0);
}
- else SetDlgItemText(m_hwnd, IDC_MESSAGE, L"");
+ else m_message.SetText(L"");
EnableWindow(m_btnOk.GetHwnd(), FALSE);
@@ -691,7 +683,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) {
case WM_MOUSEWHEEL:
if ((GetWindowLongPtr(m_message.GetHwnd(), GWL_STYLE) & WS_VSCROLL) == 0)
- SendDlgItemMessage(m_hwnd, IDC_LOG, WM_MOUSEWHEEL, wParam, lParam);
+ m_log.SendMsg(WM_MOUSEWHEEL, wParam, lParam);
m_iLastEnterTime = 0;
return TRUE;
@@ -770,7 +762,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) }
if (wParam == VK_NEXT || wParam == VK_PRIOR) {
- SendDlgItemMessage(m_hwnd, IDC_LOG, msg, wParam, lParam);
+ m_log.SendMsg(msg, wParam, lParam);
return TRUE;
}
break;
@@ -835,7 +827,7 @@ LRESULT CChatRoomDlg::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) sel.cpMin = sel.cpMax;
SendMessage(m_log.GetHwnd(), EM_EXSETSEL, 0, (LPARAM)&sel);
}
- SetFocus(GetDlgItem(m_hwnd, IDC_MESSAGE));
+ SetFocus(m_message.GetHwnd());
break;
case WM_ACTIVATE:
@@ -917,8 +909,8 @@ LRESULT CChatRoomDlg::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) break;
case WM_CHAR:
- SetFocus(GetDlgItem(m_hwnd, IDC_MESSAGE));
- SendDlgItemMessage(m_hwnd, IDC_MESSAGE, WM_CHAR, wParam, lParam);
+ SetFocus(m_message.GetHwnd());
+ m_message.SendMsg(WM_CHAR, wParam, lParam);
break;
}
@@ -1261,7 +1253,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) LPNMHDR pNmhdr = (LPNMHDR)lParam;
switch (pNmhdr->code) {
case EN_MSGFILTER:
- if (pNmhdr->idFrom == IDC_LOG && ((MSGFILTER *)lParam)->msg == WM_RBUTTONUP) {
+ if (pNmhdr->idFrom == IDC_SRMM_LOG && ((MSGFILTER *)lParam)->msg == WM_RBUTTONUP) {
SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, TRUE);
return TRUE;
}
@@ -1353,5 +1345,5 @@ void ShowRoom(SESSION_INFO *si) SendMessage(GetParent(si->pDlg->GetHwnd()), CM_ACTIVATECHILD, 0, (LPARAM)si->pDlg->GetHwnd());
SendMessage(GetParent(si->pDlg->GetHwnd()), CM_POPUPWINDOW, 0, (LPARAM)si->pDlg->GetHwnd());
SendMessage(si->pDlg->GetHwnd(), WM_MOUSEACTIVATE, 0, 0);
- SetFocus(GetDlgItem(si->pDlg->GetHwnd(), IDC_MESSAGE));
+ SetFocus(GetDlgItem(si->pDlg->GetHwnd(), IDC_SRMM_MESSAGE));
}
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 36a11f9e6c..69f8681857 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -102,8 +102,8 @@ void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) mwe.szModule = SRMM_MODULE;
mwe.uType = type;
mwe.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwe.hwndInput = GetDlgItem(hwnd, IDC_MESSAGE);
- mwe.hwndLog = GetDlgItem(hwnd, IDC_LOG);
+ mwe.hwndInput = GetDlgItem(hwnd, IDC_SRMM_MESSAGE);
+ mwe.hwndLog = GetDlgItem(hwnd, IDC_SRMM_LOG);
NotifyEventHooks(hHookWinEvt, 0, (LPARAM)&mwe);
}
@@ -189,8 +189,6 @@ static INT_PTR CALLBACK ConfirmSendAllDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool bIncoming, const char *szInitialText, bool bIsUnicode)
: CScriverWindow(IDD_MSG),
m_bIncoming(bIncoming),
- m_log(this, IDC_LOG),
- m_message(this, IDC_MESSAGE),
m_splitter(this, IDC_SPLITTERY),
m_btnOk(this, IDOK),
@@ -199,8 +197,6 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool bIncoming, const char *szInitia m_btnDetails(this, IDC_DETAILS),
m_btnUserMenu(this, IDC_USERMENU)
{
- m_pLog = &m_log;
- m_pEntry = &m_message;
m_hContact = hContact;
m_hwndParent = GetParentWindow(hContact, FALSE);
@@ -517,7 +513,7 @@ void CSrmmWindow::onClick_Ok(CCtrlButton *pButton) if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON)
NotifyTyping(PROTOTYPE_SELFTYPING_OFF);
- SetDlgItemText(m_hwnd, IDC_MESSAGE, L"");
+ m_message.SetText(L"");
EnableWindow(GetDlgItem(m_hwnd, IDOK), FALSE);
if (db_get_b(0, SRMM_MODULE, SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN))
ShowWindow(m_hwndParent, SW_MINIMIZE);
@@ -1085,7 +1081,7 @@ LRESULT CSrmmWindow::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) case WM_MOUSEWHEEL:
if ((GetWindowLongPtr(m_message.GetHwnd(), GWL_STYLE) & WS_VSCROLL) == 0)
- SendDlgItemMessage(m_hwnd, IDC_LOG, WM_MOUSEWHEEL, wParam, lParam);
+ m_log.SendMsg(WM_MOUSEWHEEL, wParam, lParam);
break;
case WM_LBUTTONDOWN:
@@ -1703,7 +1699,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_NOTIFY:
pNmhdr = (LPNMHDR)lParam;
switch (pNmhdr->idFrom) {
- case IDC_LOG:
+ case IDC_SRMM_LOG:
switch (pNmhdr->code) {
case EN_MSGFILTER:
{
@@ -1731,7 +1727,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) }
break;
- case IDC_MESSAGE:
+ case IDC_SRMM_MESSAGE:
if (pNmhdr->code == EN_MSGFILTER && ((MSGFILTER *)lParam)->msg == WM_RBUTTONUP) {
SetWindowLongPtr(m_hwnd, DWLP_MSGRESULT, TRUE);
return TRUE;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 6e1f546b26..66b215694a 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -602,9 +602,9 @@ static void ShowPreview(HWND hwndDlg) pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_OFFSET;
pf2.dxOffset = (gdat.flags & SMF_INDENTTEXT) ? gdat.indentSize * 1440 / g_dat.logPixelSX : 0;
- SetDlgItemText(hwndDlg, IDC_LOG, L"");
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
- StreamInTestEvents(GetDlgItem(hwndDlg, IDC_LOG), &gdat);
+ SetDlgItemText(hwndDlg, IDC_SRMM_LOG, L"");
+ SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
+ StreamInTestEvents(GetDlgItem(hwndDlg, IDC_SRMM_LOG), &gdat);
}
static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -614,7 +614,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_LOG));
+ RichUtil_SubClass(GetDlgItem(hwndDlg, IDC_SRMM_LOG));
switch (db_get_b(0, SRMM_MODULE, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
case LOADHISTORY_UNREAD:
CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
@@ -677,11 +677,11 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, pf2.dwMask = PFM_OFFSETINDENT | PFM_RIGHTINDENT;
pf2.dxStartIndent = 30;
pf2.dxRightIndent = 30;
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_AUTOURLDETECT, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
+ SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
+ SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
+ SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_AUTOURLDETECT, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_SRMM_LOG, EM_SETOLECALLBACK, 0, (LPARAM)&reOleCallback);
}
ShowPreview(hwndDlg);
return TRUE;
@@ -749,7 +749,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, return TRUE;
break;
- case IDC_LOG:
+ case IDC_SRMM_LOG:
return 0;
}
MarkChanges(4, hwndDlg);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index c2ef1ab5c5..7572fabf0a 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -146,7 +146,7 @@ static INT_PTR SendMessageCommandWorker(MCONTACT hContact, LPCSTR pszMsg, bool i HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
if (hwnd != nullptr) {
if (pszMsg) {
- HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
+ HWND hEdit = GetDlgItem(hwnd, IDC_SRMM_MESSAGE);
SendMessage(hEdit, EM_SETSEL, -1, GetWindowTextLength(hEdit));
if (isWchar)
SendMessageW(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg);
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index b2c824a3d5..58c80d4d6a 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -108,7 +108,6 @@ class CSrmmWindow : public CScriverWindow {
typedef CScriverWindow CSuper;
- CCtrlEdit m_log, m_message;
CCtrlButton m_btnOk, m_btnAdd, m_btnUserMenu, m_btnQuote, m_btnDetails;
CSplitter m_splitter;
@@ -188,7 +187,6 @@ class CChatRoomDlg : public CScriverWindow {
typedef CScriverWindow CSuper;
- CCtrlEdit m_message, m_log;
CCtrlButton m_btnOk;
CSplitter m_splitterX, m_splitterY;
diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index 71f80fb75d..140bbdb351 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -74,8 +74,6 @@ #define IDC_HYPERLINKHAND 600
#define IDC_DRAGCURSOR 601
#define IDC_TABS 1000
-#define IDC_LOG 1001
-#define IDC_MESSAGE 1002
#define IDC_AUTOPOPUP 1003
#define IDC_AUTOMIN 1005
#define IDC_STAYMINIMIZED 1006
diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index a436c3c6d9..3b164494c6 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -792,7 +792,7 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara GetChildWindowRect(dat, &rcChild);
dat->childRect = rcChild;
MoveWindow(dat->hwndActive, rcChild.left, rcChild.top, rcChild.right - rcChild.left, rcChild.bottom - rcChild.top, TRUE);
- RedrawWindow(GetDlgItem(dat->hwndActive, IDC_LOG), nullptr, nullptr, RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(dat->hwndActive, IDC_SRMM_LOG), nullptr, nullptr, RDW_INVALIDATE);
if (dat->flags2 & SMF2_SHOWSTATUSBAR) {
SendMessage(dat->hwndStatus, WM_SIZE, 0, 0);
RedrawWindow(dat->hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
|