Commit fb469829 authored by Felix Nawothnig's avatar Felix Nawothnig Committed by Alexandre Julliard

Changed layout of libraries tab, moved load-order setting into extra

dialog.
parent bd8790be
......@@ -81,17 +81,29 @@ FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX " DLL Overrides ",IDC_STATIC,8,4,244,240
LTEXT "Dynamic Link Libraries can be specified individually to be either builtin (provided by Wine) or native (taken from Windows or provided by the application)."
, IDC_STATIC,15,17,228,32
LISTBOX IDC_DLLS_LIST,15,50,142,187,WS_BORDER | WS_TABSTOP | WS_VSCROLL
LTEXT "Load order:",IDC_STATIC,163,50,37,8
CONTROL "&Builtin (Wine)",IDC_RAD_BUILTIN,"Button", BS_AUTORADIOBUTTON | WS_GROUP,163,65,75,10
CONTROL "&Native (Windows)",IDC_RAD_NATIVE,"Button", BS_AUTORADIOBUTTON,163,80,75,10
CONTROL "Bui&ltin then Native",IDC_RAD_BUILTIN_NATIVE,"Button", BS_AUTORADIOBUTTON,163,95,75,10
CONTROL "Nati&ve then Builtin",IDC_RAD_NATIVE_BUILTIN,"Button", BS_AUTORADIOBUTTON,163,110,75,10
CONTROL "&Disable",IDC_RAD_DISABLE,"Button", BS_AUTORADIOBUTTON,163,125,75,10
PUSHBUTTON "&Add DLL override for:",IDC_DLLS_ADDDLL, 163,184,82,14
COMBOBOX IDC_DLLCOMBO,163,204,82,14,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP | CBS_SORT | CBS_LOWERCASE
PUSHBUTTON "&Remove DLL override",IDC_DLLS_REMOVEDLL,163,224,82,14
,IDC_STATIC,16,16,220,32
LTEXT "New override for library:",IDC_STATIC,16,58,100,8
COMBOBOX IDC_DLLCOMBO,16,68,140,14,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP | CBS_SORT | CBS_LOWERCASE
PUSHBUTTON "&Add",IDC_DLLS_ADDDLL, 164,68,82,13,BS_DEFPUSHBUTTON
LTEXT "Existing overrides:",IDC_STATIC,16,86,100,8
LISTBOX IDC_DLLS_LIST,16,96,140,140,WS_BORDER | WS_TABSTOP | WS_VSCROLL
PUSHBUTTON "&Edit",IDC_DLLS_EDITDLL,164,96,82,14
PUSHBUTTON "&Remove",IDC_DLLS_REMOVEDLL,164,114,82,14
END
IDD_LOADORDER DIALOG DISCARDABLE 80, 90, 110, 92
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "Edit Override"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX " Load Order ",IDC_STATIC,8,4,94,66
CONTROL "&Builtin (Wine)",IDC_RAD_BUILTIN,"Button", BS_AUTORADIOBUTTON | WS_GROUP,16,14,75,10
CONTROL "&Native (Windows)",IDC_RAD_NATIVE,"Button", BS_AUTORADIOBUTTON,16,24,75,10
CONTROL "Bui&ltin then Native",IDC_RAD_BUILTIN_NATIVE,"Button", BS_AUTORADIOBUTTON,16,34,75,10
CONTROL "Nati&ve then Builtin",IDC_RAD_NATIVE_BUILTIN,"Button", BS_AUTORADIOBUTTON,16,44,75,10
CONTROL "&Disable",IDC_RAD_DISABLE,"Button", BS_AUTORADIOBUTTON,16,54,75,10
DEFPUSHBUTTON "OK",IDOK,8,74,45,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,57,74,45,14,WS_GROUP
END
IDD_DRIVECFG DIALOG DISCARDABLE 0, 0, 260, 250
......
......@@ -127,33 +127,9 @@ static DWORD mode_to_id(enum dllmode mode)
static void set_controls_from_selection(HWND dialog)
{
int index = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
struct dll *dll;
DWORD id;
int i;
if (index == -1) /* no selection */
{
for (i = IDC_RAD_BUILTIN; i <= IDC_RAD_DISABLE; i++)
disable(i);
CheckRadioButton(dialog, IDC_RAD_BUILTIN, IDC_RAD_DISABLE, -1);
return;
}
/* enable the controls */
for (i = IDC_RAD_BUILTIN; i <= IDC_RAD_DISABLE; i++)
enable(i);
dll = (struct dll *) SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETITEMDATA, index, 0);
id = mode_to_id(dll->mode);
CheckRadioButton(dialog, IDC_RAD_BUILTIN, IDC_RAD_DISABLE, id);
/* FIXME: display/update some information about the selected dll (purpose, recommended loadorder) maybe? */
}
static void clear_settings(HWND dialog)
{
int count = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0);
......@@ -187,11 +163,13 @@ static void load_library_settings(HWND dialog)
if (!overrides || *overrides == NULL)
{
set_controls_from_selection(dialog);
disable(IDC_DLLS_EDITDLL);
disable(IDC_DLLS_REMOVEDLL);
HeapFree(GetProcessHeap(), 0, overrides);
return;
}
enable(IDC_DLLS_EDITDLL);
enable(IDC_DLLS_REMOVEDLL);
for (p = overrides; *p != NULL; p++)
......@@ -242,7 +220,6 @@ static void init_libsheet(HWND dialog)
disable(IDC_DLLS_ADDDLL);
}
static void on_add_combo_change(HWND dialog)
{
char buffer[1024];
......@@ -301,6 +278,58 @@ static void on_add_click(HWND dialog)
set_controls_from_selection(dialog);
}
static INT_PTR CALLBACK loadorder_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static WORD sel;
switch(uMsg)
{
case WM_INITDIALOG:
CheckRadioButton(hwndDlg, IDC_RAD_BUILTIN, IDC_RAD_DISABLE, lParam);
sel = lParam;
return TRUE;
case WM_COMMAND:
if(HIWORD(wParam) != BN_CLICKED) break;
switch (LOWORD(wParam))
{
case IDC_RAD_BUILTIN:
case IDC_RAD_NATIVE:
case IDC_RAD_BUILTIN_NATIVE:
case IDC_RAD_NATIVE_BUILTIN:
case IDC_RAD_DISABLE:
sel = LOWORD(wParam);
return TRUE;
case IDOK:
EndDialog(hwndDlg, sel);
return TRUE;
case IDCANCEL:
EndDialog(hwndDlg, wParam);
return TRUE;
}
}
return FALSE;
}
static void on_edit_click(HWND hwnd)
{
INT_PTR ret;
int index = SendDlgItemMessage(hwnd, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
struct dll *dll;
DWORD id;
/* if no override is selected the edit button should be disabled... */
assert(index != -1);
dll = (struct dll *) SendDlgItemMessage(hwnd, IDC_DLLS_LIST, LB_GETITEMDATA, index, 0);
id = mode_to_id(dll->mode);
ret = DialogBoxParam(0, MAKEINTRESOURCE(IDD_LOADORDER), hwnd, loadorder_dlgproc, id);
if(ret != IDCANCEL)
set_dllmode(hwnd, ret);
}
static void on_remove_click(HWND dialog)
{
int sel = SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0);
......@@ -321,7 +350,10 @@ static void on_remove_click(HWND dialog)
if (SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_GETCOUNT, 0, 0) > 0)
SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SETCURSEL, max(sel - 1, 0), 0);
else
{
disable(IDC_DLLS_EDITDLL);
disable(IDC_DLLS_REMOVEDLL);
}
set_controls_from_selection(dialog);
}
......@@ -357,20 +389,15 @@ LibrariesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
on_add_combo_change(hDlg);
break;
}
case BN_CLICKED:
switch(LOWORD(wParam)) {
case IDC_RAD_BUILTIN:
case IDC_RAD_NATIVE:
case IDC_RAD_BUILTIN_NATIVE:
case IDC_RAD_NATIVE_BUILTIN:
case IDC_RAD_DISABLE:
set_dllmode(hDlg, LOWORD(wParam));
break;
case IDC_DLLS_ADDDLL:
on_add_click(hDlg);
break;
case IDC_DLLS_EDITDLL:
on_edit_click(hDlg);
break;
case IDC_DLLS_REMOVEDLL:
on_remove_click(hDlg);
break;
......
......@@ -63,8 +63,10 @@
#define IDC_RAD_DISABLE 1033
#define IDC_DLLS_LIST 1034
#define IDC_DLLS_ADDDLL 8001
#define IDC_DLLS_EDITDLL 8002
#define IDC_DLLS_REMOVEDLL 8003
#define IDC_DLLCOMBO 8004
#define IDD_LOADORDER 8005
/* drive editing */
#define IDC_LIST_DRIVES 1042
......
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