diff options
-rw-r--r-- | src/api/burn/balutil/inc/BAFunctions.h | 2 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctions.h | 2 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | 2 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/IBAFunctions.h | 2 | ||||
-rw-r--r-- | src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | 53 | ||||
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/thmutil.h | 25 | ||||
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 167 | ||||
-rw-r--r-- | src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | 2 |
8 files changed, 141 insertions, 114 deletions
diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h index 8ecc04ff..4a0b8599 100644 --- a/src/api/burn/balutil/inc/BAFunctions.h +++ b/src/api/burn/balutil/inc/BAFunctions.h | |||
@@ -164,7 +164,7 @@ struct BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS | |||
164 | DWORD cbSize; | 164 | DWORD cbSize; |
165 | BOOL fProcessed; | 165 | BOOL fProcessed; |
166 | WORD wId; | 166 | WORD wId; |
167 | BOOL fDisableAutomaticFunctionality; | 167 | DWORD dwAutomaticBehaviorType; |
168 | }; | 168 | }; |
169 | 169 | ||
170 | struct BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS | 170 | struct BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index 49e97815..3f99673d 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h | |||
@@ -947,7 +947,7 @@ public: // IBAFunctions | |||
947 | __in LPCWSTR /*wzName*/, | 947 | __in LPCWSTR /*wzName*/, |
948 | __inout BOOL* /*pfProcessed*/, | 948 | __inout BOOL* /*pfProcessed*/, |
949 | __inout WORD* /*pwId*/, | 949 | __inout WORD* /*pwId*/, |
950 | __inout BOOL* /*pfDisableAutomaticFunctionality*/ | 950 | __inout DWORD* /*pdwAutomaticBehaviorType*/ |
951 | ) | 951 | ) |
952 | { | 952 | { |
953 | return S_OK; | 953 | return S_OK; |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h index e10decfc..728bd2b5 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | |||
@@ -30,7 +30,7 @@ static HRESULT BalBaseBAFunctionsProcOnThemeControlLoading( | |||
30 | __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults | 30 | __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults |
31 | ) | 31 | ) |
32 | { | 32 | { |
33 | return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId, &pResults->fDisableAutomaticFunctionality); | 33 | return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId, &pResults->dwAutomaticBehaviorType); |
34 | } | 34 | } |
35 | 35 | ||
36 | static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand( | 36 | static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand( |
diff --git a/src/api/burn/balutil/inc/IBAFunctions.h b/src/api/burn/balutil/inc/IBAFunctions.h index ea6c116b..bb911040 100644 --- a/src/api/burn/balutil/inc/IBAFunctions.h +++ b/src/api/burn/balutil/inc/IBAFunctions.h | |||
@@ -36,7 +36,7 @@ DECLARE_INTERFACE_IID_(IBAFunctions, IBootstrapperApplication, "0FB445ED-17BD-49 | |||
36 | __in LPCWSTR wzName, | 36 | __in LPCWSTR wzName, |
37 | __inout BOOL* pfProcessed, | 37 | __inout BOOL* pfProcessed, |
38 | __inout WORD* pwId, | 38 | __inout WORD* pwId, |
39 | __inout BOOL* pfDisableAutomaticFunctionality | 39 | __inout DWORD* pdwAutomaticBehaviorType |
40 | ) = 0; | 40 | ) = 0; |
41 | 41 | ||
42 | // OnThemeControlWmCommand - Called when WM_COMMAND is received for a control. | 42 | // OnThemeControlWmCommand - Called when WM_COMMAND is received for a control. |
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index 8544ff0e..0f1a9f49 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -3409,7 +3409,7 @@ private: | |||
3409 | 3409 | ||
3410 | fProcessed = TRUE; | 3410 | fProcessed = TRUE; |
3411 | pResults->wId = pAssignControl->wId; | 3411 | pResults->wId = pAssignControl->wId; |
3412 | pResults->fDisableAutomaticFunctionality = pAssignControl->fDisableAutomaticFunctionality; | 3412 | pResults->dwAutomaticBehaviorType = pAssignControl->dwAutomaticBehaviorType; |
3413 | ExitFunction(); | 3413 | ExitFunction(); |
3414 | } | 3414 | } |
3415 | } | 3415 | } |
@@ -3421,7 +3421,7 @@ private: | |||
3421 | 3421 | ||
3422 | themeControlLoadingResults.cbSize = sizeof(themeControlLoadingResults); | 3422 | themeControlLoadingResults.cbSize = sizeof(themeControlLoadingResults); |
3423 | themeControlLoadingResults.wId = pResults->wId; | 3423 | themeControlLoadingResults.wId = pResults->wId; |
3424 | themeControlLoadingResults.fDisableAutomaticFunctionality = pResults->fDisableAutomaticFunctionality; | 3424 | themeControlLoadingResults.dwAutomaticBehaviorType = pResults->dwAutomaticBehaviorType; |
3425 | 3425 | ||
3426 | hr = m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING, &themeControlLoadingArgs, &themeControlLoadingResults, m_pvBAFunctionsProcContext); | 3426 | hr = m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING, &themeControlLoadingArgs, &themeControlLoadingResults, m_pvBAFunctionsProcContext); |
3427 | 3427 | ||
@@ -3437,7 +3437,7 @@ private: | |||
3437 | { | 3437 | { |
3438 | fProcessed = TRUE; | 3438 | fProcessed = TRUE; |
3439 | pResults->wId = themeControlLoadingResults.wId; | 3439 | pResults->wId = themeControlLoadingResults.wId; |
3440 | pResults->fDisableAutomaticFunctionality = themeControlLoadingResults.fDisableAutomaticFunctionality; | 3440 | pResults->dwAutomaticBehaviorType = themeControlLoadingResults.dwAutomaticBehaviorType; |
3441 | } | 3441 | } |
3442 | } | 3442 | } |
3443 | } | 3443 | } |
@@ -4594,6 +4594,7 @@ public: | |||
4594 | ) : CBalBaseBootstrapperApplication(pEngine, 3, 3000) | 4594 | ) : CBalBaseBootstrapperApplication(pEngine, 3, 3000) |
4595 | { | 4595 | { |
4596 | THEME_ASSIGN_CONTROL_ID* pAssignControl = NULL; | 4596 | THEME_ASSIGN_CONTROL_ID* pAssignControl = NULL; |
4597 | DWORD dwAutomaticBehaviorType = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ENABLED | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VISIBLE | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE; | ||
4597 | 4598 | ||
4598 | m_hModule = hModule; | 4599 | m_hModule = hModule; |
4599 | m_command = { }; | 4600 | m_command = { }; |
@@ -4674,161 +4675,161 @@ public: | |||
4674 | pAssignControl->wId = WIXSTDBA_CONTROL_INSTALL_BUTTON; | 4675 | pAssignControl->wId = WIXSTDBA_CONTROL_INSTALL_BUTTON; |
4675 | pAssignControl->wzName = L"InstallButton"; | 4676 | pAssignControl->wzName = L"InstallButton"; |
4676 | pAssignControl->ppControl = &m_pControlInstallButton; | 4677 | pAssignControl->ppControl = &m_pControlInstallButton; |
4677 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4678 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4678 | m_pControlInstallButton = NULL; | 4679 | m_pControlInstallButton = NULL; |
4679 | ++pAssignControl; | 4680 | ++pAssignControl; |
4680 | 4681 | ||
4681 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_RICHEDIT; | 4682 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_RICHEDIT; |
4682 | pAssignControl->wzName = L"EulaRichedit"; | 4683 | pAssignControl->wzName = L"EulaRichedit"; |
4683 | pAssignControl->ppControl = &m_pControlEulaRichedit; | 4684 | pAssignControl->ppControl = &m_pControlEulaRichedit; |
4684 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4685 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4685 | m_pControlEulaRichedit = NULL; | 4686 | m_pControlEulaRichedit = NULL; |
4686 | ++pAssignControl; | 4687 | ++pAssignControl; |
4687 | 4688 | ||
4688 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_LINK; | 4689 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_LINK; |
4689 | pAssignControl->wzName = L"EulaHyperlink"; | 4690 | pAssignControl->wzName = L"EulaHyperlink"; |
4690 | pAssignControl->ppControl = &m_pControlEulaHyperlink; | 4691 | pAssignControl->ppControl = &m_pControlEulaHyperlink; |
4691 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4692 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4692 | m_pControlEulaHyperlink = NULL; | 4693 | m_pControlEulaHyperlink = NULL; |
4693 | ++pAssignControl; | 4694 | ++pAssignControl; |
4694 | 4695 | ||
4695 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX; | 4696 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX; |
4696 | pAssignControl->wzName = L"EulaAcceptCheckbox"; | 4697 | pAssignControl->wzName = L"EulaAcceptCheckbox"; |
4697 | pAssignControl->ppControl = &m_pControlEulaAcceptCheckbox; | 4698 | pAssignControl->ppControl = &m_pControlEulaAcceptCheckbox; |
4698 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4699 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4699 | m_pControlEulaAcceptCheckbox = NULL; | 4700 | m_pControlEulaAcceptCheckbox = NULL; |
4700 | ++pAssignControl; | 4701 | ++pAssignControl; |
4701 | 4702 | ||
4702 | pAssignControl->wId = WIXSTDBA_CONTROL_REPAIR_BUTTON; | 4703 | pAssignControl->wId = WIXSTDBA_CONTROL_REPAIR_BUTTON; |
4703 | pAssignControl->wzName = L"RepairButton"; | 4704 | pAssignControl->wzName = L"RepairButton"; |
4704 | pAssignControl->ppControl = &m_pControlRepairButton; | 4705 | pAssignControl->ppControl = &m_pControlRepairButton; |
4705 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4706 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4706 | m_pControlRepairButton = NULL; | 4707 | m_pControlRepairButton = NULL; |
4707 | ++pAssignControl; | 4708 | ++pAssignControl; |
4708 | 4709 | ||
4709 | pAssignControl->wId = WIXSTDBA_CONTROL_UNINSTALL_BUTTON; | 4710 | pAssignControl->wId = WIXSTDBA_CONTROL_UNINSTALL_BUTTON; |
4710 | pAssignControl->wzName = L"UninstallButton"; | 4711 | pAssignControl->wzName = L"UninstallButton"; |
4711 | pAssignControl->ppControl = &m_pControlUninstallButton; | 4712 | pAssignControl->ppControl = &m_pControlUninstallButton; |
4712 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4713 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4713 | m_pControlUninstallButton = NULL; | 4714 | m_pControlUninstallButton = NULL; |
4714 | ++pAssignControl; | 4715 | ++pAssignControl; |
4715 | 4716 | ||
4716 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT; | 4717 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT; |
4717 | pAssignControl->wzName = L"CacheProgressPackageText"; | 4718 | pAssignControl->wzName = L"CacheProgressPackageText"; |
4718 | pAssignControl->ppControl = &m_pControlCacheProgressPackageText; | 4719 | pAssignControl->ppControl = &m_pControlCacheProgressPackageText; |
4719 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4720 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4720 | m_pControlCacheProgressPackageText = NULL; | 4721 | m_pControlCacheProgressPackageText = NULL; |
4721 | ++pAssignControl; | 4722 | ++pAssignControl; |
4722 | 4723 | ||
4723 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR; | 4724 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR; |
4724 | pAssignControl->wzName = L"CacheProgressbar"; | 4725 | pAssignControl->wzName = L"CacheProgressbar"; |
4725 | pAssignControl->ppControl = &m_pControlCacheProgressbar; | 4726 | pAssignControl->ppControl = &m_pControlCacheProgressbar; |
4726 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4727 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4727 | m_pControlCacheProgressbar = NULL; | 4728 | m_pControlCacheProgressbar = NULL; |
4728 | ++pAssignControl; | 4729 | ++pAssignControl; |
4729 | 4730 | ||
4730 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT; | 4731 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT; |
4731 | pAssignControl->wzName = L"CacheProgressText"; | 4732 | pAssignControl->wzName = L"CacheProgressText"; |
4732 | pAssignControl->ppControl = &m_pControlCacheProgressText; | 4733 | pAssignControl->ppControl = &m_pControlCacheProgressText; |
4733 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4734 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4734 | m_pControlCacheProgressText = NULL; | 4735 | m_pControlCacheProgressText = NULL; |
4735 | ++pAssignControl; | 4736 | ++pAssignControl; |
4736 | 4737 | ||
4737 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT; | 4738 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT; |
4738 | pAssignControl->wzName = L"ExecuteProgressPackageText"; | 4739 | pAssignControl->wzName = L"ExecuteProgressPackageText"; |
4739 | pAssignControl->ppControl = &m_pControlExecuteProgressPackageText; | 4740 | pAssignControl->ppControl = &m_pControlExecuteProgressPackageText; |
4740 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4741 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4741 | m_pControlExecuteProgressPackageText = NULL; | 4742 | m_pControlExecuteProgressPackageText = NULL; |
4742 | ++pAssignControl; | 4743 | ++pAssignControl; |
4743 | 4744 | ||
4744 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR; | 4745 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR; |
4745 | pAssignControl->wzName = L"ExecuteProgressbar"; | 4746 | pAssignControl->wzName = L"ExecuteProgressbar"; |
4746 | pAssignControl->ppControl = &m_pControlExecuteProgressbar; | 4747 | pAssignControl->ppControl = &m_pControlExecuteProgressbar; |
4747 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4748 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4748 | m_pControlExecuteProgressbar = NULL; | 4749 | m_pControlExecuteProgressbar = NULL; |
4749 | ++pAssignControl; | 4750 | ++pAssignControl; |
4750 | 4751 | ||
4751 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT; | 4752 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT; |
4752 | pAssignControl->wzName = L"ExecuteProgressText"; | 4753 | pAssignControl->wzName = L"ExecuteProgressText"; |
4753 | pAssignControl->ppControl = &m_pControlExecuteProgressText; | 4754 | pAssignControl->ppControl = &m_pControlExecuteProgressText; |
4754 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4755 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4755 | m_pControlExecuteProgressText = NULL; | 4756 | m_pControlExecuteProgressText = NULL; |
4756 | ++pAssignControl; | 4757 | ++pAssignControl; |
4757 | 4758 | ||
4758 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT; | 4759 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT; |
4759 | pAssignControl->wzName = L"ExecuteProgressActionDataText"; | 4760 | pAssignControl->wzName = L"ExecuteProgressActionDataText"; |
4760 | pAssignControl->ppControl = &m_pControlExecuteProgressActionDataText; | 4761 | pAssignControl->ppControl = &m_pControlExecuteProgressActionDataText; |
4761 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4762 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4762 | m_pControlExecuteProgressActionDataText = NULL; | 4763 | m_pControlExecuteProgressActionDataText = NULL; |
4763 | ++pAssignControl; | 4764 | ++pAssignControl; |
4764 | 4765 | ||
4765 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT; | 4766 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT; |
4766 | pAssignControl->wzName = L"OverallProgressPackageText"; | 4767 | pAssignControl->wzName = L"OverallProgressPackageText"; |
4767 | pAssignControl->ppControl = &m_pControlOverallProgressPackageText; | 4768 | pAssignControl->ppControl = &m_pControlOverallProgressPackageText; |
4768 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4769 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4769 | m_pControlOverallProgressPackageText = NULL; | 4770 | m_pControlOverallProgressPackageText = NULL; |
4770 | ++pAssignControl; | 4771 | ++pAssignControl; |
4771 | 4772 | ||
4772 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR; | 4773 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR; |
4773 | pAssignControl->wzName = L"OverallProgressbar"; | 4774 | pAssignControl->wzName = L"OverallProgressbar"; |
4774 | pAssignControl->ppControl = &m_pControlOverallProgressbar; | 4775 | pAssignControl->ppControl = &m_pControlOverallProgressbar; |
4775 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4776 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4776 | m_pControlOverallProgressbar = NULL; | 4777 | m_pControlOverallProgressbar = NULL; |
4777 | ++pAssignControl; | 4778 | ++pAssignControl; |
4778 | 4779 | ||
4779 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR; | 4780 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR; |
4780 | pAssignControl->wzName = L"OverallCalculatedProgressbar"; | 4781 | pAssignControl->wzName = L"OverallCalculatedProgressbar"; |
4781 | pAssignControl->ppControl = &m_pControlOverallCalculatedProgressbar; | 4782 | pAssignControl->ppControl = &m_pControlOverallCalculatedProgressbar; |
4782 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4783 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4783 | m_pControlOverallCalculatedProgressbar = NULL; | 4784 | m_pControlOverallCalculatedProgressbar = NULL; |
4784 | ++pAssignControl; | 4785 | ++pAssignControl; |
4785 | 4786 | ||
4786 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT; | 4787 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT; |
4787 | pAssignControl->wzName = L"OverallProgressText"; | 4788 | pAssignControl->wzName = L"OverallProgressText"; |
4788 | pAssignControl->ppControl = &m_pControlOverallProgressText; | 4789 | pAssignControl->ppControl = &m_pControlOverallProgressText; |
4789 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4790 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4790 | m_pControlOverallProgressText = NULL; | 4791 | m_pControlOverallProgressText = NULL; |
4791 | ++pAssignControl; | 4792 | ++pAssignControl; |
4792 | 4793 | ||
4793 | pAssignControl->wId = WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON; | 4794 | pAssignControl->wId = WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON; |
4794 | pAssignControl->wzName = L"ProgressCancelButton"; | 4795 | pAssignControl->wzName = L"ProgressCancelButton"; |
4795 | pAssignControl->ppControl = &m_pControlProgressCancelButton; | 4796 | pAssignControl->ppControl = &m_pControlProgressCancelButton; |
4796 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4797 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4797 | m_pControlProgressCancelButton = NULL; | 4798 | m_pControlProgressCancelButton = NULL; |
4798 | ++pAssignControl; | 4799 | ++pAssignControl; |
4799 | 4800 | ||
4800 | pAssignControl->wId = WIXSTDBA_CONTROL_LAUNCH_BUTTON; | 4801 | pAssignControl->wId = WIXSTDBA_CONTROL_LAUNCH_BUTTON; |
4801 | pAssignControl->wzName = L"LaunchButton"; | 4802 | pAssignControl->wzName = L"LaunchButton"; |
4802 | pAssignControl->ppControl = &m_pControlLaunchButton; | 4803 | pAssignControl->ppControl = &m_pControlLaunchButton; |
4803 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4804 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4804 | m_pControlLaunchButton = NULL; | 4805 | m_pControlLaunchButton = NULL; |
4805 | ++pAssignControl; | 4806 | ++pAssignControl; |
4806 | 4807 | ||
4807 | pAssignControl->wId = WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON; | 4808 | pAssignControl->wId = WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON; |
4808 | pAssignControl->wzName = L"SuccessRestartButton"; | 4809 | pAssignControl->wzName = L"SuccessRestartButton"; |
4809 | pAssignControl->ppControl = &m_pControlSuccessRestartButton; | 4810 | pAssignControl->ppControl = &m_pControlSuccessRestartButton; |
4810 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4811 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4811 | m_pControlSuccessRestartButton = NULL; | 4812 | m_pControlSuccessRestartButton = NULL; |
4812 | ++pAssignControl; | 4813 | ++pAssignControl; |
4813 | 4814 | ||
4814 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK; | 4815 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK; |
4815 | pAssignControl->wzName = L"FailureLogFileLink"; | 4816 | pAssignControl->wzName = L"FailureLogFileLink"; |
4816 | pAssignControl->ppControl = &m_pControlFailureLogFileLink; | 4817 | pAssignControl->ppControl = &m_pControlFailureLogFileLink; |
4817 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4818 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4818 | m_pControlFailureLogFileLink = NULL; | 4819 | m_pControlFailureLogFileLink = NULL; |
4819 | ++pAssignControl; | 4820 | ++pAssignControl; |
4820 | 4821 | ||
4821 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT; | 4822 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT; |
4822 | pAssignControl->wzName = L"FailureMessageText"; | 4823 | pAssignControl->wzName = L"FailureMessageText"; |
4823 | pAssignControl->ppControl = &m_pControlFailureMessageText; | 4824 | pAssignControl->ppControl = &m_pControlFailureMessageText; |
4824 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4825 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4825 | m_pControlFailureMessageText = NULL; | 4826 | m_pControlFailureMessageText = NULL; |
4826 | ++pAssignControl; | 4827 | ++pAssignControl; |
4827 | 4828 | ||
4828 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON; | 4829 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON; |
4829 | pAssignControl->wzName = L"FailureRestartButton"; | 4830 | pAssignControl->wzName = L"FailureRestartButton"; |
4830 | pAssignControl->ppControl = &m_pControlFailureRestartButton; | 4831 | pAssignControl->ppControl = &m_pControlFailureRestartButton; |
4831 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | 4832 | pAssignControl->dwAutomaticBehaviorType = dwAutomaticBehaviorType; |
4832 | m_pControlFailureRestartButton = NULL; | 4833 | m_pControlFailureRestartButton = NULL; |
4833 | 4834 | ||
4834 | C_ASSERT(LAST_WIXSTDBA_CONTROL == WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON + 1); | 4835 | C_ASSERT(LAST_WIXSTDBA_CONTROL == WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON + 1); |
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h index 8cf7dc92..45e4fc51 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h | |||
@@ -57,6 +57,20 @@ typedef enum THEME_CONTROL_DATA | |||
57 | THEME_CONTROL_DATA_HOVER = 1, | 57 | THEME_CONTROL_DATA_HOVER = 1, |
58 | } THEME_CONTROL_DATA; | 58 | } THEME_CONTROL_DATA; |
59 | 59 | ||
60 | typedef enum THEME_CONTROL_AUTOMATIC_BEHAVIOR_TYPE | ||
61 | { | ||
62 | THEME_CONTROL_AUTOMATIC_BEHAVIOR_ALL = 0x0, | ||
63 | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ENABLED = 0x1, | ||
64 | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VISIBLE = 0x2, | ||
65 | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION = 0x4, | ||
66 | // For form controls like editboxes and checkboxes, | ||
67 | // the value will not be automatically persisted to a variable and | ||
68 | // the control's value will only be changed by the user. | ||
69 | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE = 0x8, | ||
70 | // This has no effect on editboxes since their text is their value. | ||
71 | THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT = 0x10, | ||
72 | } THEME_CONTROL_AUTOMATIC_BEHAVIOR_TYPE; | ||
73 | |||
60 | typedef enum THEME_CONTROL_TYPE | 74 | typedef enum THEME_CONTROL_TYPE |
61 | { | 75 | { |
62 | THEME_CONTROL_TYPE_UNKNOWN, | 76 | THEME_CONTROL_TYPE_UNKNOWN, |
@@ -196,7 +210,7 @@ struct THEME_ASSIGN_CONTROL_ID | |||
196 | WORD wId; // id to apply to control | 210 | WORD wId; // id to apply to control |
197 | LPCWSTR wzName; // name of control to match | 211 | LPCWSTR wzName; // name of control to match |
198 | const THEME_CONTROL** ppControl; | 212 | const THEME_CONTROL** ppControl; |
199 | BOOL fDisableAutomaticFunctionality; // prevent declarative functionality from interfering with the application's imperative code | 213 | DWORD dwAutomaticBehaviorType; // prevent declarative functionality from interfering with the application's imperative code |
200 | }; | 214 | }; |
201 | 215 | ||
202 | const WORD THEME_FIRST_ASSIGN_CONTROL_ID = 0x4000; // Recommended first control id to be assigned. | 216 | const WORD THEME_FIRST_ASSIGN_CONTROL_ID = 0x4000; // Recommended first control id to be assigned. |
@@ -224,7 +238,12 @@ typedef struct _THEME_CONTROL | |||
224 | 238 | ||
225 | LPWSTR sczEnableCondition; | 239 | LPWSTR sczEnableCondition; |
226 | LPWSTR sczVisibleCondition; | 240 | LPWSTR sczVisibleCondition; |
227 | BOOL fDisableAutomaticFunctionality; | 241 | |
242 | BOOL fAutomaticEnabled; | ||
243 | BOOL fAutomaticVisible; | ||
244 | BOOL fAutomaticAction; | ||
245 | BOOL fAutomaticValue; | ||
246 | BOOL fAutomaticText; | ||
228 | 247 | ||
229 | union | 248 | union |
230 | { | 249 | { |
@@ -472,7 +491,7 @@ typedef struct _THEME_LOADINGCONTROL_RESULTS | |||
472 | // Due to this value being packed into 16 bits for many system window messages, this is restricted to a WORD. | 491 | // Due to this value being packed into 16 bits for many system window messages, this is restricted to a WORD. |
473 | WORD wId; | 492 | WORD wId; |
474 | // Used to prevent declarative functionality from interfering with the application's imperative code. | 493 | // Used to prevent declarative functionality from interfering with the application's imperative code. |
475 | BOOL fDisableAutomaticFunctionality; | 494 | DWORD dwAutomaticBehaviorType; |
476 | } THEME_LOADINGCONTROL_RESULTS; | 495 | } THEME_LOADINGCONTROL_RESULTS; |
477 | 496 | ||
478 | 497 | ||
diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index f7f7c5b6..c3dbe3e9 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp | |||
@@ -296,7 +296,7 @@ static HRESULT OnLoadingControl( | |||
296 | __in THEME* pTheme, | 296 | __in THEME* pTheme, |
297 | __in const THEME_CONTROL* pControl, | 297 | __in const THEME_CONTROL* pControl, |
298 | __inout WORD* pwId, | 298 | __inout WORD* pwId, |
299 | __inout BOOL* pfDisableAutomaticFunctionality | 299 | __inout DWORD* pdwAutomaticBehaviorType |
300 | ); | 300 | ); |
301 | static HRESULT LoadControls( | 301 | static HRESULT LoadControls( |
302 | __in THEME* pTheme, | 302 | __in THEME* pTheme, |
@@ -5016,7 +5016,7 @@ static void OnBrowseDirectory( | |||
5016 | } | 5016 | } |
5017 | 5017 | ||
5018 | // Since editbox changes aren't immediately saved off, we have to treat them differently. | 5018 | // Since editbox changes aren't immediately saved off, we have to treat them differently. |
5019 | if (pTargetControl && !pTargetControl->fDisableAutomaticFunctionality && (!fSetVariable || THEME_CONTROL_TYPE_EDITBOX == pTargetControl->type)) | 5019 | if (pTargetControl && pTargetControl->fAutomaticValue && THEME_CONTROL_TYPE_EDITBOX == pTargetControl->type) |
5020 | { | 5020 | { |
5021 | fSetVariable = FALSE; | 5021 | fSetVariable = FALSE; |
5022 | hr = ThemeSetTextControl(pTargetControl, sczPath); | 5022 | hr = ThemeSetTextControl(pTargetControl, sczPath); |
@@ -5045,7 +5045,7 @@ static BOOL OnButtonClicked( | |||
5045 | 5045 | ||
5046 | if (THEME_CONTROL_TYPE_BUTTON == pControl->type || THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) | 5046 | if (THEME_CONTROL_TYPE_BUTTON == pControl->type || THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) |
5047 | { | 5047 | { |
5048 | if (!pControl->fDisableAutomaticFunctionality && pControl->cActions) | 5048 | if (pControl->fAutomaticAction && pControl->cActions) |
5049 | { | 5049 | { |
5050 | fHandled = TRUE; | 5050 | fHandled = TRUE; |
5051 | THEME_ACTION* pChosenAction = pControl->pDefaultAction; | 5051 | THEME_ACTION* pChosenAction = pControl->pDefaultAction; |
@@ -5103,7 +5103,7 @@ static BOOL OnButtonClicked( | |||
5103 | } | 5103 | } |
5104 | } | 5104 | } |
5105 | } | 5105 | } |
5106 | else if (!pControl->fDisableAutomaticFunctionality && (pTheme->pfnSetNumericVariable || pTheme->pfnSetStringVariable)) | 5106 | else if (pControl->fAutomaticValue && (pTheme->pfnSetNumericVariable || pTheme->pfnSetStringVariable)) |
5107 | { | 5107 | { |
5108 | BOOL fRefresh = FALSE; | 5108 | BOOL fRefresh = FALSE; |
5109 | 5109 | ||
@@ -5558,7 +5558,7 @@ static HRESULT ShowControl( | |||
5558 | THEME_PAGE* pPage = ThemeGetPage(pTheme, dwPageId); | 5558 | THEME_PAGE* pPage = ThemeGetPage(pTheme, dwPageId); |
5559 | 5559 | ||
5560 | // Save the editbox value if necessary (other control types save their values immediately). | 5560 | // Save the editbox value if necessary (other control types save their values immediately). |
5561 | if (pTheme->pfnSetStringVariable && !pControl->fDisableAutomaticFunctionality && | 5561 | if (pTheme->pfnSetStringVariable && pControl->fAutomaticValue && |
5562 | fSaveEditboxes && THEME_CONTROL_TYPE_EDITBOX == pControl->type && pControl->sczName && *pControl->sczName) | 5562 | fSaveEditboxes && THEME_CONTROL_TYPE_EDITBOX == pControl->type && pControl->sczName && *pControl->sczName) |
5563 | { | 5563 | { |
5564 | hr = ThemeGetTextControl(pControl, &sczText); | 5564 | hr = ThemeGetTextControl(pControl, &sczText); |
@@ -5585,102 +5585,102 @@ static HRESULT ShowControl( | |||
5585 | BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED); | 5585 | BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED); |
5586 | BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN); | 5586 | BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN); |
5587 | 5587 | ||
5588 | if (!pControl->fDisableAutomaticFunctionality) | 5588 | if (pTheme->pfnEvaluateCondition) |
5589 | { | 5589 | { |
5590 | if (pTheme->pfnEvaluateCondition) | 5590 | // If the control has a VisibleCondition, check if it's true. |
5591 | if (pControl->sczVisibleCondition && pControl->fAutomaticVisible) | ||
5591 | { | 5592 | { |
5592 | // If the control has a VisibleCondition, check if it's true. | 5593 | hr = pTheme->pfnEvaluateCondition(pControl->sczVisibleCondition, &fVisible, pTheme->pvVariableContext); |
5593 | if (pControl->sczVisibleCondition) | 5594 | ThmExitOnFailure(hr, "Failed to evaluate VisibleCondition: %ls", pControl->sczVisibleCondition); |
5594 | { | ||
5595 | hr = pTheme->pfnEvaluateCondition(pControl->sczVisibleCondition, &fVisible, pTheme->pvVariableContext); | ||
5596 | ThmExitOnFailure(hr, "Failed to evaluate VisibleCondition: %ls", pControl->sczVisibleCondition); | ||
5597 | } | ||
5598 | |||
5599 | // If the control has an EnableCondition, check if it's true. | ||
5600 | if (pControl->sczEnableCondition) | ||
5601 | { | ||
5602 | hr = pTheme->pfnEvaluateCondition(pControl->sczEnableCondition, &fEnabled, pTheme->pvVariableContext); | ||
5603 | ThmExitOnFailure(hr, "Failed to evaluate EnableCondition: %ls", pControl->sczEnableCondition); | ||
5604 | } | ||
5605 | } | 5595 | } |
5606 | 5596 | ||
5607 | // Try to format each control's text based on context, except for editboxes since their text comes from the user. | 5597 | // If the control has an EnableCondition, check if it's true. |
5608 | if (pTheme->pfnFormatString && ((pControl->sczText && *pControl->sczText) || pControl->cConditionalText) && THEME_CONTROL_TYPE_EDITBOX != pControl->type) | 5598 | if (pControl->sczEnableCondition && pControl->fAutomaticEnabled) |
5609 | { | 5599 | { |
5610 | LPCWSTR wzText = pControl->sczText; | 5600 | hr = pTheme->pfnEvaluateCondition(pControl->sczEnableCondition, &fEnabled, pTheme->pvVariableContext); |
5611 | LPCWSTR wzNote = pControl->sczNote; | 5601 | ThmExitOnFailure(hr, "Failed to evaluate EnableCondition: %ls", pControl->sczEnableCondition); |
5602 | } | ||
5603 | } | ||
5612 | 5604 | ||
5613 | if (pTheme->pfnEvaluateCondition) | 5605 | // Try to format each control's text based on context, except for editboxes since their text comes from the user. |
5606 | if (pTheme->pfnFormatString && pControl->fAutomaticText && ((pControl->sczText && *pControl->sczText) || pControl->cConditionalText) && THEME_CONTROL_TYPE_EDITBOX != pControl->type) | ||
5607 | { | ||
5608 | LPCWSTR wzText = pControl->sczText; | ||
5609 | LPCWSTR wzNote = pControl->sczNote; | ||
5610 | |||
5611 | if (pTheme->pfnEvaluateCondition) | ||
5612 | { | ||
5613 | // As documented in the xsd, if there are multiple conditions that are true at the same time then the behavior is undefined. | ||
5614 | // This is the current implementation and can change at any time. | ||
5615 | for (DWORD j = 0; j < pControl->cConditionalText; ++j) | ||
5614 | { | 5616 | { |
5615 | // As documented in the xsd, if there are multiple conditions that are true at the same time then the behavior is undefined. | 5617 | THEME_CONDITIONAL_TEXT* pConditionalText = pControl->rgConditionalText + j; |
5616 | // This is the current implementation and can change at any time. | ||
5617 | for (DWORD j = 0; j < pControl->cConditionalText; ++j) | ||
5618 | { | ||
5619 | THEME_CONDITIONAL_TEXT* pConditionalText = pControl->rgConditionalText + j; | ||
5620 | 5618 | ||
5621 | if (pConditionalText->sczCondition) | 5619 | if (pConditionalText->sczCondition) |
5622 | { | 5620 | { |
5623 | BOOL fCondition = FALSE; | 5621 | BOOL fCondition = FALSE; |
5624 | 5622 | ||
5625 | hr = pTheme->pfnEvaluateCondition(pConditionalText->sczCondition, &fCondition, pTheme->pvVariableContext); | 5623 | hr = pTheme->pfnEvaluateCondition(pConditionalText->sczCondition, &fCondition, pTheme->pvVariableContext); |
5626 | ThmExitOnFailure(hr, "Failed to evaluate condition: %ls", pConditionalText->sczCondition); | 5624 | ThmExitOnFailure(hr, "Failed to evaluate condition: %ls", pConditionalText->sczCondition); |
5627 | 5625 | ||
5628 | if (fCondition) | 5626 | if (fCondition) |
5629 | { | 5627 | { |
5630 | wzText = pConditionalText->sczText; | 5628 | wzText = pConditionalText->sczText; |
5631 | break; | 5629 | break; |
5632 | } | ||
5633 | } | 5630 | } |
5634 | } | 5631 | } |
5632 | } | ||
5635 | 5633 | ||
5636 | if (THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) | 5634 | if (THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) |
5635 | { | ||
5636 | for (DWORD j = 0; j < pControl->CommandLink.cConditionalNotes; ++j) | ||
5637 | { | 5637 | { |
5638 | for (DWORD j = 0; j < pControl->CommandLink.cConditionalNotes; ++j) | 5638 | THEME_CONDITIONAL_TEXT* pConditionalNote = pControl->CommandLink.rgConditionalNotes + j; |
5639 | { | ||
5640 | THEME_CONDITIONAL_TEXT* pConditionalNote = pControl->CommandLink.rgConditionalNotes + j; | ||
5641 | 5639 | ||
5642 | if (pConditionalNote->sczCondition) | 5640 | if (pConditionalNote->sczCondition) |
5643 | { | 5641 | { |
5644 | BOOL fCondition = FALSE; | 5642 | BOOL fCondition = FALSE; |
5645 | 5643 | ||
5646 | hr = pTheme->pfnEvaluateCondition(pConditionalNote->sczCondition, &fCondition, pTheme->pvVariableContext); | 5644 | hr = pTheme->pfnEvaluateCondition(pConditionalNote->sczCondition, &fCondition, pTheme->pvVariableContext); |
5647 | ThmExitOnFailure(hr, "Failed to evaluate note condition: %ls", pConditionalNote->sczCondition); | 5645 | ThmExitOnFailure(hr, "Failed to evaluate note condition: %ls", pConditionalNote->sczCondition); |
5648 | 5646 | ||
5649 | if (fCondition) | 5647 | if (fCondition) |
5650 | { | 5648 | { |
5651 | wzNote = pConditionalNote->sczText; | 5649 | wzNote = pConditionalNote->sczText; |
5652 | break; | 5650 | break; |
5653 | } | ||
5654 | } | 5651 | } |
5655 | } | 5652 | } |
5656 | } | 5653 | } |
5657 | } | 5654 | } |
5655 | } | ||
5658 | 5656 | ||
5659 | if (wzText && *wzText) | 5657 | if (wzText && *wzText) |
5660 | { | 5658 | { |
5661 | hr = pTheme->pfnFormatString(wzText, &sczText, pTheme->pvVariableContext); | 5659 | hr = pTheme->pfnFormatString(wzText, &sczText, pTheme->pvVariableContext); |
5662 | ThmExitOnFailure(hr, "Failed to format string: %ls", wzText); | 5660 | ThmExitOnFailure(hr, "Failed to format string: %ls", wzText); |
5663 | } | 5661 | } |
5664 | else | 5662 | else |
5665 | { | 5663 | { |
5666 | ReleaseNullStr(sczText); | 5664 | ReleaseNullStr(sczText); |
5667 | } | 5665 | } |
5668 | |||
5669 | ThemeSetTextControl(pControl, sczText); | ||
5670 | 5666 | ||
5671 | if (wzNote && *wzNote) | 5667 | ThemeSetTextControl(pControl, sczText); |
5672 | { | ||
5673 | hr = pTheme->pfnFormatString(wzNote, &sczText, pTheme->pvVariableContext); | ||
5674 | ThmExitOnFailure(hr, "Failed to format note: %ls", wzNote); | ||
5675 | } | ||
5676 | else | ||
5677 | { | ||
5678 | ReleaseNullStr(sczText); | ||
5679 | } | ||
5680 | 5668 | ||
5681 | ::SendMessageW(pControl->hWnd, BCM_SETNOTE, 0, reinterpret_cast<WPARAM>(sczText)); | 5669 | if (wzNote && *wzNote) |
5670 | { | ||
5671 | hr = pTheme->pfnFormatString(wzNote, &sczText, pTheme->pvVariableContext); | ||
5672 | ThmExitOnFailure(hr, "Failed to format note: %ls", wzNote); | ||
5673 | } | ||
5674 | else | ||
5675 | { | ||
5676 | ReleaseNullStr(sczText); | ||
5682 | } | 5677 | } |
5683 | 5678 | ||
5679 | ::SendMessageW(pControl->hWnd, BCM_SETNOTE, 0, reinterpret_cast<WPARAM>(sczText)); | ||
5680 | } | ||
5681 | |||
5682 | if (pControl->fAutomaticValue) | ||
5683 | { | ||
5684 | // If this is a named control, do variable magic. | 5684 | // If this is a named control, do variable magic. |
5685 | if (pControl->sczName && *pControl->sczName) | 5685 | if (pControl->sczName && *pControl->sczName) |
5686 | { | 5686 | { |
@@ -6010,7 +6010,7 @@ static HRESULT OnLoadingControl( | |||
6010 | __in THEME* pTheme, | 6010 | __in THEME* pTheme, |
6011 | __in const THEME_CONTROL* pControl, | 6011 | __in const THEME_CONTROL* pControl, |
6012 | __inout WORD* pwId, | 6012 | __inout WORD* pwId, |
6013 | __inout BOOL* pfDisableAutomaticFunctionality | 6013 | __inout DWORD* pdwAutomaticBehaviorType |
6014 | ) | 6014 | ) |
6015 | { | 6015 | { |
6016 | HRESULT hr = S_OK; | 6016 | HRESULT hr = S_OK; |
@@ -6030,7 +6030,7 @@ static HRESULT OnLoadingControl( | |||
6030 | if (SUCCEEDED(hr)) | 6030 | if (SUCCEEDED(hr)) |
6031 | { | 6031 | { |
6032 | *pwId = loadingControlResults.wId; | 6032 | *pwId = loadingControlResults.wId; |
6033 | *pfDisableAutomaticFunctionality = loadingControlResults.fDisableAutomaticFunctionality; | 6033 | *pdwAutomaticBehaviorType = loadingControlResults.dwAutomaticBehaviorType; |
6034 | } | 6034 | } |
6035 | } | 6035 | } |
6036 | 6036 | ||
@@ -6232,9 +6232,16 @@ static HRESULT LoadControls( | |||
6232 | 6232 | ||
6233 | // Default control ids to the next id, unless there is a specific id to assign to a control. | 6233 | // Default control ids to the next id, unless there is a specific id to assign to a control. |
6234 | WORD wControlId = THEME_FIRST_AUTO_ASSIGN_CONTROL_ID; | 6234 | WORD wControlId = THEME_FIRST_AUTO_ASSIGN_CONTROL_ID; |
6235 | hr = OnLoadingControl(pTheme, pControl, &wControlId, &pControl->fDisableAutomaticFunctionality); | 6235 | DWORD dwAutomaticBehaviorType = THEME_CONTROL_AUTOMATIC_BEHAVIOR_ALL; |
6236 | hr = OnLoadingControl(pTheme, pControl, &wControlId, &dwAutomaticBehaviorType); | ||
6236 | ThmExitOnFailure(hr, "ThmLoadingControl failed."); | 6237 | ThmExitOnFailure(hr, "ThmLoadingControl failed."); |
6237 | 6238 | ||
6239 | pControl->fAutomaticEnabled = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ENABLED != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ENABLED & dwAutomaticBehaviorType); | ||
6240 | pControl->fAutomaticVisible = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VISIBLE != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VISIBLE & dwAutomaticBehaviorType); | ||
6241 | pControl->fAutomaticAction = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION & dwAutomaticBehaviorType); | ||
6242 | pControl->fAutomaticText = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT & dwAutomaticBehaviorType); | ||
6243 | pControl->fAutomaticValue = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE & dwAutomaticBehaviorType); | ||
6244 | |||
6238 | // This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range. | 6245 | // This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range. |
6239 | if (THEME_FIRST_AUTO_ASSIGN_CONTROL_ID <= wControlId && THEME_FIRST_ASSIGN_CONTROL_ID > wControlId) | 6246 | if (THEME_FIRST_AUTO_ASSIGN_CONTROL_ID <= wControlId && THEME_FIRST_ASSIGN_CONTROL_ID > wControlId) |
6240 | { | 6247 | { |
@@ -6250,7 +6257,7 @@ static HRESULT LoadControls( | |||
6250 | BOOL fDisabled = pControl->dwStyle & WS_DISABLED; | 6257 | BOOL fDisabled = pControl->dwStyle & WS_DISABLED; |
6251 | 6258 | ||
6252 | // If the control is supposed to be initially visible and it has a VisibleCondition, check if it's true. | 6259 | // If the control is supposed to be initially visible and it has a VisibleCondition, check if it's true. |
6253 | if (fVisible && pControl->sczVisibleCondition && pTheme->pfnEvaluateCondition && !pControl->fDisableAutomaticFunctionality) | 6260 | if (fVisible && pControl->sczVisibleCondition && pTheme->pfnEvaluateCondition && pControl->fAutomaticVisible) |
6254 | { | 6261 | { |
6255 | hr = pTheme->pfnEvaluateCondition(pControl->sczVisibleCondition, &fVisible, pTheme->pvVariableContext); | 6262 | hr = pTheme->pfnEvaluateCondition(pControl->sczVisibleCondition, &fVisible, pTheme->pvVariableContext); |
6256 | ThmExitOnFailure(hr, "Failed to evaluate VisibleCondition: %ls", pControl->sczVisibleCondition); | 6263 | ThmExitOnFailure(hr, "Failed to evaluate VisibleCondition: %ls", pControl->sczVisibleCondition); |
@@ -6269,7 +6276,7 @@ static HRESULT LoadControls( | |||
6269 | } | 6276 | } |
6270 | 6277 | ||
6271 | // If the control is supposed to be initially enabled and it has an EnableCondition, check if it's true. | 6278 | // If the control is supposed to be initially enabled and it has an EnableCondition, check if it's true. |
6272 | if (!fDisabled && pControl->sczEnableCondition && pTheme->pfnEvaluateCondition && !pControl->fDisableAutomaticFunctionality) | 6279 | if (!fDisabled && pControl->sczEnableCondition && pTheme->pfnEvaluateCondition && pControl->fAutomaticEnabled) |
6273 | { | 6280 | { |
6274 | BOOL fEnable = TRUE; | 6281 | BOOL fEnable = TRUE; |
6275 | 6282 | ||
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp index bc942dc8..ce74534d 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | |||
@@ -48,7 +48,7 @@ public: // IBAFunctions | |||
48 | __in LPCWSTR wzName, | 48 | __in LPCWSTR wzName, |
49 | __inout BOOL* pfProcessed, | 49 | __inout BOOL* pfProcessed, |
50 | __inout WORD* pwId, | 50 | __inout WORD* pwId, |
51 | __inout BOOL* /*pfDisableAutomaticFunctionality*/ | 51 | __inout DWORD* /*pdwAutomaticBehaviorType*/ |
52 | ) | 52 | ) |
53 | { | 53 | { |
54 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1)) | 54 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1)) |