Display a monitor behind the background picker on the display control panel.

Other languages needs their resources updating so it doesn't look messy. No time to do it, it's too late ;)

svn path=/trunk/; revision=21677
This commit is contained in:
Ged Murphy 2006-04-20 22:18:12 +00:00
parent 4155fe153a
commit fbf34c7981
5 changed files with 50 additions and 19 deletions

View file

@ -43,6 +43,9 @@ HWND g_hColorButton = NULL;
HIMAGELIST g_hShellImageList = NULL;
HBITMAP hBitmap = NULL;
int cxSource, cySource;
/* Add the images in the C:\ReactOS directory and the current wallpaper if any */
void AddListViewItems()
{
@ -226,6 +229,7 @@ void InitBackgroundDialog()
DWORD bufferSize = sizeof(szBuffer);
DWORD varType = REG_SZ;
LONG result;
BITMAP bitmap;
g_hBackgroundList = GetDlgItem(g_hBackgroundPage, IDC_BACKGROUND_LIST);
g_hBackgroundPreview = GetDlgItem(g_hBackgroundPage, IDC_BACKGROUND_PREVIEW);
@ -280,6 +284,15 @@ void InitBackgroundDialog()
}
RegCloseKey(regKey);
hBitmap = LoadImage(hApplet, MAKEINTRESOURCE(IDC_MONITOR), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT);
if (hBitmap != NULL)
{
GetObject(hBitmap, sizeof(BITMAP), &bitmap);
cxSource = bitmap.bmWidth;
cySource = bitmap.bmHeight;
}
}
void OnColorButton()
@ -569,6 +582,23 @@ INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg,
}
} break;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc, hdcMem;
hdc = BeginPaint(hwndDlg, &ps);
hdcMem = CreateCompatibleDC(hdc);
SelectObject(hdcMem, hBitmap);
BitBlt(hdc, 98, 0, cxSource, cySource, hdcMem, 0, 0, SRCCOPY);
DeleteDC(hdcMem);
EndPaint(hwndDlg, &ps);
} break;
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT drawItem;
@ -616,6 +646,8 @@ INT_PTR CALLBACK BackgroundPageProc(HWND hwndDlg,
if(g_pWallpaperBitmap != NULL)
DibFreeImage(g_pWallpaperBitmap);
DeleteObject(hBitmap);
} break;
}

View file

@ -11,6 +11,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include <reactos/version.rc>
IDC_DESK_ICON ICON "resources/applet.ico"
IDC_MONITOR BITMAP "resources/monitor.bmp"
#include "en.rc"
#include "cz.rc"

View file

@ -1,22 +1,18 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDD_BACKGROUND DIALOGEX DISCARDABLE 0, 0, 246, 188
IDD_BACKGROUND DIALOGEX DISCARDABLE 0, 0, 246, 205
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Background"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_BACKGROUND_PREVIEW,"Static",SS_OWNERDRAW,78,10,
90,65,WS_EX_STATICEDGE
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS |
WS_BORDER | WS_TABSTOP,7,99,173,71
LTEXT "Select an image to use as your desktop wallpaper:",
IDC_STATIC,8,87,180,8
PUSHBUTTON "&Browse...",IDC_BROWSE_BUTTON,187,135,50,14
PUSHBUTTON "&Color...",IDC_COLOR_BUTTON,187,155,50,14
LTEXT "Placement:",IDC_STATIC,187,98,36,8
COMBOBOX IDC_PLACEMENT_COMBO,187,108,50,90,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "", IDC_BACKGROUND_PREVIEW, "Static", SS_OWNERDRAW, 80, 10, 83, 57, WS_EX_STATICEDGE
CONTROL "",IDC_BACKGROUND_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER
| LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 8, 114, 174, 78
LTEXT "Select an image to use as your desktop wallpaper:", IDC_STATIC, 8, 103, 180, 9
PUSHBUTTON "&Browse...", IDC_BROWSE_BUTTON, 188, 114, 50, 15
PUSHBUTTON "&Color...", IDC_COLOR_BUTTON, 188, 177, 50, 15
LTEXT "Placement:", IDC_STATIC, 188, 138, 36, 9
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDD_SCREENSAVER DIALOGEX DISCARDABLE 0, 0, 246, 188

View file

@ -25,12 +25,14 @@
/* Background Page */
#define IDC_BACKGROUND_LIST 1000
#define IDC_BACKGROUND_PREVIEW 1001
#define IDC_BROWSE_BUTTON 1002
#define IDC_COLOR_BUTTON 1003
#define IDC_PLACEMENT_COMBO 1004
#define IDS_BACKGROUND_COMDLG_FILTER 1005
#define IDS_SUPPORTED_EXT 1006
#define IDC_MONITOR 1001
#define IDC_BACKGROUND_PREVIEW 1002
#define IDC_BROWSE_BUTTON 1003
#define IDC_COLOR_BUTTON 1004
#define IDC_PLACEMENT_COMBO 1005
#define IDS_BACKGROUND_COMDLG_FILTER 1006
#define IDS_SUPPORTED_EXT 1007
/* Screensaver Page */
#define IDC_SCREENS_CHOICES 1010

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB