Add search field with find-as-you-type function.
authorJonathan Ernst <Jonathan@ErnstFamily.ch>
Fri, 11 Mar 2005 10:26:41 +0000 (10:26 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 11 Mar 2005 10:26:41 +0000 (10:26 +0000)
programs/uninstaller/En.rc
programs/uninstaller/Makefile.in
programs/uninstaller/main.c
programs/uninstaller/rsrc.rc

index a85ee961868ffe99fcd956e3ac688da759498088..afc8488fbdc4516c5663e04f664e331835a21506 100644 (file)
@@ -26,6 +26,7 @@ CAPTION "Wine Application Uninstaller"
 FONT 10, "MS Sans Serif"
 BEGIN
     LTEXT           "Please select the application you wish to uninstall:",IDC_PLEASESELECT,10,10,250,14
+    EDITTEXT        IDC_FILTER,10,25,250,14,ES_AUTOHSCROLL
     LISTBOX         IDC_LIST,10,43,250,106,LBS_NOINTEGRALHEIGHT | 
                     LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "&Uninstall",IDC_UNINSTALL,270,48,50,14
@@ -37,7 +38,7 @@ END
 STRINGTABLE DISCARDABLE {
      IDS_APPNAME, "Wine Application Unsinstaller"
      IDS_ABOUT, "Wine Application Uninstaller (C) 2005 by Andreas Mohr, Hannu Valtonen and Jonathan Ernst."
-     IDS_ABOUTTITLE, "About Unsinstaller"
+     IDS_ABOUTTITLE, "About Uninstaller"
      IDS_REGISTRYKEYNOTAVAILABLE, "Uninstall registry key not available (yet), nothing to do !"
      IDS_UNINSTALLFAILED, "Execution of uninstall command '%s' failed, perhaps due to missing executable.\r\nDo you want to remove the uninstall entry from the registry ?"
 }
index 8ce7b9c38ae65915e7929817fd49a7e8979c6620..f7a7403f50e4d9853117948ce9ade309c01aeacd 100644 (file)
@@ -4,7 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = uninstaller.exe
 APPMODE   = -mconsole
-IMPORTS   = user32 gdi32 advapi32 kernel32
+IMPORTS   = shlwapi user32 gdi32 advapi32 kernel32
 
 C_SRCS = \
        main.c
index 458a1c3c43427a35036d3168d2594d744030dda7..d91426f7e717d0f8c266fa210dbe7f40889708a7 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * ToDo:
- * - add search box for locating entries quickly
  */
 
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <time.h>
 #include <windows.h>
+#include <shlwapi.h>
 #include "resource.h"
 #include "regstr.h"
 #include "wine/debug.h"
@@ -44,6 +42,7 @@ static uninst_entry *entries = NULL;
 static unsigned int numentries = 0;
 static int list_need_update = 1;
 static int oldsel = -1;
+static WCHAR *sFilter;
 static WCHAR sAppName[MAX_STRING_LEN];
 static WCHAR sAboutTitle[MAX_STRING_LEN];
 static WCHAR sAbout[MAX_STRING_LEN];
@@ -67,6 +66,7 @@ static const WCHAR PathUninstallW[] = {
         'U','n','i','n','s','t','a','l','l',0 };
 static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0};
 
+
 /**
  * Used to output program list when used with --list
  */
@@ -228,6 +228,8 @@ static int FetchUninstallInformation(void)
             RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)entries[numentries-1].command, &uninstlen);
             WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
             numentries, wine_dbgstr_w(entries[numentries-1].key), wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
+            if(sFilter != NULL && StrStrIW(entries[numentries-1].descr,sFilter)==NULL)
+                numentries--;
         }
         RegCloseKey(hkeyApp);
         sizeOfSubKeyName = 255;
@@ -295,6 +297,22 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
         case WM_COMMAND:
             switch(LOWORD(wParam))
             {
+                case IDC_FILTER:
+                {
+                    if (HIWORD(wParam) == EN_CHANGE)
+                    {
+                        int len = GetWindowTextLengthW(GetDlgItem(hwnd, IDC_FILTER));
+                        list_need_update = 1;
+                        if(len > 0)
+                        {
+                            sFilter = (WCHAR*)GlobalAlloc(GPTR, (len + 1)*sizeof(WCHAR));
+                            GetDlgItemTextW(hwnd, IDC_FILTER, sFilter, (len + 1)*sizeof(WCHAR));
+                        }
+                        else sFilter = NULL;
+                        UpdateList(hList);
+                    }
+                    break;
+                }
                 case IDC_UNINSTALL:
                 {
                     int count = SendMessageW(hList, LB_GETSELCOUNT, 0, 0);
index ef7ecaff15a89649d86b600e2d64336519a0a77b..15081531e003fbaa343fcd406d5188f24db39dc6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Uninstaller (rsrc.rc)
  *
- * Copyright 2000 Andreas Mohr <andi@lisas.de>
+ * Copyright 2000 Andreas Mohr
  * Copyright 2003 Vincent B�ron
  * Copyright 2003 Ivan Leo Puoti
  * Copyright 2004 David Kredba