- Load 16x16 and 32x32 icons.

- Use masked image lists.
- Clean-up menu IDs.

svn path=/trunk/; revision=9924
This commit is contained in:
Eric Kohl 2004-06-29 12:03:56 +00:00
parent c2f6de9e7b
commit 56df203d1b
4 changed files with 30 additions and 34 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1 2004/06/18 20:43:44 kuehng Exp $ # $Id: Makefile,v 1.2 2004/06/29 12:03:56 ekohl Exp $
PATH_TO_TOP = ../../.. PATH_TO_TOP = ../../..
@ -10,9 +10,7 @@ TARGET_INSTALLDIR = system32
TARGET_APPTYPE = windows TARGET_APPTYPE = windows
MK_CFLAGS = -D_UNICODE -DUNICODE TARGET_CFLAGS = -D_UNICODE -DUNICODE
MK_CPPFLAGS = -D_UNICODE -DUNICODE
MK_RCFLAGS = -D_UNICODE -DUNICODE
TARGET_SDKLIBS = kernel32.a user32.a comctl32.a TARGET_SDKLIBS = kernel32.a user32.a comctl32.a

View file

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: control.c,v 1.2 2004/06/28 12:05:16 ekohl Exp $ /* $Id: control.c,v 1.3 2004/06/29 12:03:56 ekohl Exp $
* *
* PROJECT: ReactOS System Control Panel * PROJECT: ReactOS System Control Panel
* FILE: lib/cpl/system/control.c * FILE: lib/cpl/system/control.c
@ -86,8 +86,8 @@ void PopulateCPLList(HWND hLisCtrl)
GetSystemDirectory(pszSearchPath,MAX_PATH); GetSystemDirectory(pszSearchPath,MAX_PATH);
_tcscat(pszSearchPath,_T("\\*.cpl")); _tcscat(pszSearchPath,_T("\\*.cpl"));
hFind = FindFirstFile(pszSearchPath,&fd); hFind = FindFirstFile(pszSearchPath,&fd);
hImgListSmall = ImageList_Create(16,16,ILC_COLOR,256,1000); hImgListSmall = ImageList_Create(16,16,ILC_COLOR | ILC_MASK,256,1000);
hImgListLarge = ImageList_Create(32,32,ILC_COLOR,256,1000); hImgListLarge = ImageList_Create(32,32,ILC_COLOR | ILC_MASK,256,1000);
while(hFind != INVALID_HANDLE_VALUE) while(hFind != INVALID_HANDLE_VALUE)
{ {
CPLLISTENTRY *pEntry; CPLLISTENTRY *pEntry;
@ -114,10 +114,12 @@ void PopulateCPLList(HWND hLisCtrl)
int index; int index;
pEntry->pFunc(hLisCtrl,CPL_INQUIRE,0,(LPARAM)&pEntry->CPLInfo); pEntry->pFunc(hLisCtrl,CPL_INQUIRE,0,(LPARAM)&pEntry->CPLInfo);
hIcon = LoadIcon(pEntry->hDLL,MAKEINTRESOURCE(pEntry->CPLInfo.idIcon)); hIcon = LoadImage(pEntry->hDLL,MAKEINTRESOURCE(pEntry->CPLInfo.idIcon),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
index = ImageList_AddIcon(hImgListSmall,hIcon); index = ImageList_AddIcon(hImgListSmall,hIcon);
DestroyIcon(hIcon);
hIcon = LoadImage(pEntry->hDLL,MAKEINTRESOURCE(pEntry->CPLInfo.idIcon),IMAGE_ICON,32,32,LR_DEFAULTCOLOR);
ImageList_AddIcon(hImgListLarge,hIcon); ImageList_AddIcon(hImgListLarge,hIcon);
DestroyIcon(hIcon);
LoadString(pEntry->hDLL,pEntry->CPLInfo.idName,Name,MAX_PATH); LoadString(pEntry->hDLL,pEntry->CPLInfo.idName,Name,MAX_PATH);
if(_tcslen(Name)) if(_tcslen(Name))
@ -221,22 +223,22 @@ LRESULT CALLBACK MyWindowProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
case WM_COMMAND: case WM_COMMAND:
switch(LOWORD(wParam)) switch(LOWORD(wParam))
{ {
case CM_LARGEICONS: case IDM_LARGEICONS:
SetWindowLong(hListView,GWL_STYLE,LVS_ICON | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP); SetWindowLong(hListView,GWL_STYLE,LVS_ICON | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break; break;
case CM_SMALLICONS: case IDM_SMALLICONS:
SetWindowLong(hListView,GWL_STYLE,LVS_SMALLICON | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP); SetWindowLong(hListView,GWL_STYLE,LVS_SMALLICON | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break; break;
case CM_LIST: case IDM_LIST:
SetWindowLong(hListView,GWL_STYLE,LVS_LIST | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP); SetWindowLong(hListView,GWL_STYLE,LVS_LIST | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break; break;
case CM_DETAILS: case IDM_DETAILS:
SetWindowLong(hListView,GWL_STYLE,LVS_REPORT | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP); SetWindowLong(hListView,GWL_STYLE,LVS_REPORT | LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_SINGLESEL | WS_VISIBLE | WS_CHILD|WS_BORDER|WS_TABSTOP);
break; break;
case CM_CLOSE: case IDM_CLOSE:
DestroyWindow(hWnd); DestroyWindow(hWnd);
break; break;
case CM_ABOUT: case IDM_ABOUT:
MessageBox(hWnd,_T("Simple Control Panel (not Shell-namespace based)\rCopyright 2004 GkWare e.K.\rhttp://www.gkware.com\rReleased under the GPL"),_T("About the Control Panel"),MB_OK | MB_ICONINFORMATION); MessageBox(hWnd,_T("Simple Control Panel (not Shell-namespace based)\rCopyright 2004 GkWare e.K.\rhttp://www.gkware.com\rReleased under the GPL"),_T("About the Control Panel"),MB_OK | MB_ICONINFORMATION);
break; break;
} }

View file

@ -21,18 +21,18 @@ IDM_MAINMENU MENU DISCARDABLE
BEGIN BEGIN
POPUP "&File" POPUP "&File"
BEGIN BEGIN
MENUITEM "&Close", CM_CLOSE MENUITEM "&Close", IDM_CLOSE
END END
POPUP "&View" POPUP "&View"
BEGIN BEGIN
MENUITEM "Large Icons", CM_LARGEICONS MENUITEM "Large Icons", IDM_LARGEICONS
MENUITEM "Small Icons", CM_SMALLICONS MENUITEM "Small Icons", IDM_SMALLICONS
MENUITEM "List", CM_LIST MENUITEM "List", IDM_LIST
MENUITEM "Details", CM_DETAILS MENUITEM "Details", IDM_DETAILS
END END
POPUP "Help" POPUP "Help"
BEGIN BEGIN
MENUITEM "About", CM_ABOUT MENUITEM "About", IDM_ABOUT
END END
END END

View file

@ -2,25 +2,21 @@
// Microsoft Developer Studio generated include file. // Microsoft Developer Studio generated include file.
// Used by control.rc // Used by control.rc
// //
#define IDR_MENU1 101 #define IDI_MAINICON 100
#define IDM_MAINMENU 101 #define IDM_MAINMENU 101
#define IDI_MAINICON 104 #define IDM_LARGEICONS 40000
#define ID_VIEW_LARGEICONS 40002 #define IDM_SMALLICONS 40001
#define CM_LARGEICONS 40002 #define IDM_LIST 40002
#define ID_VIEW_SMALLICONS 40003 #define IDM_DETAILS 40003
#define CM_SMALLICONS 40003 #define IDM_ABOUT 40004
#define ID_HELP_ABOUT 40007 #define IDM_CLOSE 40005
#define CM_ABOUT 40007
#define CM_CLOSE 40008
#define CM_LIST 40009
#define CM_DETAILS 40010
// Next default values for new objects // Next default values for new objects
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40011 #define _APS_NEXT_COMMAND_VALUE 40006
#define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif