diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/thmutil.cpp')
| -rw-r--r-- | src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index 4482c96e..10e00c78 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp | |||
| @@ -3538,6 +3538,9 @@ static HRESULT ParseControl( | |||
| 3538 | } | 3538 | } |
| 3539 | else if (THEME_CONTROL_TYPE_HYPERLINK == pControl->type || THEME_CONTROL_TYPE_BUTTON == pControl->type) | 3539 | else if (THEME_CONTROL_TYPE_HYPERLINK == pControl->type || THEME_CONTROL_TYPE_BUTTON == pControl->type) |
| 3540 | { | 3540 | { |
| 3541 | hr = XmlGetAttributeEx(pixn, L"ElevationShieldCondition", &pControl->sczElevationShieldCondition); | ||
| 3542 | ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' ElevationShieldCondition attribute.", pControl->sczName); | ||
| 3543 | |||
| 3541 | hr = GetAttributeFontId(pTheme, pixn, L"HoverFontId", &pControl->dwFontHoverId); | 3544 | hr = GetAttributeFontId(pTheme, pixn, L"HoverFontId", &pControl->dwFontHoverId); |
| 3542 | ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HoverFontId attribute.", pControl->sczName); | 3545 | ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HoverFontId attribute.", pControl->sczName); |
| 3543 | 3546 | ||
| @@ -4826,6 +4829,7 @@ static void FreeControl( | |||
| 4826 | ReleaseStr(pControl->sczNote); | 4829 | ReleaseStr(pControl->sczNote); |
| 4827 | ReleaseStr(pControl->sczEnableCondition); | 4830 | ReleaseStr(pControl->sczEnableCondition); |
| 4828 | ReleaseStr(pControl->sczVisibleCondition); | 4831 | ReleaseStr(pControl->sczVisibleCondition); |
| 4832 | ReleaseStr(pControl->sczElevationShieldCondition); | ||
| 4829 | ReleaseStr(pControl->sczValue); | 4833 | ReleaseStr(pControl->sczValue); |
| 4830 | ReleaseStr(pControl->sczVariable); | 4834 | ReleaseStr(pControl->sczVariable); |
| 4831 | 4835 | ||
| @@ -5625,6 +5629,7 @@ static HRESULT ShowControl( | |||
| 5625 | 5629 | ||
| 5626 | BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED); | 5630 | BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED); |
| 5627 | BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN); | 5631 | BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN); |
| 5632 | BOOL fShield = FALSE; | ||
| 5628 | 5633 | ||
| 5629 | if (pTheme->pfnEvaluateCondition) | 5634 | if (pTheme->pfnEvaluateCondition) |
| 5630 | { | 5635 | { |
| @@ -5641,6 +5646,13 @@ static HRESULT ShowControl( | |||
| 5641 | hr = pTheme->pfnEvaluateCondition(pControl->sczEnableCondition, &fEnabled, pTheme->pvVariableContext); | 5646 | hr = pTheme->pfnEvaluateCondition(pControl->sczEnableCondition, &fEnabled, pTheme->pvVariableContext); |
| 5642 | ThmExitOnFailure(hr, "Failed to evaluate EnableCondition: %ls", pControl->sczEnableCondition); | 5647 | ThmExitOnFailure(hr, "Failed to evaluate EnableCondition: %ls", pControl->sczEnableCondition); |
| 5643 | } | 5648 | } |
| 5649 | |||
| 5650 | // If the control has an ElevationShieldCondition, check if it's true. | ||
| 5651 | if (pControl->sczElevationShieldCondition && pControl->fAutomaticElevationShield) | ||
| 5652 | { | ||
| 5653 | hr = pTheme->pfnEvaluateCondition(pControl->sczElevationShieldCondition, &fShield, pTheme->pvVariableContext); | ||
| 5654 | ThmExitOnFailure(hr, "Failed to evaluate ElevationShieldCondition: %ls", pControl->sczElevationShieldCondition); | ||
| 5655 | } | ||
| 5644 | } | 5656 | } |
| 5645 | 5657 | ||
| 5646 | // Try to format each control's text based on context, except for editboxes since their text comes from the user. | 5658 | // Try to format each control's text based on context, except for editboxes since their text comes from the user. |
| @@ -5816,6 +5828,8 @@ static HRESULT ShowControl( | |||
| 5816 | } | 5828 | } |
| 5817 | } | 5829 | } |
| 5818 | 5830 | ||
| 5831 | ThemeControlElevates(pControl, fShield); | ||
| 5832 | |||
| 5819 | if (!fVisible || (!fEnabled && (pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDE_WHEN_DISABLED))) | 5833 | if (!fVisible || (!fEnabled && (pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDE_WHEN_DISABLED))) |
| 5820 | { | 5834 | { |
| 5821 | ::ShowWindow(hWnd, SW_HIDE); | 5835 | ::ShowWindow(hWnd, SW_HIDE); |
| @@ -6283,6 +6297,7 @@ static HRESULT LoadControls( | |||
| 6283 | pControl->fAutomaticAction = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION & dwAutomaticBehaviorType); | 6297 | pControl->fAutomaticAction = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION & dwAutomaticBehaviorType); |
| 6284 | pControl->fAutomaticText = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT & dwAutomaticBehaviorType); | 6298 | pControl->fAutomaticText = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT & dwAutomaticBehaviorType); |
| 6285 | pControl->fAutomaticValue = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE & dwAutomaticBehaviorType); | 6299 | pControl->fAutomaticValue = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE & dwAutomaticBehaviorType); |
| 6300 | pControl->fAutomaticElevationShield = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ELEVATION_SHIELD != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ELEVATION_SHIELD & dwAutomaticBehaviorType); | ||
| 6286 | 6301 | ||
| 6287 | // This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range. | 6302 | // This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range. |
| 6288 | if (THEME_FIRST_AUTO_ASSIGN_CONTROL_ID <= wControlId && THEME_FIRST_ASSIGN_CONTROL_ID > wControlId) | 6303 | if (THEME_FIRST_AUTO_ASSIGN_CONTROL_ID <= wControlId && THEME_FIRST_ASSIGN_CONTROL_ID > wControlId) |
