PPGLayout.AddStaticText
 
 
 

PPGLayout.AddStaticText operator

Introduced

v4.2

Description

Static text is read-only text which appears directly on the property page. It is similar to the label of a parameter but it is not associated with any parameter. It is a useful control for adding basic documentation directly in the user interface. Use line breaks in the text to force the text onto multiple lines (e.g. vbCrLf on vbscript and "\n" in jscript).

Note: It is also still possible to read the text for a static control from a value of a string parameter, by using siControlStatic. (See siPPGControlType). However this method is easier and more efficient because it does not require any associated Parameter.

C# Syntax

PPGItem PPGLayout.AddStaticText( String in_Text, Int32 in_opt_width, Int32 in_opt_Height );

Scripting Syntax

oReturn = PPGLayout.AddStaticText( [Text], [Width], [Height] );

Return Value

PPGItem

Parameters

Parameter Type Description
Text String The text to show on the static control. This can be changed afterwards by setting PPGItem.Label.
Width Long Width of the static text. If not specified to text will use the entire width of the Property Page and will not word wrap even if it does not fit.

Default Value: 0

Height Long Height of the text. If not specified it will be calculated based on the number of lines of text.

Default Value: 0

Examples

JScript Example

/*
        This example places some text directly on the layout
*/
var oPSet = ActiveSceneRoot.AddProperty( "CustomProperty", false, "StaticTextDemo" ) ;
oPSet.AddParameter3( "A", siDouble ) 
oPSet.AddParameter3( "B", siDouble ) 
oPSet.AddParameter3( "C", siDouble ) 
var oLayout = oPSet.PPGLayout
oLayout.AddRow();
var text = "\nThis is some text \nthat goes beside the \nparameters."
        oLayout.AddStaticText( text )
        oLayout.AddGroup()
                oLayout.AddItem( "A" )
                oLayout.AddItem( "B" )
                oLayout.AddItem( "C" )
        oLayout.EndGroup()
oLayout.EndRow();
InspectObj( oPSet ) ;

See Also

PPGItem