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.

12<br />

C H A P T E R 1 2<br />

12 Forms<br />

In many respects, the structure of <strong>OpenOffice</strong>.<strong>org</strong> forms corresponds to the dialogs. There are, however, a few<br />

key differences:<br />

Dialogs appear in the form of one single dialog window, which is displayed over the document and does not<br />

permit any actions other than dialog processing until the dialog is ended. Forms, on the other hand, are<br />

displayed directly in the document, just like drawing elements.<br />

A dialog editor is provided for creating dialogs, and this can be found in the <strong>OpenOffice</strong>.<strong>org</strong> Basic<br />

development environment. Forms are created using the Form Controls and the Form Design Toolbar directly<br />

within the document.<br />

Whereas the dialog functions are available in all <strong>OpenOffice</strong>.<strong>org</strong> documents, the full scope of the form<br />

functions are only available in text and spreadsheets.<br />

The control elements of a form can be linked with an external database table. This function is not available in<br />

dialogs.<br />

The control elements of dialogs and forms differ in several aspects.<br />

Users who want to provide their forms with their own methods for event handling, should refer to the Dialogs<br />

chapter. The mechanisms explained there are identical to those for forms.<br />

Working With Forms<br />

<strong>OpenOffice</strong>.<strong>org</strong> forms may contain text fields, list boxes, radio buttons, and a range of other control elements,<br />

which are inserted directly in a text or spreadsheet. The Form Functions Toolbar is used for editing forms.<br />

A <strong>OpenOffice</strong>.<strong>org</strong> form may adopt one of two modes: the draft mode and the display mode. In draft mode, the<br />

position of control elements can be changed and their properties can be edited using a properties window.<br />

The Form Functions Toolbar is also used to switch between modes.<br />

Determining Object Forms<br />

<strong>OpenOffice</strong>.<strong>org</strong> positions the control elements of a form at drawing object level. The actual object form can be<br />

accessed through the Forms list at the drawing level. The objects are accessed as follows in text documents:<br />

Dim Doc As Object<br />

Dim DrawPage As Object<br />

Dim Form As Object<br />

Doc = ThisComponent<br />

DrawPage = Doc.DrawPage<br />

Form = DrawPage.Forms.GetByIndex(0)<br />

167

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

Saved successfully!

Ooh no, something went wrong!