'
' This example demonstrates various Enum Controls
'
set oCustomProperty = ActiveSceneRoot.AddProperty( "CustomProperty", false, "Enum Controls" )
'Create the custom parameters, and set the default values
oCustomProperty.AddParameter3 "MyCombo", siString, "Yellow"
oCustomProperty.AddParameter3 "MyBitField", siUByte, 68
oCustomProperty.AddParameter3 "MyRadio", siInt4
oCustomProperty.AddParameter3 "NotShown", siInt4
'Define the layout
set oLayout = oCustomProperty.PPGLayout
'For the combo box we set the label and the value the same
'because we actually want to store the string the user
'selects as the parameter value
dim aComboItems, aBitfieldItems, aRadioItems
aComboItems = Array( "Orange", "Orange", _
"Yellow", "Yellow", _
"Apple", "Apple" )
oLayout.AddEnumControl "MyCombo", aComboItems, "Things", siControlCombo
' For a bitfields the values normally should be powers of two
' Notice they can be in any order
aBitfieldItems = Array( "Bit 0", 1, _
"Bit 6", 64, _
"Bit 2", 4, _
"Bit 7", 128 )
oLayout.AddEnumControl "MyBitField", aBitfieldItems, , siControlCheck
' Radio button is a good alternative to ComboBox when you only
' have a few options to give to the user
aRadioItems = Array( "Slow", 0, _
"Fast", 1 )
oLayout.AddEnumControl "MyRadio", aRadioItems, , siControlRadio
InspectObj oCustomProperty |