Commit 81be7f78 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Add screen depth option and remove "Allocated System Colors" setting.

parent a6d37f6d
...@@ -68,14 +68,11 @@ BEGIN ...@@ -68,14 +68,11 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,145,44,97,10 BS_AUTOCHECKBOX | WS_TABSTOP,145,44,97,10
*/ */
LTEXT "Screen color depth: ",IDC_STATIC,8,10,60,30
COMBOBOX IDC_SCREEN_DEPTH,70,8,180,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_DESKTOP_WIDTH,64,125,40,14,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_WIDTH,64,125,40,14,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
EDITTEXT IDC_DESKTOP_HEIGHT,117,125,40,14,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_HEIGHT,117,125,40,14,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
GROUPBOX " Render Settings ",IDC_STATIC,8,4,244,60
LTEXT "The driver color and render settings are used to optimise the way in which colors and applications are displayed.",
IDC_STATIC,15,17,228,22
LTEXT "Allocated system colors:",IDC_STATIC,15,43,76,8
EDITTEXT IDC_SYSCOLORS,90,41,40,14,ES_AUTOHSCROLL | ES_NUMBER
GROUPBOX " Window settings ",IDC_STATIC,8,65,244,170 GROUPBOX " Window settings ",IDC_STATIC,8,65,244,170
......
...@@ -103,3 +103,4 @@ ...@@ -103,3 +103,4 @@
#define IDC_ENABLE_DESKTOP 1074 #define IDC_ENABLE_DESKTOP 1074
#define IDS_DRIVE_NO_C 1075 #define IDS_DRIVE_NO_C 1075
#define IDC_ENABLE_MANAGED 1076 #define IDC_ENABLE_MANAGED 1076
#define IDC_SCREEN_DEPTH 1077
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
* - Make a list of prefs that have been dropped from the UI/should be eliminated * - Make a list of prefs that have been dropped from the UI/should be eliminated
* - Multimedia page * - Multimedia page
* - Settings migration code (from old configs) * - Settings migration code (from old configs)
* - Clean up resource.h, it's a bog
* *
* Minor things that should be done someday: * Minor things that should be done someday:
* - Make the desktop size UI a combo box, with a Custom option, so it's more obvious what you might want to choose here * - Make the desktop size UI a combo box, with a Custom option, so it's more obvious what you might want to choose here
......
...@@ -73,7 +73,7 @@ void updateGUIForDesktopMode(HWND hDlg) { ...@@ -73,7 +73,7 @@ void updateGUIForDesktopMode(HWND hDlg) {
void initX11DrvDlg (HWND hDlg) void initX11DrvDlg (HWND hDlg)
{ {
char *buf; char *buf;
char *i; char *bufindex;
updatingUI = TRUE; updatingUI = TRUE;
...@@ -81,20 +81,34 @@ void initX11DrvDlg (HWND hDlg) ...@@ -81,20 +81,34 @@ void initX11DrvDlg (HWND hDlg)
/* desktop size */ /* desktop size */
buf = getConfigValue("x11drv", "Desktop", "640x480"); buf = getConfigValue("x11drv", "Desktop", "640x480");
i = strchr(buf, 'x'); bufindex = strchr(buf, 'x');
*i = '\0'; *bufindex = '\0';
i++; bufindex++;
SetWindowText(GetDlgItem(hDlg, IDC_DESKTOP_WIDTH), buf); SetWindowText(GetDlgItem(hDlg, IDC_DESKTOP_WIDTH), buf);
SetWindowText(GetDlgItem(hDlg, IDC_DESKTOP_HEIGHT), i); SetWindowText(GetDlgItem(hDlg, IDC_DESKTOP_HEIGHT), bufindex);
free(buf);
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "8 bit");
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "16 bit");
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "24 bit");
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_ADDSTRING, 0, (LPARAM) "32 bit"); /* is this valid? */
buf = getConfigValue("x11drv", "ScreenDepth", "24");
if (strcmp(buf, "8") == 0)
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_SETCURSEL, 0, 0);
else if (strcmp(buf, "16") == 0)
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_SETCURSEL, 1, 0);
else if (strcmp(buf, "24") == 0)
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_SETCURSEL, 2, 0);
else if (strcmp(buf, "32") == 0)
SendDlgItemMessage(hDlg, IDC_SCREEN_DEPTH, CB_SETCURSEL, 3, 0);
else
WINE_ERR("Invalid screen depth read from registry (%s)\n", buf);
free(buf); free(buf);
SendDlgItemMessage(hDlg, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0); SendDlgItemMessage(hDlg, IDC_DESKTOP_WIDTH, EM_LIMITTEXT, RES_MAXLEN, 0);
SendDlgItemMessage(hDlg, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0); SendDlgItemMessage(hDlg, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0);
buf = getConfigValue("x11drv", "AllocSysColors", "100");
SetWindowText(GetDlgItem(hDlg, IDC_SYSCOLORS), buf);
free(buf);
buf = getConfigValue("x11drv", "Managed", "Y"); buf = getConfigValue("x11drv", "Managed", "Y");
if (IS_OPTION_TRUE(*buf)) if (IS_OPTION_TRUE(*buf))
CheckDlgButton(hDlg, IDC_ENABLE_MANAGED, BST_CHECKED); CheckDlgButton(hDlg, IDC_ENABLE_MANAGED, BST_CHECKED);
...@@ -141,14 +155,15 @@ void onEnableDesktopClicked(HWND hDlg) { ...@@ -141,14 +155,15 @@ void onEnableDesktopClicked(HWND hDlg) {
updateGUIForDesktopMode(hDlg); updateGUIForDesktopMode(hDlg);
} }
void onSysColorsChange(HWND hDlg) { void onScreenDepthChanged(HWND hDlg) {
char *newvalue = getDialogItemText(hDlg, IDC_SYSCOLORS); char *newvalue = getDialogItemText(hDlg, IDC_SCREEN_DEPTH);
char *spaceIndex = strchr(newvalue, ' ');
WINE_TRACE("\n"); WINE_TRACE("newvalue=%s\n", newvalue);
if (updatingUI) return; if (updatingUI) return;
if (!newvalue) return;
addTransaction("x11drv", "AllocSystemColors", ACTION_SET, newvalue); *spaceIndex = '\0';
addTransaction("x11drv", "ScreenDepth", ACTION_SET, newvalue);
free(newvalue); free(newvalue);
} }
...@@ -171,7 +186,6 @@ X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -171,7 +186,6 @@ X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case EN_CHANGE: { case EN_CHANGE: {
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0); SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
if ( (LOWORD(wParam) == IDC_DESKTOP_WIDTH) || (LOWORD(wParam) == IDC_DESKTOP_HEIGHT) ) setFromDesktopSizeEdits(hDlg); if ( (LOWORD(wParam) == IDC_DESKTOP_WIDTH) || (LOWORD(wParam) == IDC_DESKTOP_HEIGHT) ) setFromDesktopSizeEdits(hDlg);
if (LOWORD(wParam) == IDC_SYSCOLORS) onSysColorsChange(hDlg);
break; break;
} }
case BN_CLICKED: { case BN_CLICKED: {
...@@ -182,6 +196,10 @@ X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -182,6 +196,10 @@ X11DrvDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
}; };
break; break;
} }
case CBN_SELCHANGE: {
if (LOWORD(wParam) == IDC_SCREEN_DEPTH) onScreenDepthChanged(hDlg);
break;
}
default: default:
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment