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.

Working With Forms<br />

Position (struct)<br />

position of control element (com.sun.star.awt.Point data structure)<br />

The following example shows how the position and size of a control element can be set using the associated<br />

shape object:<br />

Dim Shape As Object<br />

Dim Point As New com.sun.star.awt.Point<br />

Dim Size As New com.sun.star.awt.Size<br />

' ... Initialize Shape object, as previously shown ...<br />

Point.x = 1000<br />

Point.y = 1000<br />

Size.Width = 10000<br />

Size.Height = 10000<br />

Shape.Size = Size<br />

Shape.Position = Point<br />

The shape object of the control element must already be known if the code is to function. If this is not the case,<br />

it must be determined using the preceding code.<br />

Control Element Forms<br />

The control elements available in forms are similar to those of dialogs. The selection ranges from simple text<br />

fields through list and combo boxes to various buttons.<br />

Below, you will find a list of the most important properties for control element forms. All properties form part of<br />

the associated model objects.<br />

In addition to the standard control elements, a table control element is also available for forms, which enables the<br />

complete incorporation of database tables. This is described in the Database Forms chapter.<br />

Buttons<br />

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

BackgroundColor (long)<br />

background color<br />

DefaultButton (Boolean)<br />

the button serves as a default value. In this case, it also responds to the entry button if it has no focus<br />

Enabled (Boolean)<br />

the control element can be activated<br />

Tabstop (Boolean)<br />

the control element can be reached through the tabulator button<br />

TabIndex (Long)<br />

position of control element in activation sequence<br />

FontName (String)<br />

name of font type<br />

FontHeight (Single)<br />

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

170 <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!