another gphoto2 ui change
Aric Stewart
aric at codeweavers.com
Thu May 4 15:17:40 CDT 2006
Gphoto2 UI changes,
rename the Import button to Import Selected
disable or enable that button depending on if pictures are selected.
-------------- next part --------------
diff --git a/dlls/gphoto2.ds/gphoto2_En.rc b/dlls/gphoto2.ds/gphoto2_En.rc
index afe6173..80848b1 100644
--- a/dlls/gphoto2.ds/gphoto2_En.rc
+++ b/dlls/gphoto2.ds/gphoto2_En.rc
@@ -29,7 +29,7 @@ FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List1",IDC_LIST1,"SysListView32", LVS_ICON | WS_BORDER |
WS_TABSTOP,7,7,358,229
- DEFPUSHBUTTON "Import Files",IDC_IMPORT,227,252,54,14
+ DEFPUSHBUTTON "Import Selected",IDC_IMPORT,225,252,56,14
PUSHBUTTON "Import All",IDC_IMPORTALL,7,252,52,14
PUSHBUTTON "Exit",IDC_EXIT,295,252,50,14
END
diff --git a/dlls/gphoto2.ds/ui.c b/dlls/gphoto2.ds/ui.c
index a75f69e..f074249 100644
--- a/dlls/gphoto2.ds/ui.c
+++ b/dlls/gphoto2.ds/ui.c
@@ -124,6 +124,7 @@ static INT_PTR CALLBACK DialogProc(HWND
{
HIMAGELIST ilist = 0;
HWND list = GetDlgItem(hwnd,IDC_LIST1);
+ EnableWindow(GetDlgItem(hwnd,IDC_IMPORT),FALSE);
PopulateImageList(&ilist,list);
@@ -131,6 +132,17 @@ static INT_PTR CALLBACK DialogProc(HWND
PopulateListView(list);
}
break;
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == LVN_ITEMCHANGED)
+ {
+ HWND list = GetDlgItem(hwnd,IDC_LIST1);
+ int count = SendMessageA(list,LVM_GETSELECTEDCOUNT,0,0);
+ if (count > 0)
+ EnableWindow(GetDlgItem(hwnd,IDC_IMPORT),TRUE);
+ else
+ EnableWindow(GetDlgItem(hwnd,IDC_IMPORT),FALSE);
+ }
+ break;
case WM_COMMAND:
switch LOWORD(wParam)
{
More information about the wine-patches
mailing list