diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-04 14:29:10 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-04 14:29:10 +0300 |
commit | d1f9ed840683828f9f4d2fcb80523bcda77115a5 (patch) | |
tree | 9c78ff98f1eee4ce3a55fc91eb13318050fe3781 /protocols/JabberG | |
parent | 22f6f8cf6d902b7460d727aa894d9df68e1bab1c (diff) |
Jabber:
- ugly & obsolete class CCtrlFilterListView removed, because it behave wrong in the presence of scrollbars;
- manual filter added to the Disco dialog;
- also fixes #1882 (Jabber: channel list glitch)
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/res/jabber.rc | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_bookmarks.cpp | 16 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_disco.cpp | 31 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_filterlist.cpp | 332 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_notes.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/resource.h | 1 | ||||
-rwxr-xr-x | protocols/JabberG/src/stdafx.h | 26 |
7 files changed, 31 insertions, 387 deletions
diff --git a/protocols/JabberG/res/jabber.rc b/protocols/JabberG/res/jabber.rc index 1d65978c6a..eb425da70b 100644 --- a/protocols/JabberG/res/jabber.rc +++ b/protocols/JabberG/res/jabber.rc @@ -561,6 +561,8 @@ BEGIN COMBOBOX IDC_COMBO_NODE,243,6,84,70,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Go",IDC_BUTTON_BROWSE,"MButtonClass",WS_TABSTOP,332,5,16,14
CONTROL "",IDC_TREE_DISCO,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,5,21,343,180
+ RTEXT "Filter:", IDC_TXT_FILTER,5,207,48,8
+ EDITTEXT IDC_FILTER,58,205,289,14,ES_AUTOHSCROLL
END
IDD_GROUPCHAT_INFO DIALOGEX 0, 0, 183, 144
@@ -745,6 +747,10 @@ BEGIN BOTTOMMARGIN, 137
END
+ IDD_SERVICE_DISCOVERY, DIALOG
+ BEGIN
+ END
+
IDD_PEP_SIMPLE, DIALOG
BEGIN
END
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 73588f4c6f..87ac8971f8 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -165,10 +165,8 @@ class CJabberDlgBookmarks : public CJabberDlgBase {
typedef CJabberDlgBase CSuper;
- CCtrlMButton m_btnAdd;
- CCtrlMButton m_btnEdit;
- CCtrlMButton m_btnRemove;
- CCtrlFilterListView m_lvBookmarks;
+ CCtrlMButton m_btnAdd, m_btnEdit, m_btnRemove;
+ CCtrlListView m_lvBookmarks;
public:
CJabberDlgBookmarks(CJabberProto *proto) :
@@ -176,7 +174,7 @@ public: m_btnAdd(this, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add")),
m_btnEdit(this, IDC_EDIT, SKINICON_OTHER_RENAME, LPGEN("Edit")),
m_btnRemove(this, IDC_REMOVE, SKINICON_OTHER_DELETE, LPGEN("Remove")),
- m_lvBookmarks(this, IDC_BM_LIST, true, true)
+ m_lvBookmarks(this, IDC_BM_LIST)
{
m_lvBookmarks.OnItemActivate = Callback(this, &CJabberDlgBookmarks::lvBookmarks_OnDoubleClick);
m_btnAdd.OnClick = Callback(this, &CJabberDlgBookmarks::btnAdd_OnClick);
@@ -274,12 +272,12 @@ public: return CSuper::Resizer(urc);
}
- void lvBookmarks_OnDoubleClick(CCtrlFilterListView*)
+ void lvBookmarks_OnDoubleClick(CCtrlButton*)
{
OpenBookmark();
}
- void btnAdd_OnClick(CCtrlFilterListView*)
+ void btnAdd_OnClick(CCtrlButton*)
{
if (!m_proto->m_bJabberOnline) return;
@@ -289,7 +287,7 @@ public: DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), m_hwnd, JabberAddBookmarkDlgProc, (LPARAM)¶m);
}
- void btnEdit_OnClick(CCtrlFilterListView*)
+ void btnEdit_OnClick(CCtrlButton*)
{
if (!m_proto->m_bJabberOnline)
return;
@@ -312,7 +310,7 @@ public: DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), m_hwnd, JabberAddBookmarkDlgProc, (LPARAM)¶m);
}
- void btnRemove_OnClick(CCtrlFilterListView*)
+ void btnRemove_OnClick(CCtrlButton*)
{
if (!m_proto->m_bJabberOnline)
return;
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index a892cdfc92..c7d12a37b8 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -499,7 +499,8 @@ class CJabberDlgDiscovery : public CJabberDlgBase CCtrlMButton m_btnBookmarks;
CCtrlMButton m_btnRefresh;
CCtrlMButton m_btnBrowse;
- CCtrlFilterListView m_lstDiscoTree;
+ CCtrlListView m_lstDiscoTree;
+ CCtrlEdit m_filter;
public:
CJabberDlgDiscovery(CJabberProto *proto, char *jid) :
@@ -511,7 +512,8 @@ public: m_btnBookmarks(this, IDC_BTN_FAVORITE, proto->LoadIconEx("bookmarks"), "Favorites"),
m_btnRefresh(this, IDC_BTN_REFRESH, proto->LoadIconEx("sd_nav_refresh"), "Refresh node"),
m_btnBrowse(this, IDC_BUTTON_BROWSE, proto->LoadIconEx("sd_browse"), "Browse"),
- m_lstDiscoTree(this, IDC_TREE_DISCO, true, false)
+ m_lstDiscoTree(this, IDC_TREE_DISCO),
+ m_filter(this, IDC_FILTER)
{
m_btnViewAsTree.OnClick = Callback(this, &CJabberDlgDiscovery::btnViewAsTree_OnClick);
m_btnViewAsList.OnClick = Callback(this, &CJabberDlgDiscovery::btnViewAsList_OnClick);
@@ -519,7 +521,8 @@ public: m_btnBookmarks.OnClick = Callback(this, &CJabberDlgDiscovery::btnBookmarks_OnClick);
m_btnRefresh.OnClick = Callback(this, &CJabberDlgDiscovery::btnRefresh_OnClick);
m_btnBrowse.OnClick = Callback(this, &CJabberDlgDiscovery::btnBrowse_OnClick);
- m_lstDiscoTree.OnFilterChanged = Callback(this, &CJabberDlgDiscovery::lstDiscoTree_OnFilter);
+
+ m_filter.OnChange = Callback(this, &CJabberDlgDiscovery::lstDiscoTree_OnFilter);
}
bool OnInitDialog() override
@@ -534,7 +537,7 @@ public: m_focusEditAfterBrowse = false;
}
else {
- SetDlgItemTextA(m_hwnd, IDC_COMBO_JID, m_proto->m_ThreadInfo->conn.server);
+ SetDlgItemTextUtf(m_hwnd, IDC_COMBO_JID, m_proto->m_ThreadInfo->conn.server);
SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
m_focusEditAfterBrowse = true;
}
@@ -545,8 +548,6 @@ public: CheckDlgButton(m_hwnd, m_proto->getByte("discoWnd_useTree", 1) ? IDC_BTN_VIEWTREE : IDC_BTN_VIEWLIST, BST_CHECKED);
- EnableWindow(GetDlgItem(m_hwnd, IDC_BTN_FILTERRESET), FALSE);
-
SendDlgItemMessage(m_hwnd, IDC_COMBO_JID, CB_ADDSTRING, 0, (LPARAM)_T(SD_FAKEJID_CONFERENCES));
SendDlgItemMessage(m_hwnd, IDC_COMBO_JID, CB_ADDSTRING, 0, (LPARAM)_T(SD_FAKEJID_MYAGENTS));
SendDlgItemMessage(m_hwnd, IDC_COMBO_JID, CB_ADDSTRING, 0, (LPARAM)_T(SD_FAKEJID_AGENTS));
@@ -656,15 +657,15 @@ public: case IDC_BUTTON_BROWSE:
return RD_ANCHORX_RIGHT | RD_ANCHORY_TOP;
+
case IDC_TREE_DISCO:
return RD_ANCHORX_WIDTH | RD_ANCHORY_HEIGHT;
+
case IDC_TXT_FILTER:
return RD_ANCHORX_LEFT | RD_ANCHORY_BOTTOM;
- case IDC_TXT_FILTERTEXT:
+
+ case IDC_FILTER:
return RD_ANCHORX_WIDTH | RD_ANCHORY_BOTTOM;
- case IDC_BTN_FILTERAPPLY:
- case IDC_BTN_FILTERRESET:
- return RD_ANCHORX_RIGHT | RD_ANCHORY_BOTTOM;
}
return CSuper::Resizer(urc);
}
@@ -821,9 +822,9 @@ public: m_proto->PerformBrowse(m_hwnd);
}
- void lstDiscoTree_OnFilter(CCtrlFilterListView *)
+ void lstDiscoTree_OnFilter(CCtrlEdit*)
{
- TreeList_SetFilter(GetDlgItem(m_hwnd, IDC_TREE_DISCO), m_lstDiscoTree.GetFilterText());
+ TreeList_SetFilter(GetDlgItem(m_hwnd, IDC_TREE_DISCO), ptrW(m_filter.GetText()));
}
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
@@ -1009,11 +1010,9 @@ public: {
HWND hwndFocus = GetFocus();
if (!hwndFocus) return TRUE;
- if (GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_TXT_FILTERTEXT)
- PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BTN_FILTERAPPLY, 0), 0);
- else if (m_hwnd == (hwndFocus = GetParent(hwndFocus)))
+ if (m_hwnd == (hwndFocus = GetParent(hwndFocus)))
break;
- else if ((GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_COMBO_NODE) || (GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_COMBO_JID))
+ if ((GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_COMBO_NODE) || (GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_COMBO_JID))
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp deleted file mode 100644 index 07aa14eae1..0000000000 --- a/protocols/JabberG/src/jabber_filterlist.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/*
-
-Jabber Protocol Plugin for Miranda NG
-
-Copyright (c) 2002-04 Santithorn Bunchua
-Copyright (c) 2005-12 George Hazan
-Copyright (c) 2007 Victor Pavlychko
-Copyright (C) 2012-19 Miranda NG team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-*/
-
-#include "stdafx.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// CCtrlFilterListView
-
-#define FILTER_BOX_HEIGHT 21
-
-struct CFilterData : public MZeroedObject
-{
- HFONT m_hfntNormal;
- HFONT m_hfntEmpty;
- COLORREF m_clGray;
- wchar_t *m_filterText;
-
- RECT m_rcButtonClear;
- RECT m_rcEditBox;
-
- WNDPROC m_oldWndProc;
- HWND m_hwndOwner;
- HWND m_hwndEditBox;
-
- void ReleaseFilterData()
- {
- DeleteObject(m_hfntEmpty); m_hfntEmpty = nullptr;
- }
-
- ~CFilterData()
- {
- ReleaseFilterData();
- }
-};
-
-CCtrlFilterListView::CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight):
- CCtrlListView(dlg, ctrlId),
- m_trackFilter(trackFilter),
- m_keepHiglight(keepHiglight)
-{
- fdat = new CFilterData;
-}
-
-CCtrlFilterListView::~CCtrlFilterListView()
-{
- if (fdat->m_filterText) mir_free(fdat->m_filterText);
- delete fdat;
-}
-
-wchar_t *CCtrlFilterListView::GetFilterText()
-{
- return fdat->m_filterText;
-}
-
-void CCtrlFilterListView::OnInit()
-{
- CSuper::OnInit();
- Subclass();
-}
-
-static LRESULT CALLBACK sttEditBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- CFilterData *fdat = (CFilterData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (fdat == nullptr)
- return DefWindowProc(hwnd, msg, wParam, lParam);
-
- switch (msg) {
- case WM_GETDLGCODE:
- if ((wParam == VK_RETURN) || (wParam == VK_ESCAPE))
- return DLGC_WANTMESSAGE;
- break;
-
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- if (wParam == VK_RETURN) {
- if (fdat->m_filterText) mir_free(fdat->m_filterText);
- int length = GetWindowTextLength(hwnd) + 1;
- if (length == 1)
- fdat->m_filterText = nullptr;
- else {
- fdat->m_filterText = (wchar_t *)mir_alloc(sizeof(wchar_t) * length);
- GetWindowText(hwnd, fdat->m_filterText, length);
- }
-
- DestroyWindow(hwnd);
- RedrawWindow(fdat->m_hwndOwner, nullptr, nullptr, RDW_INVALIDATE|RDW_FRAME);
- PostMessage(fdat->m_hwndOwner, WM_APP, 0, 0);
- }
- else if (wParam == VK_ESCAPE) {
- DestroyWindow(hwnd);
- return 0;
- }
-
- PostMessage(fdat->m_hwndOwner, WM_APP, 1, 0);
- break;
-
- case WM_KILLFOCUS:
- DestroyWindow(hwnd);
- return 0;
-
- case WM_DESTROY:
- fdat->m_hwndEditBox = nullptr;
- }
-
- return CallWindowProc(fdat->m_oldWndProc, hwnd, msg, wParam, lParam);
-}
-
-void CCtrlFilterListView::FilterHighlight(wchar_t *str)
-{
- wchar_t buf[256];
- int count = GetItemCount();
- for (int i=0; i < count; i++) {
- bool found = false;
- if (str) {
- for (int j = 0; j < 10; ++j) {
- GetItemText(i, j, buf, _countof(buf));
- if (!*buf)
- break;
-
- if (wcsstr(buf, str)) {
- found = true;
- break;
- }
- }
- }
-
- SetItemState(i, found ? LVIS_DROPHILITED : 0, LVIS_DROPHILITED);
- }
-}
-
-LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
-{
- POINT pt;
-
- switch (msg) {
- case WM_APP:
- switch (wParam) {
- case 0:
- OnFilterChanged(this);
- if (!m_keepHiglight)
- FilterHighlight(nullptr);
- break;
-
- case 1:
- if (m_trackFilter && fdat->m_hwndEditBox) {
- wchar_t *str = nullptr;
- int length = GetWindowTextLength(fdat->m_hwndEditBox) + 1;
- if (length == 1)
- str = nullptr;
- else {
- str = (wchar_t *)mir_alloc(sizeof(wchar_t) * length);
- GetWindowText(fdat->m_hwndEditBox, str, length);
- }
- FilterHighlight(str);
- if (str) mir_free(str);
- }
- break;
-
- case 2:
- fdat->m_hwndOwner = m_hwnd;
- fdat->m_hwndEditBox = CreateWindow(L"edit", fdat->m_filterText,
- WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_LEFT|ES_AUTOHSCROLL,
- 0, 0, 0, 0,
- ::GetParent(m_hwnd), (HMENU)-1, g_plugin.getInst(), nullptr);
-
- SendMessage(fdat->m_hwndEditBox, WM_SETFONT, (WPARAM)fdat->m_hfntNormal, 0);
-
- RECT rc = fdat->m_rcEditBox;
- MapWindowPoints(m_hwnd, ::GetParent(m_hwnd), (LPPOINT)&rc, 2);
- SetWindowPos(fdat->m_hwndEditBox, HWND_TOP, rc.left-5, rc.top+2, rc.right-rc.left, rc.bottom-rc.top-4, SWP_SHOWWINDOW);
- SendMessage(fdat->m_hwndEditBox, EM_SETSEL, 0, -1);
-
- fdat->m_oldWndProc = (WNDPROC)GetWindowLongPtr(fdat->m_hwndEditBox, GWLP_WNDPROC);
- SetWindowLongPtr(fdat->m_hwndEditBox, GWLP_USERDATA, (LONG_PTR)fdat);
- SetWindowLongPtr(fdat->m_hwndEditBox, GWLP_WNDPROC, (LONG_PTR)sttEditBoxSubclassProc);
-
- SetFocus(m_hwnd); // hack to avoid popping of list over the box...
- SetFocus(fdat->m_hwndEditBox);
- }
- break;
-
- case WM_NCCALCSIZE:
- {
- RECT *prect = (RECT *)lParam;
-
- CSuper::CustomWndProc(msg, wParam, lParam);
- prect->bottom -= FILTER_BOX_HEIGHT;
-
- fdat->ReleaseFilterData();
-
- fdat->m_hfntNormal = (HFONT)SendMessage(m_hwnd, WM_GETFONT, 0, 0);
- if (!fdat->m_hfntNormal)
- fdat->m_hfntNormal = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
-
- LOGFONT lf;
- GetObject(fdat->m_hfntNormal, sizeof(lf), &lf);
- lf.lfItalic = TRUE;
- fdat->m_hfntEmpty = CreateFontIndirect(&lf);
-
- COLORREF clText = GetSysColor(COLOR_WINDOWTEXT);
- COLORREF clBack = GetSysColor(COLOR_WINDOW);
- fdat->m_clGray = RGB(
- (GetRValue(clBack) + 2*GetRValue(clText)) / 3,
- (GetGValue(clBack) + 2*GetGValue(clText)) / 3,
- (GetBValue(clBack) + 2*GetBValue(clText)) / 3);
-
- if (fdat->m_hwndEditBox)
- DestroyWindow(fdat->m_hwndEditBox);
- }
- return 0;
-
- case WM_NCPAINT:
- CSuper::CustomWndProc(msg, wParam, lParam);
- {
- RECT rc;
- GetWindowRect(m_hwnd, &rc);
- OffsetRect(&rc, -rc.left, -rc.top);
- InflateRect(&rc, -1, -1);
- rc.top = rc.bottom - FILTER_BOX_HEIGHT;
-
- POINT pts[] = {
- {rc.left, rc.top},
- {rc.left+FILTER_BOX_HEIGHT, rc.top},
- {rc.left+FILTER_BOX_HEIGHT+FILTER_BOX_HEIGHT/2+1, rc.top+FILTER_BOX_HEIGHT/2+1},
- {rc.left+FILTER_BOX_HEIGHT, rc.top+FILTER_BOX_HEIGHT},
- {rc.left, rc.top+FILTER_BOX_HEIGHT},
- };
- HRGN hrgnFilter = CreatePolygonRgn(pts, _countof(pts), ALTERNATE);
-
- HDC hdc = GetWindowDC(m_hwnd);
-
- FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW));
- FillRgn(hdc, hrgnFilter, GetSysColorBrush(COLOR_BTNFACE));
-
- SetBkMode(hdc, TRANSPARENT);
-
- if (fdat->m_filterText) {
- SetRect(&fdat->m_rcButtonClear,
- rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2,
- rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2 + 16, rc.top + (FILTER_BOX_HEIGHT-16)/2 + 16);
-
- DrawIconEx(hdc, rc.left + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, g_LoadIconEx("sd_filter_apply"), 16, 16, 0, nullptr, DI_NORMAL);
- DrawIconEx(hdc, rc.right - FILTER_BOX_HEIGHT + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, Skin_LoadIcon(SKINICON_OTHER_DELETE), 16, 16, 0, nullptr, DI_NORMAL);
-
- rc.left += 5*FILTER_BOX_HEIGHT/3;
- rc.right -= 5*FILTER_BOX_HEIGHT/3;
-
- fdat->m_rcEditBox = rc;
-
- SelectObject(hdc, fdat->m_hfntNormal);
- ::SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
- DrawText(hdc, fdat->m_filterText, -1, &rc, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS);
- }
- else {
- SetRect(&fdat->m_rcButtonClear, 0, 0, 0, 0);
-
- DrawIconEx(hdc, rc.left + (FILTER_BOX_HEIGHT-16)/2, rc.top + (FILTER_BOX_HEIGHT-16)/2, g_LoadIconEx("sd_filter_reset"), 16, 16, 0, nullptr, DI_NORMAL);
-
- rc.left += 5*FILTER_BOX_HEIGHT/3;
- rc.right -= 5;
-
- fdat->m_rcEditBox = rc;
-
- SelectObject(hdc, fdat->m_hfntEmpty);
- ::SetTextColor(hdc, fdat->m_clGray);
- DrawText(hdc, TranslateT("Set filter..."), -1, &rc, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS);
- }
-
- ReleaseDC(m_hwnd, hdc);
-
- DeleteObject(hrgnFilter);
- }
- return 0;
-
- case WM_NCHITTEST:
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
- MapWindowPoints(nullptr, m_hwnd, &pt, 1);
-
- if (PtInRect(&fdat->m_rcButtonClear, pt))
- return HTBORDER;
- if (PtInRect(&fdat->m_rcEditBox, pt))
- return HTBORDER;
- break;
-
- case WM_NCLBUTTONUP:
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
- MapWindowPoints(nullptr, m_hwnd, &pt, 1);
-
- if (PtInRect(&fdat->m_rcButtonClear, pt)) {
- SetFocus(m_hwnd);
- if (fdat->m_filterText) mir_free(fdat->m_filterText);
- fdat->m_filterText = nullptr;
- RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE|RDW_FRAME);
- OnFilterChanged(this);
- FilterHighlight(nullptr);
- }
- else if (PtInRect(&fdat->m_rcEditBox, pt))
- PostMessage(m_hwnd, WM_APP, 2, 0);
- break;
-
- case WM_KEYDOWN:
- if (wParam == 'F' && GetAsyncKeyState(VK_CONTROL))
- PostMessage(m_hwnd, WM_APP, 2, 0);
- break;
- }
-
- return CSuper::CustomWndProc(msg, wParam, lParam);
-}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index aeb217c987..0956b06bfc 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -564,7 +564,7 @@ public: EnableControls();
}
- void btnAdd_OnClick(CCtrlFilterListView*)
+ void btnAdd_OnClick(CCtrlButton*)
{
CNoteItem *pNote = new CNoteItem();
CJabberDlgNoteItem dlg(this, pNote);
@@ -582,7 +582,7 @@ public: EnableControls();
}
- void btnEdit_OnClick(CCtrlFilterListView*)
+ void btnEdit_OnClick(CCtrlButton*)
{
int idx = m_lstNotes.GetCurSel();
if (idx != LB_ERR) {
@@ -597,7 +597,7 @@ public: EnableControls();
}
- void btnRemove_OnClick(CCtrlFilterListView*)
+ void btnRemove_OnClick(CCtrlButton*)
{
int idx = m_lstNotes.GetCurSel();
if (idx != LB_ERR) {
diff --git a/protocols/JabberG/src/resource.h b/protocols/JabberG/src/resource.h index 3c8e7fb5cf..7e5b5dd938 100644 --- a/protocols/JabberG/src/resource.h +++ b/protocols/JabberG/src/resource.h @@ -222,7 +222,6 @@ #define IDC_ACTIVATE 1245
#define IDC_BTN_NAVHOME 1246
#define IDC_UPLOAD 1246
-#define IDC_TXT_FILTERTEXT 1247
#define IDC_IMPORT 1247
#define IDC_BTN_FILTERRESET 1248
#define IDC_EXPORT 1248
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 71cf8f6314..7eb48fb6b7 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -143,32 +143,6 @@ protected: }
};
-struct CFilterData;
-class CCtrlFilterListView : public CCtrlListView
-{
- typedef CCtrlListView CSuper;
-
-public:
- CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight);
- ~CCtrlFilterListView();
-
- wchar_t *GetFilterText();
- CCallback<CCtrlFilterListView> OnFilterChanged;
-
-protected:
- CFilterData *fdat;
- bool m_trackFilter;
- bool m_keepHiglight;
-
- void OnInit();
- LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam);
- void FilterHighlight(wchar_t *filter);
-};
-
-#if !defined(OPENFILENAME_SIZE_VERSION_400)
- #define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME)
-#endif
-
/*******************************************************************
* Global constants
*******************************************************************/
|