Author: gedmurphy
Date: Thu Jun 19 03:36:17 2008
New Revision: 34022
URL:
http://svn.reactos.org/svn/reactos?rev=34022&view=rev
Log:
add all test dlls into the treeview
Added:
trunk/rostests/winetests/GUI/res/main.ico (with props)
trunk/rostests/winetests/GUI/res/tests.ico (with props)
Modified:
trunk/rostests/winetests/GUI/WinetestsGUI.rc
trunk/rostests/winetests/GUI/browsewnd.c
trunk/rostests/winetests/GUI/mainwnd.c
trunk/rostests/winetests/GUI/misc.c
trunk/rostests/winetests/GUI/precomp.h
trunk/rostests/winetests/GUI/resource.h
trunk/rostests/winetests/GUI/rsrc.rc
Modified: trunk/rostests/winetests/GUI/WinetestsGUI.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/WinetestsGU…
==============================================================================
--- trunk/rostests/winetests/GUI/WinetestsGUI.rc [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/WinetestsGUI.rc [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -3,9 +3,9 @@
#include "resource.h"
-#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Character Map\0"
-#define REACTOS_STR_INTERNAL_NAME "charmap\0"
-#define REACTOS_STR_ORIGINAL_FILENAME "charmap.exe\0"
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS API test GUI\0"
+#define REACTOS_STR_INTERNAL_NAME "WinetestsGUI\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "WinetestsGUI.exe\0"
//#include <reactos/version.rc>
#include "rsrc.rc"
Modified: trunk/rostests/winetests/GUI/browsewnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/browsewnd.c…
==============================================================================
--- trunk/rostests/winetests/GUI/browsewnd.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/browsewnd.c [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -1,5 +1,5 @@
/*
- * PROJECT: ReactOS Character Map
+ * PROJECT: ReactOS API Test GUI
* LICENSE: GPL - See COPYING in the top level directory
* FILE:
* PURPOSE: browse dialog implementation
@@ -10,6 +10,10 @@
#include <precomp.h>
#define DLL_SEARCH_DIR L"\\Debug\\testlibs\\*"
+#define IL_MAIN 0
+#define IL_TEST 1
+
+typedef wchar_t *(__cdecl *DLLNAME)();
static INT
GetNumberOfDllsInFolder(LPWSTR lpFolder)
@@ -128,31 +132,67 @@
static VOID
PopulateTreeView(PMAIN_WND_INFO pInfo)
{
- HWND hTreeView;
HTREEITEM hRoot;
- HBITMAP hComp;
- TCHAR ComputerName[MAX_PATH];
- DWORD dwSize = MAX_PATH;
- INT RootImage;
-
- hTreeView = GetDlgItem(pInfo->hBrowseDlg, IDC_TREEVIEW);
-
- (void)TreeView_DeleteAllItems(hTreeView);
-
- /* insert the root item into the tree */
- hRoot = InsertIntoTreeView(hTreeView,
+ HIMAGELIST hImgList;
+ DLLNAME GetTestName;
+ HMODULE hDll;
+ LPWSTR lpDllPath;
+ LPWSTR lpTestName;
+ INT RootImage, i;
+
+ pInfo->hBrowseTV = GetDlgItem(pInfo->hBrowseDlg, IDC_TREEVIEW);
+
+ (void)TreeView_DeleteAllItems(pInfo->hBrowseTV);
+
+ hImgList = InitImageList(IDI_ICON,
+ IDI_TESTS,
+ 16,
+ 16);
+ if (!hImgList) return;
+
+ (void)TreeView_SetImageList(pInfo->hBrowseTV,
+ hImgList,
+ TVSIL_NORMAL);
+
+ /* insert the root item into the tree */
+ hRoot = InsertIntoTreeView(pInfo->hBrowseTV,
NULL,
- ComputerName,
+ L"Full",
NULL,
- 0);//RootImage);
+ IL_MAIN);
+
+ for (i = 0; i < pInfo->numDlls; i++)
+ {
+ lpDllPath = pInfo->lpDllList + (MAX_PATH * i);
+
+ hDll = LoadLibraryW(lpDllPath);
+ if (hDll)
+ {
+ GetTestName = (DLLNAME)GetProcAddress(hDll, "GetTestName");
+ if (GetTestName)
+ {
+ lpTestName = GetTestName();
+
+ InsertIntoTreeView(pInfo->hBrowseTV,
+ hRoot,
+ lpTestName,
+ lpDllPath,
+ IL_TEST);
+
+ // add individual tests as children
+
+ }
+
+ FreeLibrary(hDll);
+ }
+ }
}
static VOID
PopulateTestList(PMAIN_WND_INFO pInfo)
{
- INT numFiles;
-
- if ((numFiles = GetListOfTestDlls(pInfo)))
+ pInfo->numDlls = GetListOfTestDlls(pInfo);
+ if (pInfo->numDlls)
{
PopulateTreeView(pInfo);
}
Modified: trunk/rostests/winetests/GUI/mainwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/mainwnd.c?r…
==============================================================================
--- trunk/rostests/winetests/GUI/mainwnd.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/mainwnd.c [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -1,5 +1,5 @@
/*
- * PROJECT: ReactOS Character Map
+ * PROJECT: ReactOS API Test GUI
* LICENSE: GPL - See COPYING in the top level directory
* FILE:
* PURPOSE: main dialog implementation
Modified: trunk/rostests/winetests/GUI/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/misc.c?rev=…
==============================================================================
--- trunk/rostests/winetests/GUI/misc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/misc.c [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -1,5 +1,5 @@
/*
- * PROJECT: ReactOS Services
+ * PROJECT: ReactOS API Test GUI
* LICENSE: GPL - See COPYING in the top level directory
* FILE:
* PURPOSE: miscallanous functions
@@ -221,15 +221,15 @@
UINT Width,
UINT Height)
{
- HBITMAP hBitmap;
+ HICON hIcon;
HIMAGELIST hImageList;
UINT i;
- INT Ret;
+ INT Ret;
/* Create the toolbar icon image list */
hImageList = ImageList_Create(Width,
Height,
- ILC_MASK | ILC_COLOR24,
+ ILC_MASK | ILC_COLOR32,
EndResource - StartResource,
0);
if (hImageList == NULL)
@@ -238,23 +238,26 @@
/* Add all icons to the image list */
for (i = StartResource; i <= EndResource; i++)
{
- hBitmap = (HBITMAP)LoadImage(hInstance,
- MAKEINTRESOURCE(i),
- IMAGE_BITMAP,
- Width,
- Height,
- LR_LOADTRANSPARENT);
- if (hBitmap == NULL)
- return NULL;
-
- Ret = ImageList_AddMasked(hImageList,
- hBitmap,
- RGB(255, 0, 128));
+ hIcon = (HBITMAP)LoadImage(hInstance,
+ MAKEINTRESOURCE(i),
+ IMAGE_ICON,
+ Width,
+ Height,
+ LR_DEFAULTCOLOR);
+ if (hIcon == NULL)
+ goto fail;
+
+ Ret = ImageList_AddIcon(hImageList,
+ hIcon);
if (Ret == -1)
- return NULL;
-
- DeleteObject(hBitmap);
+ goto fail;
+
+ DestroyIcon(hIcon);
}
return hImageList;
-}
+
+fail:
+ ImageList_Destroy(hImageList);
+ return NULL;
+}
Modified: trunk/rostests/winetests/GUI/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/precomp.h?r…
==============================================================================
--- trunk/rostests/winetests/GUI/precomp.h [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/precomp.h [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -11,10 +11,11 @@
typedef struct _MAIN_WND_INFO
{
- HWND hMainWnd;
- HWND hBrowseDlg;
- HWND hStatus;
- int nCmdShow;
+ HWND hMainWnd;
+ HWND hBrowseDlg;
+ HWND hBrowseTV;
+ HWND hStatus;
+ int nCmdShow;
HICON hSmIcon;
HICON hBgIcon;
@@ -25,14 +26,19 @@
BOOL bIsUserAnAdmin;
LPWSTR lpDllList;
+ INT numDlls;
} MAIN_WND_INFO, *PMAIN_WND_INFO;
+
+/* dll exports */
+wchar_t *GetTestName();
/* browsewnd.c */
BOOL CALLBACK BrowseDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
/* misc.c */
+HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height);
VOID DisplayString(LPWSTR lpMsg);
VOID DisplayError(INT err);
Added: trunk/rostests/winetests/GUI/res/main.ico
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/res/main.ic…
==============================================================================
Binary file - no diff available.
Propchange: trunk/rostests/winetests/GUI/res/main.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/rostests/winetests/GUI/res/tests.ico
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/res/tests.i…
==============================================================================
Binary file - no diff available.
Propchange: trunk/rostests/winetests/GUI/res/tests.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: trunk/rostests/winetests/GUI/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/resource.h?…
==============================================================================
--- trunk/rostests/winetests/GUI/resource.h [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/resource.h [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -3,7 +3,7 @@
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_ICON 107
-#define IDI_SMALL 108
+#define IDI_TESTS 108
#define IDC_DELETE 109
#define IDR_MAINFRAME 128
#define IDC_LIST 1000
Modified: trunk/rostests/winetests/GUI/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/GUI/rsrc.rc?rev…
==============================================================================
--- trunk/rostests/winetests/GUI/rsrc.rc [iso-8859-1] (original)
+++ trunk/rostests/winetests/GUI/rsrc.rc [iso-8859-1] Thu Jun 19 03:36:17 2008
@@ -3,7 +3,8 @@
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-IDI_ICON ICON "res/charmap.ico"
+IDI_ICON ICON "res/main.ico"
+IDI_TESTS ICON "res/tests.ico"
//#include "lang/bg-BG.rc"
//#include "lang/ca-ES.rc"