commit f75c89c1282b9d105c1695a3df1a17371a8efa1a
parent 5820baf5d0ddd9c64206e56b2b4460dfbac3c41a
Author: cfillion <cfillion@users.noreply.github.com>
Date: Tue, 29 Dec 2015 23:13:04 -0800
fix list selection on windows
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/listview.cpp b/src/listview.cpp
@@ -17,7 +17,9 @@
#include "listview.hpp"
+#ifdef _WIN32
#include <commctrl.h>
+#endif
using namespace std;
@@ -26,6 +28,10 @@ ListView::ListView(const Columns &columns, HWND handle)
{
for(const Column &col : columns)
addColumn(col.first, col.second);
+
+ // For some reason FULLROWSELECT doesn't work from the resource file
+ ListView_SetExtendedListViewStyleEx(m_handle,
+ LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
}
void ListView::addColumn(const auto_char *text, const int width)
diff --git a/src/resource.rc b/src/resource.rc
@@ -30,7 +30,8 @@ FONT DIALOG_FONT
CAPTION "ReaPack Configuration"
BEGIN
LTEXT "Enabled remotes:", IDC_LABEL, 5, 5, 290, 10
- CONTROL "", IDC_LIST, WC_LISTVIEW, LVS_REPORT | WS_BORDER, 5, 18, 290, 130
+ CONTROL "", IDC_LIST, WC_LISTVIEW, LVS_REPORT | LVS_SINGLESEL |
+ LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 5, 18, 290, 136
PUSHBUTTON "Import", IDC_IMPORT, 5, 160, 40, 14
PUSHBUTTON "Remove", IDC_REMOVE, 48, 160, 40, 14
DEFPUSHBUTTON "Close", IDOK, 244, 160, 50, 14