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.

Dialog Control Elements<br />

Buttons<br />

A button performs an action when you click it.<br />

The simplest scenario is for the button to trigger a When Initiating event when it is clicked by a user. You can<br />

also link another action to the button to close a dialog using the PushButtonType property. When you click a<br />

button that has this property set to the value of 0, the dialog remains unaffected. If you click a button that has this<br />

property set to the value of 1, the dialog is closed, and the Execute method of the dialog returns the value 1<br />

(dialog sequence has been ended correctly). If the PushButtonType has the value of 2, the dialog is closed and<br />

the Execute method of the dialog returns the value 0 (dialog closed). In the Dialog Editor, the property values<br />

are shown symbolically, as Default (0), Okay (1), and Cancel (2).<br />

The following are some of the properties that are available through the button model:<br />

Model.BackgroundColor (long)<br />

color of background<br />

Model.DefaultButton (Boolean)<br />

The button is used as the default value and responds to the Enter key if it has no focus<br />

Model.FontDescriptor (struct)<br />

structure that specifies the details of the font to be used (in accordance with<br />

com.sun.star.awt.FontDescriptor structure)<br />

Model.Label (String)<br />

label that is displayed on the button<br />

Model.Printable (Boolean)<br />

the control element can be printed<br />

Model.TextColor (Long)<br />

text color of the control element<br />

Model.HelpText (String)<br />

help text that is displayed when you move the mouse cursor over the control element<br />

Model.HelpURL (String)<br />

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

PushButtonType (short)<br />

action that is linked to the button (0: no action, 1: OK, 2: Cancel)<br />

Option Buttons<br />

These buttons are generally used in groups and allow you to select from one of several options. When you select<br />

an option, all of the other options in the group are deactivated. This ensures that at any one time, only one option<br />

button is set.<br />

An option button control element provides two properties:<br />

State (Boolean)<br />

activates the button<br />

Label (String)<br />

label that is displayed on the button<br />

You can also use the following properties from the model of the option buttons:<br />

Model.FontDescriptor (struct)<br />

structure with details of the font to be used (in accordance with com.sun.star.awt.FontDescriptor)<br />

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