21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - 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.

Properties 214<br />

In the preceding example, you can<br />

also assign the Step value of 0 to the<br />

dividing line as well as the Cancel,<br />

Prev, Next, and Done buttons to<br />

display these elements on all pages.<br />

You can also assign the elements to<br />

an individual tab page (for example<br />

page 1).<br />

The following program code shows<br />

how the Step value in event handlers<br />

of the Next and Prev buttons can be<br />

increased or reduced and changes<br />

the status of the buttons.<br />

Sub cmdNext_Initiated<br />

Dim cmdNext As Object<br />

Dim cmdPrev As Object<br />

cmdPrev = Dlg.getControl("cmdPrev")<br />

cmdNext = Dlg.getControl("cmdNext")<br />

cmdPrev.Model.Enabled = Not cmdPrev.Model.Enabled<br />

cmdNext.Model.Enabled = False<br />

Dlg.Model.Step = Dlg.Model.Step + 1<br />

End Sub<br />

Sub cmdPrev_Initiated<br />

Dim cmdNext As Object<br />

Dim cmdPrev As Object<br />

cmdPrev = Dlg.getControl("cmdPrev")<br />

cmdNext = Dlg.getControl("cmdNext")<br />

cmdPrev.Model.Enabled = False<br />

cmdNext.Model.Enabled = True<br />

Dlg.Model.Step = Dlg.Model.Step - 1<br />

End Sub<br />

Designing Page 1 of the dialog<br />

A global Dlg variable that references an open dialog must be included to make this example<br />

possible. The dialog then changes its appearance as follows:

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

Saved successfully!

Ooh no, something went wrong!