diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-27 10:50:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-27 10:50:37 +0000 |
commit | 9580ae1f0619b89d9064f89e480903103efa22e7 (patch) | |
tree | f14f172f100330fd483bc0d0418163d8ad0ed3d6 | |
parent | 65d8fdb5c8c2e9572821d146a01184b95e60e966 (diff) |
fixes:
#502 (Profile manager: context menu can't be reached from the keyboard)
#579 (only 10 profiles are visible in Profile Manager)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8773 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/modules/database/profilemanager.cpp | 23 | ||||
-rw-r--r-- | src/resource.rc | 6 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index ea5b7e1a3b..a221e29a44 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -392,7 +392,7 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, ListView_InsertColumn(hwndList, 0, &col);
col.pszText = TranslateT("Driver");
- col.cx = 150;
+ col.cx = 150 - GetSystemMetrics(SM_CXVSCROLL);
ListView_InsertColumn(hwndList, 1, &col);
col.pszText = TranslateT("Size");
@@ -455,11 +455,24 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, lvht.pt.x = GET_X_LPARAM(lParam);
lvht.pt.y = GET_Y_LPARAM(lParam);
ScreenToClient(hwndList, &lvht.pt);
- if (ListView_HitTest(hwndList, &lvht) < 0)
- break;
- lvht.pt.x = GET_X_LPARAM(lParam);
- lvht.pt.y = GET_Y_LPARAM(lParam);
+ if (ListView_HitTest(hwndList, &lvht) < 0) {
+ if (lParam != -1)
+ break;
+
+ lvht.iItem = ListView_GetSelectionMark(hwndList);
+ RECT rc = { 0 };
+ if (!ListView_GetItemRect(hwndList, lvht.iItem, &rc, LVIR_LABEL))
+ break;
+
+ lvht.pt.x = rc.left;
+ lvht.pt.y = rc.bottom;
+ ClientToScreen(hwndList, &lvht.pt);
+ }
+ else {
+ lvht.pt.x = GET_X_LPARAM(lParam);
+ lvht.pt.y = GET_Y_LPARAM(lParam);
+ }
HMENU hMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, 1, TranslateT("Run"));
diff --git a/src/resource.rc b/src/resource.rc index 34597bf494..287b2ec578 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -391,7 +391,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP,0,3,365,138
+ CONTROL "List1",IDC_PROFILELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,0,3,207,117
END
IDD_PROFILE_NEW DIALOGEX 0, 0, 208, 122
@@ -1000,6 +1000,10 @@ BEGIN HORZGUIDE, 113
END
+ IDD_PROFILE_SELECTION, DIALOG
+ BEGIN
+ END
+
IDD_PROFILE_NEW, DIALOG
BEGIN
LEFTMARGIN, 7
|