diff options
Diffstat (limited to 'plugins/Scriver/src')
-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 |
7 files changed, 26 insertions, 42 deletions
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);
|