Text preview for : 11_Dialog_Building_Block.pdf part of apple 11 Dialog Building Block apple lisa toolkit_3.0 Package_2_Examples 11_Dialog_Building_Block.pdf



Back to : 11_Dialog_Building_Block. | Home

Dialog
Building
Block
Toolkit Dialog Building Block


Dialog Boxes
A Dialog Box on the lisa is a speclal window WhiCh, ,hen
displayed, is as .ide as the screen, and hangs down right
below the menu bar.
D1alog boxes can be used as alternat1ves to menu commands
when an application needs to gather more detail from 1ts
user than can be conven1ently packaged 1n a menu.
A ToolKit application can put up a Dlalog Box any time 1ts
.1ndow is active. The D1alog Build1ng Block provides basic
structures sufficient to define dialogs, to display them,
to specify special behav10ur within them, and to
interrogate them.


Read No Further
The intended audlence for th1s document is current or
prospective direct users of the Dialog Building Block. A
basic famil1ari ty .i th the 1deas behind the ToolKi t and the
CLASCAL language is assumed. ToolKit jargon 15 unavoidable
in a document such as thi s.


Compalion Doclmentation
The primary documentation for the Dialog Building Block
consists Of three parts. I l1st them here 1n descending
order of 1mportance and authori ty.
(8] The source list1ng of the INTERFACE of uD1alog
[b) The source lIstings Of the ToolK1t sample programs,
USample and UsamD1alog.
[c 1 Th1 s document, plus subsequent addenda/errata.


How To Do It
Simple use of the DIalog Build1ng BloCk involves allocatIng
a TDialogwlndow, installing a TOialog, and add1ng dialog
components (d1aloglmages) to the d1alog to define its
display and behaviour.
In a typical dialog Box., an Application and 1ts user aHree
that Whatever the user does up In the dialog box Is not for
real- until the OK button (or some other action button) 15
pressed.
Each standard kind of dialog component carries .i ttl 1t some
basic assumptions about mouse- and cursor-behaviour. It is



Lisa Tooll1t Dlalog lul1d1ng 110Ck - 71 lIarCl\ 19M - pegt 1 or II
Toolkit Dialog Building Block
an inherent property of the TCluster component, for
example, that one and only one Of its checkboxes is selected
at anyone moment. You do not progralll this behaviour--you
select It by the very act of Choosing to use a TCluster
component.
Thus, an application typically defines the for.. and
behaviour of a d1alog box by the s1mple act of allocating
its components. The real action, whereby the App1icatlon
actually does something to 1ts data structures, 1s
precipi tated by the user' s pr~sslng a Button in the dialog.
The Application 15 able to capture control at
button-pushing time In elther of two ways: [a] By
redefining TD1alog.ButtonPushed, or [b) by assoclating a
command number with a button, and then fielding that
command in the Ne.Command methods of Its subclasses of
el ther TSelection or Tllndow.

Formally, a Dialog is an Object which resides In a
Dla10gview, which in turn is installed in some panel of some
lindow. Beginning users may think of the Dialog, the
Dialogview, and the DialogWindow as confusingly
overlapping In function. It Is hoped the explanations
below, combined with the streamlined functlonality of the
NewStdOlalogllndoi procedure, wlll let the novice user get
thlngs done efficiently even before it is Obvlous what is
g01ng on.

Each dialog box you use will involve at least Objects of the
follollng classes:
[1] TDlalogwindow: its lindOw. You usually create an
instance Of this class (rather than define a subclass),
and this 1s most exped1tiously done by call1ng the
glObal function NelStdDlalogwindow, in Ihich case you
also get a panel, a pane, and a dialogv1ew all allocated
and properly installed.
[2] TPanel: the Panel in which the dialog takes place; no
easy way to subclaS$ this, nor any clear Justification
for wanting to do so. You get a panel for free if you use
NewStdDialoglindow; otherwise, you need to allocate an
instance ot TPanel yoursel f, in wn1cn case you can nave
more control over its properties tnan the
NelStdD1alogwlndow funct10n affords.
[3] TPane: the Pane 11 tn1n tne Panel. Allocated
automatically when the panel is created.
[41 TD1alogv1el: the v1ew 1nstalled 1n the panel. This
1s created automatically for you 1f you use
NewStdD1alogw1ndow.
[5] TD1alog: A D1alog 1nstalled 1n tne d1alogv1ew. You



lisa TooWt Dialog luilding Block - 27 ftuch 1914 - page 2 of 1.
Toolkit Dialog Building Block
define ei ther an instance Of this class or else a
subclass of 1 t. More than one Dialog can be installed 1n
the same dialogv1ew (likely to be very useful for
programmed instruct10n and certa1n other spec1alized
app11cat10ns, but 1rrelevant for Most users).
Mote: TOillogs u. the units which will be ~ in a ToolResourct Fil. when (if)
that ftOdule is COfIPltted Mel the Dillog Building Block is integJ' et.td wi t.h it .
........v.r a dillog is alloc.ted. you prewidt I 4-c:hareeter ~- to he