@joebigelow / wix-1 / commits / f6c86c93

Restrict panels to static controls.

Fixes https://github.com/wixtoolset/issues/issues/6635.

Bob Arnson committed Aug 29, 2022 at 18:02 UTC f6c86c939af9f8b0036f4b197512f06e861e5fd3
3 files changed +99 -66
src/libs/dutil/WixToolset.DUtil/thmutil.cpp
+57 -52
@@ -45,6 +45,9 @@ const COLORREF THEME_INVISIBLE_COLORREF = 0xFFFFFFFF;
45 const DWORD GROW_FONT_INSTANCES = 3;
46 const DWORD GROW_IMAGE_INSTANCES = 5;
47
48 +const LPCWSTR ALL_CONTROL_NAMES = L"Billboard|Button|Checkbox|Combobox|CommandLink|Editbox|Hyperlink|Hypertext|ImageControl|Label|ListView|Panel|Progressbar|Richedit|Static|Tabs|TreeView";
49 +const LPCWSTR PANEL_CHILD_CONTROL_NAMES = L"Hyperlink|Hypertext|ImageControl|Label|Progressbar|Static";
50 +
51 static Gdiplus::GdiplusStartupInput vgsi;
52 static Gdiplus::GdiplusStartupOutput vgso = { };
53 static ULONG_PTR vgdiToken = 0;
@@ -205,8 +208,9 @@ static HRESULT ParseControls(
208 __in IXMLDOMNode* pElement,
209 __in THEME* pTheme,
210 __in_opt THEME_CONTROL* pParentControl,
208 - __in_opt THEME_PAGE* pPage
209 - );
211 + __in_opt THEME_PAGE* pPage,
212 + __in_opt LPCWSTR wzControlNames
213 +);
214 static HRESULT ParseControl(
215 __in_opt HMODULE hModule,
216 __in_opt LPCWSTR wzRelativePath,
@@ -2612,7 +2616,7 @@ static HRESULT ParseWindow(
2616 ThmExitOnFailure(hr, "Failed to parse theme pages.");
2617
2618 // Parse the non-paged controls.
2615 - hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, NULL);
2619 + hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, NULL, NULL);
2620 ThmExitOnFailure(hr, "Failed to parse theme controls.");
2621
2622 LExit:
@@ -2987,7 +2991,7 @@ static HRESULT ParsePages(
2991 hr = XmlGetAttributeEx(pixn, L"Name", &pPage->sczName);
2992 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying page Name.");
2993
2990 - hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, pPage);
2994 + hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, NULL, pPage, NULL);
2995 ThmExitOnFailure(hr, "Failed to parse page controls.");
2996
2997 ++iPage;
@@ -3171,7 +3175,8 @@ static HRESULT ParseControls(
3175 __in IXMLDOMNode* pElement,
3176 __in THEME* pTheme,
3177 __in_opt THEME_CONTROL* pParentControl,
3174 - __in_opt THEME_PAGE* pPage
3178 + __in_opt THEME_PAGE* pPage,
3179 + __in_opt LPCWSTR wzControlNames
3180 )
3181 {
3182 HRESULT hr = S_OK;
@@ -3188,7 +3193,7 @@ static HRESULT ParseControls(
3193 hr = ParseRadioButtons(hModule, wzRelativePath, pElement, pTheme, pParentControl, pPage);
3194 ThmExitOnFailure(hr, "Failed to parse radio buttons.");
3195
3191 - hr = XmlSelectNodes(pElement, L"Billboard|Button|Checkbox|Combobox|CommandLink|Editbox|Hyperlink|Hypertext|ImageControl|Label|ListView|Panel|Progressbar|Richedit|Static|Tabs|TreeView", &pixnl);
3196 + hr = XmlSelectNodes(pElement, wzControlNames ? wzControlNames : ALL_CONTROL_NAMES, &pixnl);
3197 ThmExitOnFailure(hr, "Failed to find control elements.");
3198
3199 hr = pixnl->get_length(reinterpret_cast<long*>(&cNewControls));
@@ -3353,28 +3358,28 @@ static HRESULT ParseControl(
3358 ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control Name attribute.");
3359
3360 hr = XmlGetAttributeEx(pixn, L"EnableCondition", &pControl->sczEnableCondition);
3356 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control EnableCondition attribute.");
3361 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' EnableCondition attribute.", pControl->sczName);
3362
3363 hr = XmlGetAttributeEx(pixn, L"VisibleCondition", &pControl->sczVisibleCondition);
3359 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control VisibleCondition attribute.");
3364 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' VisibleCondition attribute.", pControl->sczName);
3365
3366 hr = GetAttributeCoordinateOrDimension(pixn, L"X", &nValue);
3362 - ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control X attribute.");
3367 + ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' X attribute.", pControl->sczName);
3368
3369 pControl->nX = pControl->nDefaultDpiX = nValue;
3370
3371 hr = GetAttributeCoordinateOrDimension(pixn, L"Y", &nValue);
3367 - ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control Y attribute.");
3372 + ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' Y attribute.", pControl->sczName);
3373
3374 pControl->nY = pControl->nDefaultDpiY = nValue;
3375
3376 hr = GetAttributeCoordinateOrDimension(pixn, L"Height", &nValue);
3372 - ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control Height attribute.");
3377 + ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' Height attribute.", pControl->sczName);
3378
3379 pControl->nHeight = pControl->nDefaultDpiHeight = nValue;
3380
3381 hr = GetAttributeCoordinateOrDimension(pixn, L"Width", &nValue);
3377 - ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control Width attribute.");
3382 + ThmExitOnRequiredXmlQueryFailure(hr, "Failed to find control '%ls' Width attribute.", pControl->sczName);
3383
3384 pControl->nWidth = pControl->nDefaultDpiWidth = nValue;
3385
@@ -3382,19 +3387,19 @@ static HRESULT ParseControl(
3387 {
3388 case THEME_CONTROL_TYPE_COMMANDLINK:
3389 hr = ParseCommandLinkImage(hModule, wzRelativePath, pixn, pControl);
3385 - ThmExitOnFailure(hr, "Failed while parsing CommandLink image.");
3390 + ThmExitOnFailure(hr, "Failed while parsing CommandLink '%ls' image.", pControl->sczName);
3391 break;
3392 case THEME_CONTROL_TYPE_BUTTON:
3393 hr = ParseButtonImages(hModule, wzRelativePath, pTheme, pixn, pControl);
3389 - ThmExitOnFailure(hr, "Failed while parsing Button images.");
3394 + ThmExitOnFailure(hr, "Failed while parsing Button '%ls' images.", pControl->sczName);
3395 break;
3396 case THEME_CONTROL_TYPE_IMAGE:
3397 hr = ParseOwnerDrawImage(hModule, wzRelativePath, pTheme, pixn, wzElementName, pControl, &pControl->Image.imageRef);
3393 - ThmExitOnFailure(hr, "Failed while parsing ImageControl image.");
3398 + ThmExitOnFailure(hr, "Failed while parsing ImageControl '%ls' image.", pControl->sczName);
3399 break;
3400 case THEME_CONTROL_TYPE_PROGRESSBAR:
3401 hr = ParseProgressBarImages(hModule, wzRelativePath, pTheme, pixn, pControl);
3397 - ThmExitOnFailure(hr, "Failed while parsing Progressbar images.");
3402 + ThmExitOnFailure(hr, "Failed while parsing Progressbar '%ls' images.", pControl->sczName);
3403 break;
3404 default:
3405 ThmExitOnUnexpectedAttribute(hr, pixn, wzElementName, L"ImageId");
@@ -3407,15 +3412,15 @@ static HRESULT ParseControl(
3412
3413
3414 hr = GetAttributeFontId(pTheme, pixn, L"FontId", &pControl->dwFontId);
3410 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control FontId attribute.");
3415 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' FontId attribute.", pControl->sczName);
3416
3417 // Parse the optional window style.
3418 hr = XmlGetAttributeNumberBase(pixn, L"HexStyle", 16, &pControl->dwStyle);
3414 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control HexStyle attribute.");
3419 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HexStyle attribute.", pControl->sczName);
3420
3421 // Parse the tabstop bit "shortcut nomenclature", this could have been set with the style above.
3422 hr = XmlGetYesNoAttribute(pixn, L"TabStop", &fValue);
3418 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control TabStop attribute.");
3423 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' TabStop attribute.", pControl->sczName);
3424
3425 if (fXmlFound && fValue)
3426 {
@@ -3423,7 +3428,7 @@ static HRESULT ParseControl(
3428 }
3429
3430 hr = XmlGetYesNoAttribute(pixn, L"Visible", &fValue);
3426 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control Visible attribute.");
3431 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' Visible attribute.", pControl->sczName);
3432
3433 if (fXmlFound && fValue)
3434 {
@@ -3431,7 +3436,7 @@ static HRESULT ParseControl(
3436 }
3437
3438 hr = XmlGetYesNoAttribute(pixn, L"HideWhenDisabled", &fValue);
3434 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control HideWhenDisabled attribute.");
3439 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HideWhenDisabled attribute.", pControl->sczName);
3440
3441 if (fXmlFound && fValue)
3442 {
@@ -3439,24 +3444,24 @@ static HRESULT ParseControl(
3444 }
3445
3446 hr = ParseActions(pixn, pControl);
3442 - ThmExitOnFailure(hr, "Failed to parse action nodes of the control.");
3447 + ThmExitOnFailure(hr, "Failed to parse action nodes of the control '%ls'.", pControl->sczName);
3448
3449 hr = ParseText(pixn, pControl, &fAnyTextChildren);
3445 - ThmExitOnFailure(hr, "Failed to parse text nodes of the control.");
3450 + ThmExitOnFailure(hr, "Failed to parse text nodes of the control '%ls'.", pControl->sczName);
3451
3452 hr = ParseTooltips(pixn, pControl, &fAnyTextChildren);
3448 - ThmExitOnFailure(hr, "Failed to parse control Tooltip.");
3453 + ThmExitOnFailure(hr, "Failed to parse control '%ls' Tooltip.", pControl->sczName);
3454
3455 if (THEME_CONTROL_TYPE_COMMANDLINK == pControl->type)
3456 {
3457 hr = ParseNotes(pixn, pControl, &fAnyNoteChildren);
3453 - ThmExitOnFailure(hr, "Failed to parse note text nodes of the control.");
3458 + ThmExitOnFailure(hr, "Failed to parse note text nodes of the control '%ls'.", pControl->sczName);
3459 }
3460
3461 if (!fAnyTextChildren && !fAnyNoteChildren)
3462 {
3463 hr = XmlGetAttributeUInt32(pixn, L"StringId", &dwValue);
3459 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control StringId attribute.");
3464 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' StringId attribute.", pControl->sczName);
3465
3466 if (fXmlFound)
3467 {
@@ -3468,7 +3473,7 @@ static HRESULT ParseControl(
3473 if (THEME_CONTROL_TYPE_BILLBOARD != pControl->type && THEME_CONTROL_TYPE_PANEL != pControl->type)
3474 {
3475 hr = XmlGetText(pixn, &bstrText);
3471 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get control inner text.");
3476 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get control '%ls' inner text.", pControl->sczName);
3477
3478 if (fXmlFound)
3479 {
@@ -3484,10 +3489,10 @@ static HRESULT ParseControl(
3489 if (THEME_CONTROL_TYPE_BILLBOARD == pControl->type)
3490 {
3491 hr = XmlGetYesNoAttribute(pixn, L"Loop", &pControl->fBillboardLoops);
3487 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Billboard/@Loop attribute.");
3492 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Billboard/@Loop attribute.", pControl->sczName);
3493
3494 hr = XmlGetAttributeUInt16(pixn, L"Interval", &pControl->wBillboardInterval);
3490 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Billboard/@Interval attribute.");
3495 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Billboard/@Interval attribute.", pControl->sczName);
3496
3497 if (!pControl->wBillboardInterval)
3498 {
@@ -3495,12 +3500,12 @@ static HRESULT ParseControl(
3500 }
3501
3502 hr = ParseBillboardPanels(hModule, wzRelativePath, pixn, pTheme, pControl, pPage);
3498 - ThmExitOnFailure(hr, "Failed to parse billboard children.");
3503 + ThmExitOnFailure(hr, "Failed to parse billboard '%ls' children.", pControl->sczName);
3504 }
3505 else if (THEME_CONTROL_TYPE_EDITBOX == pControl->type)
3506 {
3507 hr = XmlGetYesNoAttribute(pixn, L"FileSystemAutoComplete", &fValue);
3503 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Editbox/@FileSystemAutoComplete attribute.");
3508 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Editbox/@FileSystemAutoComplete attribute.", pControl->sczName);
3509
3510 if (fXmlFound && fValue)
3511 {
@@ -3510,15 +3515,15 @@ static HRESULT ParseControl(
3515 else if (THEME_CONTROL_TYPE_HYPERLINK == pControl->type || THEME_CONTROL_TYPE_BUTTON == pControl->type)
3516 {
3517 hr = GetAttributeFontId(pTheme, pixn, L"HoverFontId", &pControl->dwFontHoverId);
3513 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control HoverFontId attribute.");
3518 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HoverFontId attribute.", pControl->sczName);
3519
3520 hr = GetAttributeFontId(pTheme, pixn, L"SelectedFontId", &pControl->dwFontSelectedId);
3516 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control SelectedFontId attribute.");
3521 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' SelectedFontId attribute.", pControl->sczName);
3522 }
3523 else if (THEME_CONTROL_TYPE_LABEL == pControl->type)
3524 {
3525 hr = XmlGetYesNoAttribute(pixn, L"Center", &fValue);
3521 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Label/@Center attribute.");
3526 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Label/@Center attribute.", pControl->sczName);
3527
3528 if (fXmlFound && fValue)
3529 {
@@ -3526,7 +3531,7 @@ static HRESULT ParseControl(
3531 }
3532
3533 hr = XmlGetYesNoAttribute(pixn, L"DisablePrefix", &fValue);
3529 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying Label/@DisablePrefix attribute.");
3534 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' Label/@DisablePrefix attribute.", pControl->sczName);
3535
3536 if (fXmlFound && fValue)
3537 {
@@ -3537,10 +3542,10 @@ static HRESULT ParseControl(
3542 {
3543 // Parse the optional extended window style.
3544 hr = XmlGetAttributeNumberBase(pixn, L"HexExtendedStyle", 16, &pControl->dwExtendedStyle);
3540 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@HexExtendedStyle attribute.");
3545 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@HexExtendedStyle attribute.", pControl->sczName);
3546
3547 hr = XmlGetAttribute(pixn, L"ImageList", &bstrText);
3543 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageList attribute.");
3548 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageList attribute.", pControl->sczName);
3549
3550 if (fXmlFound)
3551 {
@@ -3549,7 +3554,7 @@ static HRESULT ParseControl(
3554 }
3555
3556 hr = XmlGetAttribute(pixn, L"ImageListSmall", &bstrText);
3552 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageListSmall attribute.");
3557 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageListSmall attribute.", pControl->sczName);
3558
3559 if (fXmlFound)
3560 {
@@ -3558,7 +3563,7 @@ static HRESULT ParseControl(
3563 }
3564
3565 hr = XmlGetAttribute(pixn, L"ImageListState", &bstrText);
3561 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageListState attribute.");
3566 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageListState attribute.", pControl->sczName);
3567
3568 if (fXmlFound)
3569 {
@@ -3567,7 +3572,7 @@ static HRESULT ParseControl(
3572 }
3573
3574 hr = XmlGetAttribute(pixn, L"ImageListGroupHeader", &bstrText);
3570 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying ListView/@ImageListGroupHeader attribute.");
3575 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' ListView/@ImageListGroupHeader attribute.", pControl->sczName);
3576
3577 if (fXmlFound)
3578 {
@@ -3580,13 +3585,13 @@ static HRESULT ParseControl(
3585 }
3586 else if (THEME_CONTROL_TYPE_PANEL == pControl->type)
3587 {
3583 - hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, pControl, pPage);
3588 + hr = ParseControls(hModule, wzRelativePath, pixn, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES);
3589 ThmExitOnFailure(hr, "Failed to parse panel children.");
3590 }
3591 else if (THEME_CONTROL_TYPE_RADIOBUTTON == pControl->type)
3592 {
3593 hr = XmlGetAttributeEx(pixn, L"Value", &pControl->sczValue);
3589 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying RadioButton/@Value attribute.");
3594 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' RadioButton/@Value attribute.", pControl->sczName);
3595 }
3596 else if (THEME_CONTROL_TYPE_TAB == pControl->type)
3597 {
@@ -3598,7 +3603,7 @@ static HRESULT ParseControl(
3603 pControl->dwStyle |= TVS_DISABLEDRAGDROP;
3604
3605 hr = XmlGetYesNoAttribute(pixn, L"EnableDragDrop", &fValue);
3601 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@EnableDragDrop attribute.");
3606 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@EnableDragDrop attribute.", pControl->sczName);
3607
3608 if (fXmlFound && fValue)
3609 {
@@ -3606,7 +3611,7 @@ static HRESULT ParseControl(
3611 }
3612
3613 hr = XmlGetYesNoAttribute(pixn, L"FullRowSelect", &fValue);
3609 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@FullRowSelect attribute.");
3614 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@FullRowSelect attribute.", pControl->sczName);
3615
3616 if (fXmlFound && fValue)
3617 {
@@ -3614,7 +3619,7 @@ static HRESULT ParseControl(
3619 }
3620
3621 hr = XmlGetYesNoAttribute(pixn, L"HasButtons", &fValue);
3617 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@HasButtons attribute.");
3622 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@HasButtons attribute.", pControl->sczName);
3623
3624 if (fXmlFound && fValue)
3625 {
@@ -3622,7 +3627,7 @@ static HRESULT ParseControl(
3627 }
3628
3629 hr = XmlGetYesNoAttribute(pixn, L"AlwaysShowSelect", &fValue);
3625 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@AlwaysShowSelect attribute.");
3630 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@AlwaysShowSelect attribute.", pControl->sczName);
3631
3632 if (fXmlFound && fValue)
3633 {
@@ -3630,7 +3635,7 @@ static HRESULT ParseControl(
3635 }
3636
3637 hr = XmlGetYesNoAttribute(pixn, L"LinesAtRoot", &fValue);
3633 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@LinesAtRoot attribute.");
3638 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@LinesAtRoot attribute.", pControl->sczName);
3639
3640 if (fXmlFound && fValue)
3641 {
@@ -3638,7 +3643,7 @@ static HRESULT ParseControl(
3643 }
3644
3645 hr = XmlGetYesNoAttribute(pixn, L"HasLines", &fValue);
3641 - ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying TreeView/@HasLines attribute.");
3646 + ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying '%ls' TreeView/@HasLines attribute.", pControl->sczName);
3647
3648 if (fXmlFound && fValue)
3649 {
@@ -3775,15 +3780,15 @@ static HRESULT ParseBillboardPanels(
3780 DWORD dwValue = 0;
3781 THEME_CONTROL* pControl = NULL;
3782
3778 - hr = XmlSelectNodes(pElement, L"BillboardPanel", &pixnl);
3779 - ThmExitOnFailure(hr, "Failed to select child billboard panel nodes.");
3783 + hr = XmlSelectNodes(pElement, L"Panel", &pixnl);
3784 + ThmExitOnFailure(hr, "Failed to select billboard child nodes.");
3785
3786 hr = pixnl->get_length(reinterpret_cast<long*>(&dwValue));
3787 ThmExitOnFailure(hr, "Failed to count the number of billboard panel nodes.");
3788
3789 if (!dwValue)
3790 {
3786 - ThmExitWithRootFailure(hr, E_INVALIDDATA, "Billboard must have at least one BillboardPanel.");
3791 + ThmExitWithRootFailure(hr, E_INVALIDDATA, "Billboard must have at least one Panel.");
3792 }
3793
3794 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(&pParentControl->rgControls), pParentControl->cControls, dwValue, sizeof(THEME_CONTROL), 0);
@@ -3801,7 +3806,7 @@ static HRESULT ParseBillboardPanels(
3806 pControl->wPageId = pPage->wId;
3807 }
3808
3804 - hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage);
3809 + hr = ParseControls(hModule, wzRelativePath, pixnChild, pTheme, pControl, pPage, PANEL_CHILD_CONTROL_NAMES);
3810 ThmExitOnFailure(hr, "Failed to parse control.");
3811
3812 ReleaseNullObject(pixnChild);
src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingTheme.xml
+21 -7
@@ -132,16 +132,30 @@ There are currently four states for a button: default, focus, hover, and selecte
132 </Page>
133 <Page Name="Billboard">
134 <Label X="6" Y="6" Width="-6" Height="43" FontId="Default">
135 - This page has a billboard. It loops between two panels every 1.5 seconds. Only one button should be visible at all times (this is currently broken).
135 + This page has a billboard. It loops between two panels every 1.5 seconds.
136 </Label>
137 <Billboard Name="FirstBillboard" X="11" Y="59" Width="-11" Height="-39" Interval="1500" Loop="yes">
138 - <BillboardPanel>
139 - <Button Name="FirstBillboardButton1" X="11" Y="11" Width="75" Height="23" TabStop="yes" FontId="Default">First Panel</Button>
140 - </BillboardPanel>
141 - <BillboardPanel>
142 - <Button Name="FirstBillboardButton2" X="11" Y="39" Width="75" Height="23" TabStop="yes" FontId="Default">Second Panel</Button>
143 - </BillboardPanel>
138 + <Panel>
139 + <ImageControl ImageId="square_default" X="0" Y="0" Width="128" Height="128" />
140 + <ImageControl ImageId="square_focus" X="128" Y="0" Width="128" Height="128" />
141 + <ImageControl ImageId="square_hover" X="256" Y="0" Width="128" Height="128" />
142 + <ImageControl ImageId="square_selected" X="384" Y="0" Width="128" Height="128" />
143 + </Panel>
144 + <Panel>
145 + <ImageControl ImageId="square_selected" X="0" Y="0" Width="128" Height="128" />
146 + <ImageControl ImageId="square_hover" X="128" Y="0" Width="128" Height="128" />
147 + <ImageControl ImageId="square_focus" X="256" Y="0" Width="128" Height="128" />
148 + <ImageControl ImageId="square_default" X="384" Y="0" Width="128" Height="128" />
149 + </Panel>
150 </Billboard>
151 + <Panel X="0" Y="-64" Width="-1" Height="64">
152 + <ImageControl X="0" Y="0" Width="64" Height="64" ImageId="star_transparent.bmp" />
153 + <ImageControl X="64" Y="0" Width="64" Height="64" ImageId="star_opaque.bmp" />
154 + <ImageControl X="128" Y="0" Width="64" Height="64" ImageId="star_transparent.png" />
155 + <ImageControl X="-1" Y="0" Width="64" Height="64" ImageId="star_transparent.bmp" />
156 + <ImageControl X="-65" Y="0" Width="64" Height="64" ImageId="star_opaque.bmp" />
157 + <ImageControl X="-129" Y="0" Width="64" Height="64" ImageId="star_transparent.png" />
158 + </Panel>
159 <Button Name="BillboardBackButton" X="-269" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default">
160 <Text>Back</Text>
161 <ChangePageAction Page="Progressbar" />
src/test/burn/TestData/Manual/BafThmutilTesting/theme/BafThmUtilTestingThemeLoose.xml
+21 -7
@@ -132,16 +132,30 @@ There are currently four states for a button: default, focus, hover, and selecte
132 </Page>
133 <Page Name="Billboard">
134 <Label X="6" Y="6" Width="-6" Height="43" FontId="Default">
135 - This page has a billboard. It loops between two panels every 1.5 seconds. Only one button should be visible at all times (this is currently broken).
135 + This page has a billboard. It loops between two panels every 1.5 seconds.
136 </Label>
137 <Billboard Name="FirstBillboard" X="11" Y="59" Width="-11" Height="-39" Interval="1500" Loop="yes">
138 - <BillboardPanel>
139 - <Button Name="FirstBillboardButton1" X="11" Y="11" Width="75" Height="23" TabStop="yes" FontId="Default">First Panel</Button>
140 - </BillboardPanel>
141 - <BillboardPanel>
142 - <Button Name="FirstBillboardButton2" X="11" Y="39" Width="75" Height="23" TabStop="yes" FontId="Default">Second Panel</Button>
143 - </BillboardPanel>
138 + <Panel>
139 + <ImageControl ImageId="square_default" X="0" Y="0" Width="128" Height="128" />
140 + <ImageControl ImageId="square_focus" X="128" Y="0" Width="128" Height="128" />
141 + <ImageControl ImageId="square_hover" X="256" Y="0" Width="128" Height="128" />
142 + <ImageControl ImageId="square_selected" X="384" Y="0" Width="128" Height="128" />
143 + </Panel>
144 + <Panel>
145 + <ImageControl ImageId="square_selected" X="0" Y="0" Width="128" Height="128" />
146 + <ImageControl ImageId="square_hover" X="128" Y="0" Width="128" Height="128" />
147 + <ImageControl ImageId="square_focus" X="256" Y="0" Width="128" Height="128" />
148 + <ImageControl ImageId="square_default" X="384" Y="0" Width="128" Height="128" />
149 + </Panel>
150 </Billboard>
151 + <Panel X="0" Y="-64" Width="-1" Height="64">
152 + <ImageControl X="0" Y="0" Width="64" Height="64" ImageId="star_transparent.bmp" />
153 + <ImageControl X="64" Y="0" Width="64" Height="64" ImageId="star_opaque.bmp" />
154 + <ImageControl X="128" Y="0" Width="64" Height="64" ImageId="star_transparent.png" />
155 + <ImageControl X="-1" Y="0" Width="64" Height="64" ImageId="star_transparent.bmp" />
156 + <ImageControl X="-65" Y="0" Width="64" Height="64" ImageId="star_opaque.bmp" />
157 + <ImageControl X="-129" Y="0" Width="64" Height="64" ImageId="star_transparent.png" />
158 + </Panel>
159 <Button Name="BillboardBackButton" X="-269" Y="-11" Width="75" Height="23" TabStop="yes" FontId="Default">
160 <Text>Back</Text>
161 <ChangePageAction Page="Progressbar" />