REM ***** BASIC *****
Sub createColorSelectionBox
' create a new 形態/調整
xShape = thisComponent.createInstance( "com.sun.星/主役にする.製図/抽選.ControlShape" )
薄暗い aPos as new com.sun.星/主役にする.awt.Point
aPos.X = 200
aPos.Y = 100
xShape.Position = aPos
Erase aPos
薄暗い aSize as new com.sun.星/主役にする.awt.Size
aSize.Width = 2500
aSize.高さ = 5000
xShape.Size = aSize
Erase aSize
' create a combo box model
xControlModel = thisComponent.createInstance( "com.sun.星/主役にする.form.構成要素.ComboBox" )
xControlModel.指名する = "ColorSelection"
xControlModel.Text = "red"
' marry the 形態/調整 and the model
xShape.支配(する)/統制する = xControlModel
if ( 0 = thisComponent.DrawPage.Forms.getCount() ) Then
xForm = thisComponent.createInstance( "com.sun.星/主役にする.form.構成要素.DataForm" )
xForm.指名する = "SampleForm"
thisComponent.DrawPage.Forms.insertByIndex( 0, xForm )
End If
' 挿入する the 支配(する)/統制する model into the first form of the forms collection of the
' draw page of the 文書
thisComponent.DrawPage.Forms.getByIndex(0).insertByIndex( 0, xControlModel )
thisComponent.DrawPage.追加する( xShape )
End Sub
Returns
the コンテナ of all the 最高の,を越す-level forms belonging to the 構成要素.