proc VariantPropSetEnabler {args} {
    return true
}

proc ApplyVariantNameToAllTitleBlock { aInstOcc aVariantProp aVariantName } {
	set lStatus [DboState]
	set lTitleBlockOccIter [$aInstOcc NewChildrenIter $lStatus $::IterDefs_TITLEBLOCKS]
	set lTitleBlockOcc [$lTitleBlockOccIter NextOccurrence $lStatus]
	set lNullObj NULL
	while {$lTitleBlockOcc!=$lNullObj} {
		set lTitleBlock [$lTitleBlockOcc GetInstance $lStatus]
		set lDispProp [$lTitleBlock GetDisplayProp $aVariantProp $lStatus]
		if {$lDispProp!=$lNullObj} {
			$lTitleBlock SetEffectivePropStringValue $aVariantProp $aVariantName
		}
		set lTitleBlockOcc [$lTitleBlockOccIter NextOccurrence $lStatus]
	}
}

proc PreVariantViewSetCallBack { aDesign } {
	set lActiveVariant [GetActiveVariant]
	set lStatus [DboState]
	set lDesignOccIter [$aDesign NewOccurrencesIter $lStatus]
	set pDboInstOcc [$lDesignOccIter NextOccurrence $lStatus]
	set varNullObj NULL
	set lVariantProp [DboTclHelper_sMakeCString {Variant Name}]
	set lVariantPropVal [DboTclHelper_sMakeCString $lActiveVariant]
	while {$pDboInstOcc!=$varNullObj} {
		ApplyVariantNameToAllTitleBlock $pDboInstOcc $lVariantProp $lVariantPropVal
		set pDboInstOcc [$lDesignOccIter NextOccurrence $lStatus]
	}
	delete_DboDesignOccurrencesIter $lDesignOccIter
	capDisplayMessageBox $lMessage "Pre Variant View CallBack"
}

RegisterAction "_cdnOrPreVariantViewMode" "VariantPropSetEnabler" "" "PreVariantViewSetCallBack" ""
