21.08.2013 Views

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Control Element Forms<br />

FontName (String)<br />

name of font type<br />

FontHeight (Single)<br />

height of character in points (pt)<br />

Tag (String)<br />

string containing additional information, which can be saved in the button for program-controlled access<br />

Label (String)<br />

inscription of button<br />

Printable (Boolean)<br />

the control element can be printed<br />

State (Short)<br />

if 1, the option is activated, otherwise it is deactivated<br />

RefValue (String)<br />

string for saving additional information (for example, for administering data record IDs)<br />

TextColor (Long)<br />

text color of control element<br />

HelpText (String)<br />

automatically displayed help text, which is displayed if the mouse cursor is above the control element<br />

HelpURL (String)<br />

URL of online help for the corresponding control element<br />

The mechanism for grouping option buttons distinguishes between the control elements for dialogs and forms.<br />

Whereas control elements appearing one after another in dialogs are automatically combined to form a group,<br />

grouping in forms is performed on the basis of names. To do this, all option buttons of a group must contain the<br />

same name. <strong>OpenOffice</strong>.<strong>org</strong> combines the grouped control elements into an array so that the individual buttons<br />

of a <strong>OpenOffice</strong>.<strong>org</strong> Basic program can be reached in the same way.<br />

The following example shows how the model of a control element group can be determined.<br />

Dim Doc As Object<br />

Dim Forms As Object<br />

Dim Form As Object<br />

Dim Ctl As Object<br />

Dim I as Integer<br />

Doc = ThisComponent<br />

Forms = Doc.Drawpage.Forms<br />

For I = 0 To Forms.Count - 1<br />

Form = Forms.GetbyIndex(I)<br />

If Form.HasByName("MyOptions") Then<br />

Ctl = Form. GetGroupbyName("MyOptions")<br />

Exit Function<br />

End If<br />

Next I<br />

The code corresponds to the previous example for determining a simple control element model. It searches<br />

through all forms in the current text document in a loop and uses the HasByName method to check whether the<br />

corresponding form contains an element with the MyOptions name it is searching for. If this is the case, then the<br />

model array is accessed using the GetGroupByName method (rather than the GetByName method to determine<br />

simple models).<br />

Checkboxes<br />

The model object of a checkbox form provides the following properties:<br />

172 <strong>OpenOffice</strong>.<strong>org</strong> 3.2 <strong>BASIC</strong> <strong>Guide</strong> · March 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!