Chapter 17: Dialogs and Controls


Overview

This chapter discusses how to create and use dialogs and the controls that they contain. It focuses on the Basic IDE as the primary method of creating dialogs. This chapter covers each of the different controls and provides examples for most of the control types. It also includes a method to build dialogs and controls at run time, rather than using the Basic IDE.

In computer terms, a window is an area shown on the computer screen in which information is displayed. In most applications, it isn't always easy to tell the difference between a dialog and a window. Although the word "dialog" has multiple definitions, the definition usually specifies an exchange of information between two entities-usually people. In OpenOffice.org, a dialog is a window that is displayed to interact with a user .

If a window is modal, it's usually considered to be a dialog. A window is considered modal if its parent application is blocked from further activity until the window has completed executing its code and has been closed successfully. For example, the Print statement displays a modal dialog (see Listing 1 ). The menu option File Open also displays a modal dialog. While a modal dialog is displayed, you can access the dialog but not the document window. Dialogs are almost always modal, and general application windows , such as those displaying documents under user control, are almost never modal.

Listing 1: The Print statement displays a modal dialog.
start example
 Print "Hello" 
end example
 

The Find & Replace dialog in a Writer document is an example of a non-modal dialog. After using Ctrl-F to open the Find & Replace dialog, you can still access and edit the document. Another criterion for a window being classified as a dialog is based on function. The primary display window for a program is typically not a dialog. The information displayed or requested in a dialog is usually secondary compared to the function of the program. For example, configuration information and error notices are frequently displayed in a dialog, but the primary text of a Writer document is not. Although the difference between a window and a dialog is somewhat arbitrary, you can create and use your own dialogs in Basic, but you can't open and start a general application window. This is reasonable, because the usual purpose of a dialog is to communicate some details relevant to the configuration of an application, object, or document that is already active.




OpenOffice.org Macros Explained
OpenOffice.org Macros Explained
ISBN: 1930919514
EAN: 2147483647
Year: 2004
Pages: 203

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net