- use tab control as parent for the child dialogs

- fixes display problems
- thanks to GedMurphy & Colin_Finck for finding the issue

svn path=/trunk/; revision=33196
This commit is contained in:
Johannes Anderwald 2008-04-30 10:55:35 +00:00
parent efc283ea0f
commit f938064c8d
4 changed files with 14 additions and 9 deletions

View file

@ -313,7 +313,7 @@ void InitializeDisplayAdapters(PDXDIAG_CONTEXT pContext)
break;
pContext->hDisplayWnd = hDlgs;
hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG), pContext->hMainDialog, DisplayPageWndProc, (LPARAM)pContext);
hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_DISPLAY_DIALOG), pContext->hTabCtrl, DisplayPageWndProc, (LPARAM)pContext);
if (!hwndDlg)
break;

View file

@ -98,15 +98,19 @@ TabCtrl_OnSelChange(PDXDIAG_CONTEXT pContext)
VOID
InitializeTabCtrl(HWND hwndDlg, PDXDIAG_CONTEXT pContext)
{
/* get tabctrl */
hTabCtrlWnd = GetDlgItem(hwndDlg, IDC_TAB_CONTROL);
pContext->hTabCtrl = hTabCtrlWnd;
/* create the dialogs */
pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hwndDlg, SystemPageWndProc, (LPARAM)pContext);
pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hwndDlg, MusicPageWndProc, (LPARAM)pContext);
pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hwndDlg, InputPageWndProc, (LPARAM)pContext);
pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hwndDlg, NetworkPageWndProc, (LPARAM)pContext);
pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hwndDlg, HelpPageWndProc, (LPARAM)pContext);
pContext->hDialogs[0] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SYSTEM_DIALOG), hTabCtrlWnd, SystemPageWndProc, (LPARAM)pContext);
pContext->hDialogs[1] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_MUSIC_DIALOG), hTabCtrlWnd, MusicPageWndProc, (LPARAM)pContext);
pContext->hDialogs[2] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_INPUT_DIALOG), hTabCtrlWnd, InputPageWndProc, (LPARAM)pContext);
pContext->hDialogs[3] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_NETWORK_DIALOG), hTabCtrlWnd, NetworkPageWndProc, (LPARAM)pContext);
pContext->hDialogs[4] = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_HELP_DIALOG), hTabCtrlWnd, HelpPageWndProc, (LPARAM)pContext);
/* insert tab ctrl items */
hTabCtrlWnd = GetDlgItem(hwndDlg, IDC_TAB_CONTROL);
InsertTabCtrlItem(hTabCtrlWnd, 0, MAKEINTRESOURCEW(IDS_SYSTEM_DIALOG));
InitializeDisplayAdapters(pContext);
InitializeDirectSoundPage(pContext);

View file

@ -20,6 +20,7 @@
typedef struct
{
HWND hMainDialog;
HWND hTabCtrl;
ULONG NumDisplayAdapter;
HWND * hDisplayWnd;
ULONG NumSoundAdapter;

View file

@ -29,7 +29,7 @@ BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR l
return FALSE;
pContext->hSoundWnd = hDlgs;
hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hMainDialog, SoundPageWndProc, (LPARAM)pContext);
hwndDlg = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_SOUND_DIALOG), pContext->hTabCtrl, SoundPageWndProc, (LPARAM)pContext);
if (!hwndDlg)
return FALSE;
@ -40,7 +40,7 @@ BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR l
swprintf (szText, L"%s %u", szSound, pContext->NumSoundAdapter + 1);
InsertTabCtrlItem(GetDlgItem(pContext->hMainDialog, IDC_TAB_CONTROL), pContext->NumDisplayAdapter + pContext->NumSoundAdapter + 1, szText);
InsertTabCtrlItem(pContext->hTabCtrl, pContext->NumDisplayAdapter + pContext->NumSoundAdapter + 1, szText);
hDlgs[pContext->NumSoundAdapter] = hwndDlg;
pContext->NumSoundAdapter++;