Alexander Nicolaysen Sørnes : uninstaller: Disable Uninstall button when no items selected.

Alexandre Julliard julliard at winehq.org
Thu Jan 24 07:21:16 CST 2008


Module: wine
Branch: master
Commit: 6898c9e51bda0aa4f8757ecbb68a0540b352e879
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6898c9e51bda0aa4f8757ecbb68a0540b352e879

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Thu Jan 24 00:28:17 2008 +0100

uninstaller: Disable Uninstall button when no items selected.

---

 programs/uninstaller/main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c
index 72d62f0..d731de4 100644
--- a/programs/uninstaller/main.c
+++ b/programs/uninstaller/main.c
@@ -286,6 +286,10 @@ static void UninstallProgram(void)
     list_need_update = 1;
 }
 
+static void UpdateButtons(HWND hDlg, HWND hList)
+{
+    EnableWindow(GetDlgItem(hDlg, IDC_UNINSTALL), SendMessageW(hList, LB_GETSELCOUNT, 0, 0) > 0);
+}
 
 static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 {
@@ -299,6 +303,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
             GetTextMetricsW(hdc, &tm);
             UpdateList(hList);
             ReleaseDC(hwnd, hdc);
+            UpdateButtons(hwnd, hList);
             break;
         case WM_COMMAND:
             switch(LOWORD(wParam))
@@ -316,6 +321,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
                         }
                         else sFilter = NULL;
                         UpdateList(hList);
+                        UpdateButtons(hwnd, hList);
                     }
                     break;
                 }
@@ -326,6 +332,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
                     {
                         UninstallProgram();
                         UpdateList(hList);
+                        UpdateButtons(hwnd, hList);
                     }
                     break;
                 }
@@ -344,6 +351,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
                        wine_dbgstr_w(entries[sel].descr));
                        oldsel = sel;
                    }
+                    UpdateButtons(hwnd, hList);
                     break;
                 case IDC_ABOUT:
                     MessageBoxW(0, sAbout, sAboutTitle, MB_OK);




More information about the wine-cvs mailing list