Author: gedmurphy Date: Thu Jul 23 23:35:52 2009 New Revision: 42165
URL: http://svn.reactos.org/svn/reactos?rev=42165&view=rev Log: Draw the appropriate taskbar mockup image in the dialog when the user clicks the checkboxes
Added: trunk/reactos/base/shell/explorer-new/res/auto_hide.bmp (with props) trunk/reactos/base/shell/explorer-new/res/lock_group_noql.bmp (with props) trunk/reactos/base/shell/explorer-new/res/lock_group_ql.bmp (with props) trunk/reactos/base/shell/explorer-new/res/lock_nogroup_noql.bmp (with props) trunk/reactos/base/shell/explorer-new/res/lock_nogroup_ql.bmp (with props) trunk/reactos/base/shell/explorer-new/res/nolock_group_noql.bmp (with props) trunk/reactos/base/shell/explorer-new/res/nolock_nogroup_noql.bmp (with props) trunk/reactos/base/shell/explorer-new/res/nolock_nogroup_ql.bmp (with props) Modified: trunk/reactos/base/shell/explorer-new/explorer.rc trunk/reactos/base/shell/explorer-new/lang/en-US.rc trunk/reactos/base/shell/explorer-new/resource.h trunk/reactos/base/shell/explorer-new/trayprop.c
Modified: trunk/reactos/base/shell/explorer-new/explorer.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/exp... ============================================================================== --- trunk/reactos/base/shell/explorer-new/explorer.rc [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/explorer.rc [iso-8859-1] Thu Jul 23 23:35:52 2009 @@ -10,6 +10,16 @@
IDI_START ICON DISCARDABLE res/start.ico IDB_STARTMENU BITMAP DISCARDABLE res/logov.bmp + +IDB_TASKBARPROP_AUTOHIDE BITMAP DISCARDABLE res/auto_hide.bmp +IDB_TASKBARPROP_LOCK_GROUP_NOQL BITMAP DISCARDABLE res/lock_group_noql.bmp +IDB_TASKBARPROP_LOCK_GROUP_QL BITMAP DISCARDABLE res/lock_group_ql.bmp +IDB_TASKBARPROP_LOCK_NOGROUP_NOQL BITMAP DISCARDABLE res/lock_nogroup_noql.bmp +IDB_TASKBARPROP_LOCK_NOGROUP_QL BITMAP DISCARDABLE res/lock_nogroup_ql.bmp +IDB_TASKBARPROP_NOLOCK_GROUP_NOQL BITMAP DISCARDABLE res/nolock_group_noql.bmp +IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL BITMAP DISCARDABLE res/nolock_nogroup_noql.bmp +IDB_TASKBARPROP_NOLOCK_NOGROUP_QL BITMAP DISCARDABLE res/nolock_nogroup_ql.bmp +IDB_TASKBARPROP_NOLOCK_GROUP_QL BITMAP DISCARDABLE res/nolock_nogroup_ql.bmp
#include "lang/bg-BG.rc" #include "lang/cs-CZ.rc"
Modified: trunk/reactos/base/shell/explorer-new/lang/en-US.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/lan... ============================================================================== --- trunk/reactos/base/shell/explorer-new/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/lang/en-US.rc [iso-8859-1] Thu Jul 23 23:35:52 2009 @@ -59,14 +59,14 @@ CAPTION "Taskbar" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Taskbar appearance", IDC_STATIC, 6,6,240,121, WS_DISABLED - CONTROL "", IDC_TASKBARPROP_TASKBARBITMAP, "Static", SS_BITMAP | SS_SUNKEN, 13,18,224,21, WS_DISABLED - AUTOCHECKBOX "&Lock the taskbar", IDC_TASKBARPROP_LOCK, 13,45,200,10, WS_DISABLED - AUTOCHECKBOX "A&uto-hide the taskbar", IDC_TASKBARPROP_HIDE, 13,58,200,10, WS_DISABLED - AUTOCHECKBOX "Keep the &taskbar on top of other windows", IDC_TASKBARPROP_ONTOP, 13,71,200,10, WS_DISABLED - AUTOCHECKBOX "&Group similar taskbar buttons", IDC_TASKBARPROP_GROUP, 13,84,200,10, WS_DISABLED - AUTOCHECKBOX "Show &Quick Launch", IDC_TASKBARPROP_SHOWQL, 13,97,200,10, WS_DISABLED - AUTOCHECKBOX "&Show window previews (thumbnails)", IDC_TASKBARPROP_WNDPREV, 13,110,200,10, WS_DISABLED + GROUPBOX "Taskbar appearance", IDC_STATIC, 6,6,240,121, + CONTROL "", IDC_TASKBARPROP_TASKBARBITMAP, "Static", SS_BITMAP | SS_SUNKEN, 13,18,224,21, + AUTOCHECKBOX "&Lock the taskbar", IDC_TASKBARPROP_LOCK, 13,45,200,10, + AUTOCHECKBOX "A&uto-hide the taskbar", IDC_TASKBARPROP_HIDE, 13,58,200,10, + AUTOCHECKBOX "Keep the &taskbar on top of other windows", IDC_TASKBARPROP_ONTOP, 13,71,200,10, + AUTOCHECKBOX "&Group similar taskbar buttons", IDC_TASKBARPROP_GROUP, 13,84,200,10, + AUTOCHECKBOX "Show &Quick Launch", IDC_TASKBARPROP_SHOWQL, 13,97,200,10, + AUTOCHECKBOX "&Show window previews (thumbnails)", IDC_TASKBARPROP_WNDPREV, 13,110,200,10, END
IDD_TASKBARPROP_STARTMENU DIALOGEX 0, 0, 252, 218
Added: trunk/reactos/base/shell/explorer-new/res/auto_hide.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/auto_hide.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/lock_group_noql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/lock_group_noql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/lock_group_ql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/lock_group_ql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/lock_nogroup_noql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/lock_nogroup_noql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/lock_nogroup_ql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/lock_nogroup_ql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/nolock_group_noql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/nolock_group_noql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/nolock_nogroup_noql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/nolock_nogroup_noql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Added: trunk/reactos/base/shell/explorer-new/res/nolock_nogroup_ql.bmp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== Binary file - no diff available.
Propchange: trunk/reactos/base/shell/explorer-new/res/nolock_nogroup_ql.bmp ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
Modified: trunk/reactos/base/shell/explorer-new/resource.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/res... ============================================================================== --- trunk/reactos/base/shell/explorer-new/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/resource.h [iso-8859-1] Thu Jul 23 23:35:52 2009 @@ -54,6 +54,7 @@ #define IDD_NOTIFICATIONPAGE 2002 #define IDD_TOOLBARSPAGE 2003
+/* Taskbar properties, taskbar */ #define IDD_TASKBARPROP_TASKBAR 2000 #define IDC_TASKBARPROP_TASKBARBITMAP 2001 #define IDC_TASKBARPROP_LOCK 2002 @@ -63,6 +64,17 @@ #define IDC_TASKBARPROP_SHOWQL 2006 #define IDC_TASKBARPROP_WNDPREV 2007
+#define IDB_TASKBARPROP_AUTOHIDE 2050 +#define IDB_TASKBARPROP_LOCK_GROUP_NOQL 2051 +#define IDB_TASKBARPROP_LOCK_GROUP_QL 2052 +#define IDB_TASKBARPROP_LOCK_NOGROUP_NOQL 2053 +#define IDB_TASKBARPROP_LOCK_NOGROUP_QL 2054 +#define IDB_TASKBARPROP_NOLOCK_GROUP_NOQL 2055 +#define IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL 2056 +#define IDB_TASKBARPROP_NOLOCK_NOGROUP_QL 2057 +#define IDB_TASKBARPROP_NOLOCK_GROUP_QL 2058 + +/* Taskbar properties, startmenu*/ #define IDD_TASKBARPROP_STARTMENU 2100 #define IDC_TASKBARPROP_STARTMENU 2101 #define IDC_TASKBARPROP_STARTMENUCUST 2102 @@ -71,6 +83,7 @@ #define IDC_TASKBARPROP_RECENTFILES 2105 #define IDC_TASKBARPROP_RECENTFOLDERS 2106
+/* Taskbar properties, notification */ #define IDD_TASKBARPROP_NOTIFICATION 2200 #define IDC_TASKBARPROP_NOTIFICATIONBITMAP 2201 #define IDC_TASKBARPROP_HIDEICONS 2202 @@ -80,6 +93,7 @@ #define IDC_TASKBARPROP_NETWORK 2206 #define IDC_TASKBARPROP_POWER 2207
+/* Taskbar properties, toolbars */ #define IDD_TASKBARPROP_TOOLBARS 2300 #define IDC_TASKBARPROP_DESKBANDLIST 2301
Modified: trunk/reactos/base/shell/explorer-new/trayprop.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/trayprop.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/trayprop.c [iso-8859-1] Thu Jul 23 23:35:52 2009 @@ -20,35 +20,170 @@
#include <precomp.h>
+typedef struct _PROPSHEET_INFO +{ + HWND hTaskbarWnd; + HWND hStartWnd; + HWND hNotiWnd; + HWND hToolWnd; + + HBITMAP hTaskbarBitmap; +} PROPSHEET_INFO, *PPROPSHEET_INFO; + + +static BOOL +UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo) +{ + HWND hwndLock, hwndHide, hwndGroup, hwndShowQL; + HWND hwndBitmap; + BOOL bLock, bHide, bGroup, bShowQL; + LPTSTR lpImageName = NULL; + RECT BitmapRect; + BOOL bRet = FALSE; + + hwndLock = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_LOCK); + hwndHide = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_HIDE); + hwndGroup = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_GROUP); + hwndShowQL = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_SHOWQL); + + if (hwndLock && hwndHide && hwndGroup && hwndShowQL) + { + bLock = (SendMessage(hwndLock, BM_GETCHECK, 0, 0) == BST_CHECKED); + bHide = (SendMessage(hwndHide, BM_GETCHECK, 0, 0) == BST_CHECKED); + bGroup = (SendMessage(hwndGroup, BM_GETCHECK, 0, 0) == BST_CHECKED); + bShowQL = (SendMessage(hwndShowQL, BM_GETCHECK, 0, 0) == BST_CHECKED); + + if (bHide) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_AUTOHIDE); + else if (bLock && bGroup && bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_GROUP_QL); + else if (bLock && !bGroup && !bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_NOGROUP_NOQL); + else if (bLock && bGroup && !bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_GROUP_NOQL); + else if (bLock && !bGroup && bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_NOGROUP_QL); + else if (!bLock && !bGroup && !bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL); + else if (!bLock && bGroup && !bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_GROUP_NOQL); + else if (!bLock && !bGroup && bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_NOGROUP_QL); + else if (!bLock && bGroup && bShowQL) + lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_GROUP_QL); + + if (lpImageName) + { + if (pPropInfo->hTaskbarBitmap) + { + DeleteObject(pPropInfo->hTaskbarBitmap); + } + + pPropInfo->hTaskbarBitmap = LoadImage(hExplorerInstance, + lpImageName, + IMAGE_BITMAP, + 0, + 0, + LR_DEFAULTCOLOR); + if (pPropInfo->hTaskbarBitmap) + { + hwndBitmap = GetDlgItem(pPropInfo->hTaskbarWnd, + IDC_TASKBARPROP_TASKBARBITMAP); + if (hwndBitmap) + { + SendMessage(hwndBitmap, + STM_SETIMAGE, + IMAGE_BITMAP, + (LPARAM)pPropInfo->hTaskbarBitmap); + } + } + } + } + + return bRet; +} + +static VOID +OnCreateTaskbarPage(HWND hwnd, + PPROPSHEET_INFO pPropInfo) +{ + SetWindowLongPtr(hwnd, + GWLP_USERDATA, + (LONG_PTR)pPropInfo); + + pPropInfo->hTaskbarWnd = hwnd; + + // FIXME: check buttons + + UpdateTaskbarBitmap(pPropInfo); +} + INT_PTR CALLBACK TaskbarPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + PPROPSHEET_INFO pPropInfo; + + /* Get the window context */ + pPropInfo = (PPROPSHEET_INFO)GetWindowLongPtrW(hwndDlg, + GWLP_USERDATA); + if (pPropInfo == NULL && uMsg != WM_INITDIALOG) + { + goto HandleDefaultMessage; + } + switch (uMsg) { case WM_INITDIALOG: - break; + OnCreateTaskbarPage(hwndDlg, (PPROPSHEET_INFO)lParam); + break; + + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case IDC_TASKBARPROP_LOCK: + case IDC_TASKBARPROP_HIDE: + case IDC_TASKBARPROP_GROUP: + case IDC_TASKBARPROP_SHOWQL: + if (HIWORD(wParam) == BN_CLICKED) + { + UpdateTaskbarBitmap(pPropInfo); + + /* Enable the 'Apply' button */ + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + break; + + case WM_NOTIFY: + { + LPNMHDR pnmh = (LPNMHDR)lParam; + + switch(pnmh->code) + { + case PSN_SETACTIVE: + break; + + case PSN_APPLY: + break; + } + + break; + }
case WM_DESTROY: - break; - - case WM_NOTIFY: - { - LPNMHDR pnmh = (LPNMHDR)lParam; - - switch(pnmh->code) - { - case PSN_SETACTIVE: - break; - - case PSN_APPLY: - break; - } - - break; - } + if (pPropInfo->hTaskbarBitmap) + { + DeleteObject(pPropInfo->hTaskbarBitmap); + } + break; + +HandleDefaultMessage: + default: + return FALSE; }
return FALSE; @@ -161,13 +296,17 @@
static VOID -InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc) +InitPropSheetPage(PROPSHEETPAGE *psp, + WORD idDlg, + DLGPROC DlgProc, + LPARAM lParam) { ZeroMemory(psp, sizeof(PROPSHEETPAGE)); psp->dwSize = sizeof(PROPSHEETPAGE); psp->dwFlags = PSP_DEFAULT; psp->hInstance = hExplorerInstance; psp->pszTemplate = MAKEINTRESOURCE(idDlg); + psp->lParam = lParam; psp->pfnDlgProc = DlgProc; }
@@ -175,9 +314,19 @@ HWND DisplayTrayProperties(ITrayWindow *Tray) { + PPROPSHEET_INFO pPropInfo; PROPSHEETHEADER psh; PROPSHEETPAGE psp[4]; TCHAR szCaption[256]; + HWND hwnd = 0; + + pPropInfo = (PPROPSHEET_INFO)HeapAlloc(hProcessHeap, + HEAP_ZERO_MEMORY, + sizeof(PROPSHEET_INFO)); + if (!pPropInfo) + { + return NULL; + }
if (!LoadString(hExplorerInstance, IDS_TASKBAR_STARTMENU_PROP_CAPTION, @@ -198,10 +347,17 @@ psh.nStartPage = 0; psh.ppsp = psp;
- InitPropSheetPage(&psp[0], IDD_TASKBARPROP_TASKBAR, (DLGPROC)TaskbarPageProc); - InitPropSheetPage(&psp[1], IDD_TASKBARPROP_STARTMENU, (DLGPROC)StartMenuPageProc); - InitPropSheetPage(&psp[2], IDD_TASKBARPROP_NOTIFICATION, (DLGPROC)NotificationPageProc); - InitPropSheetPage(&psp[3], IDD_TASKBARPROP_TOOLBARS, (DLGPROC)ToolbarsPageProc); - - return (HWND)PropertySheet(&psh); -} + InitPropSheetPage(&psp[0], IDD_TASKBARPROP_TASKBAR, (DLGPROC)TaskbarPageProc, (LPARAM)pPropInfo); + InitPropSheetPage(&psp[1], IDD_TASKBARPROP_STARTMENU, (DLGPROC)StartMenuPageProc, (LPARAM)pPropInfo); + InitPropSheetPage(&psp[2], IDD_TASKBARPROP_NOTIFICATION, (DLGPROC)NotificationPageProc, (LPARAM)pPropInfo); + InitPropSheetPage(&psp[3], IDD_TASKBARPROP_TOOLBARS, (DLGPROC)ToolbarsPageProc, (LPARAM)pPropInfo); + + PropertySheet(&psh); + + HeapFree(hProcessHeap, + 0, + pPropInfo); + + // FIXME: return the HWND + return NULL; +}