eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DialogBox':

Home

everywhere
www.exept.de
for:
[back]

Class: DialogBox


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--View
                     |
                     +--TopView
                        |
                        +--StandardSystemView
                           |
                           +--ModalBox
                              |
                              +--DialogBox
                                 |
                                 +--ActionWaitBox
                                 |
                                 +--Dolphin::ListPrompter
                                 |
                                 +--Dolphin::MessageBox
                                 |
                                 +--Dolphin::Prompter
                                 |
                                 +--EnterBox
                                 |
                                 +--FontPanel
                                 |
                                 +--InfoBox
                                 |
                                 +--LicenceBox
                                 |
                                 +--OptionBox
                                 |
                                 +--Tools::SearchDialog

Package:
stx:libwidg
Category:
Views-DialogBoxes
Version:
rev: 1.298 date: 2010/03/24 12:36:57
user: cg
file: DialogBox.st directory: libwidg
module: stx stc-classLibrary: libwidg
Author:
Claus Gittinger

Description:


this class implements the common behavior of dialogboxes.

DialogBox is also a superclass of many other boxes - see InfoBox,
WarningBox, YesNoBox etc. for concrete examples.
Most of them simply add buttons or other elements.

For programmatically created boxes, instances support adding of components
in a top-to-bottom fashion, and also keep track of added text-fields and,
since they are most common, automatically create an EnterFieldGroup for
them.

Caveat: 
    more adding support is required - especially for row-wise construction.
    The programmatic interface is best suited for row-wise
    arranged components; laying out elements in columns is a bit
    complicate - for complicated dialogs, it may be better to not use
    the automatic arrangement, but instead give explicit layouts to
    the components (in a subclass) or better use the UIPainter.

Compatibility note:
    For ST-80 compatibility, DialogBox is also accessable under
    the global named 'Dialog' (which is the name of an ST-80 class,
    providing a very similar protocol).
    This may lead to confusion, if DialogBox is recompiled - you have
    to manually assign Dialog again to refer to the new DialogBox class.
    In future versions of ST/X, DialogBox may be renamed to Dialog.

Historic note:
    originally, ST/X had separate classes for the various entry methods;
    there were YesNoBox, EnterBox, InfoBox and so on.
    ST-80 has all this defined in the common Dialog.
    Therefore, for compatibility, many ST/X methods defined here in Dialogs 
    class protocol simply dispatch to some other boxes class method.
    In the future, those existing subclasses' functionality is going to
    be moved full into Dialog, and the subclasses will be replaced by dummy
    delegators. (They will be kept for backward compatibility, though).


[instance variables:]

    buttonPanel      <PanelView>    contains the button(s)

    okButton         <Button>       the ok-Button

    okAction         <Block>        the action to be performed when ok is pressed,
                                    or return is pressed.

    acceptReturnAsOK <Boolean>      if true, pressing the return-key counts
                                    as if ok was pressed. Default is true.

    abortButton      <Button>       the cancel-Button

    abortAction      <Block>        the action to be performed when cancel is
                                    pressed.

    yPosisition      <Integer>      current y position when adding components

    leftIndent       <Integer>      left inset to use when adding components

    rightIndent      <Integer>      right inset to use when adding components

    addedComponents  <Collection>   programmatically added components

    inputFieldGroup  <EnterFieldGroup>   
                                    for added input fields

    acceptOnLeave    <Boolean>      if true (the default) and there are 
                                    tabable inputFields, accept and close when
                                    the last field is left. If false, the ok
                                    button must be pressed to close the box.

    acceptedValue    v(<Boolean>)   valueHolder on a boolean
                                    after close: holds true if box was accepted
                                    (i.e. ok-Button was pressed), false if box was
                                    closed via cancel or window manager.

    autoAccept       Boolean        if true, pressing ok (or return)
                                    sends #accept to all subcomponents.
                                    I.e. all subfields update their models
                                    first. The default is true.

    variablePanel   nil|VPanel      an optional additional panel to be filled dynamically
                                    in an aboutToOpenNotification hook.

For compatibility with ST-80, this class is also available under
the global names DialogView and Dialog (see patches file).


Related information:

    Button
    CheckToggle
    Toggle
    EditField
    SelectionInListView
    FileSelectionList
    FramedBox
    Separator
    [introduction to view programming]

Class protocol:

Compatibility-VW
o  choose: aString fromList: list values: listValues lines: maxLines cancel: cancelBlock for: aView
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.
This is a new VW2.5 interface - passing an addtional argument.
In ST/X, this is not needed and ignored

o  confirm: aMessageString for: ignoredView
VW compatibility - confirm using the same viewStyle as in the view
argument; not supported in ST/X (who mixes styles ?)

o  request: aString for: aView
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or the empty string (if cancel was pressed),
This is a new VW2.5 interface - passing an addtional argument.
In ST/X, this is not needed and ignored

o  request: aString initialAnswer: initial for: aView
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string) or nil (if cancel was pressed).
This is a new VW2.5 interface - passing an addtional argument.
In ST/X, this is not needed and ignored

o  requestFileName: title default: default version: versionSym ifFail: failBlock for: aViewOrNil
new VW2.5 interface - passing an addtional argument.
In ST/X, this is not needed and ignored

o  warn: aMessageString for: ignoredView
VW compatibility - warn using the same viewStyle as in the view
argument; not supported in ST/X (who mixes styles ?)

class initialization
o  initialize

common dialogs
o  about: text label: label icon: image
opens an standard about box for an application.

o  aboutClass: aClass
opens a standard (simple) aboutBox for aClass.

o  informUser: aString during: aBlock
show a message-box while executing aBlock

o  informUser: aString during: aBlock cancel: canCancel
show a message-box while executing aBlock

o  information: aString
launch a Dialog to tell user something

o  warn: aString
launch a Dialog to warn user

confirmation dialogs
o  confirm: aString
open a modal yes-no dialog.
Return true for yes, false for no

o  confirm: aString default: what
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
InitialAnswer must be true or false and defines which button is to be
the default (i.e. return-) button

o  confirm: aString initialAnswer: what
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
InitialAnswer must be true or false and defines which button is to be
the default (i.e. return-) button

o  confirm: aString initialAnswer: what noLabel: noText
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
InitialAnswer must be true or false and defines which button is to be
the default (i.e. return-) button

o  confirm: aString noLabel: noText
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The no-button is labeled noText (for example, if you need a 'cancel' there)

o  confirm: aString title: title
open a modal yes-no dialog.
Return true for yes, false for no

o  confirm: aString title: title noLabel: noText
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The no buttons label is defined by noText (for example, to make it 'cancel').

o  confirm: aString title: title yesLabel: yesText noLabel: noText
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The yes/no buttons labels are defined by yesText/noText.

o  confirm: aString title: title yesLabel: yesText noLabel: noText initialAnswer: what
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The yes/no buttons labels are defined by yesText/noText.

o  confirm: msg withCancel: aBoolean
launch a Dialog, which allows user to enter yes, no and optionally: cancel.
return true for 'yes', false for 'no', nil for 'cancel'

o  confirm: msg withCancel: aBoolean default: default
launch a Dialog, which allows user to enter yes, no and optionally: cancel.
return true for 'yes', false for 'no', nil for 'cancel'

o  confirm: aString yesLabel: yesText
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The yes button's label is defined by yesText.

o  confirm: aString yesLabel: yesText noLabel: noText
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The yes/no buttons' labels are defined by yesText/noText.

o  confirm: aString yesLabel: yesText noLabel: noText initialAnswer: what
launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no.
The yes/no buttons labels are defined by yesText/noText.

o  confirmOKCancel: aString
launch a Dialog, which allows user to enter OK or Cancel.
return true for OK, false for Cancel.

o  confirmWithCancel: aString
launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', nil for 'cancel'

o  confirmWithCancel: aString default: default
launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', nil for 'cancel'.
The default argument marks the return-button; it may be one of nil, false or true

o  confirmWithCancel: aString default: defaultValue onCancel: cancelValue
launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', cancelValues value for 'cancel'

o  confirmWithCancel: aString default: default title: titleString
launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', nil for 'cancel'.
The default argument marks the return-button; it may be one of nil, false or true

o  confirmWithCancel: aString labels: labelArray
launch a Dialog, which allows user to enter cancel, no or yes.
Return true for 'yes', false for 'no', nil for 'cancel'.
The default is yes.
The buttons labels are given in labelArray

o  confirmWithCancel: aString labels: buttonLabels default: default
launch a Dialog, which allows user to enter yes, no and cancel.
Return true for 'yes', false for 'no', nil for 'cancel'.
The strings for cancel, no and yes are to be passed in
buttonLabels;
The default argument (if non-nil) defines the index of the
return button (1 to 3)

o  confirmWithCancel: aString labels: buttonLabels values: buttonValues default: default
launch a Dialog, which allows user to click on any button.
Return the corresponding value from the values array.
The labels for for the buttons are to be passed in
buttonLabels;
The default argument (if non-nil) defines the index of the
return button (1 to n)

o  confirmWithCancel: aString labels: buttonLabels values: buttonValues default: default boxLabel: boxLabelOrNil
obsolete - for backward compatibility

o  confirmWithCancel: aString labels: buttonLabels values: buttonValues default: default check: checkLabelOrNil on: checkHolderOrNil title: boxLabelOrNil
launch a Dialog, which allows user to click on any button.
Return the corresponding value from the values array.
The labels for for the buttons are to be passed in
buttonLabels;
The default argument (if non-nil) defines the index of the return button (1 to n).
If checkLabel/checkHolder are not nil, and additional labelled checkBox is added to operate on
checkHolder. This can be used for 'do not show this box again' checkItems.

o  confirmWithCancel: aString labels: buttonLabels values: buttonValues default: default title: boxLabelOrNil
launch a Dialog, which allows user to click on any button.
Return the corresponding value from the values array.
The labels for for the buttons are to be passed in
buttonLabels;
The default argument (if non-nil) defines the index of the
return button (1 to n)

o  confirmWithCancel: aString onCancel: cancelValue
launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', cancelValues value for 'cancel'

o  confirmWithCancel: aString title: titleString
launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', nil for 'cancel'

defaults
o  defaultLabel
return the boxes default window title.

o  updateStyleCache
extract values from the styleSheet and cache them in class variables

file name dialogs
o  requestDirectoryName
same as requestFileName, but only show directories.

o  requestDirectoryName: title
same as requestFileName, but only show directories.

o  requestDirectoryName: title default: aFileName
same as requestFileName, but only show directories

o  requestDirectoryName: title default: aFileName acceptReturnAsOK: aBoolean
same as requestFileName, but only show directories

o  requestDirectoryName: title default: aFileName ifFail: failBlock
same as requestFileName, but only show directories

o  requestDirectoryName: title default: aFileName ok: okText abort: abortText
same as requestFileName, but only show directories

o  requestDirectoryName: title default: aFileName ok: okText abort: abortText ifFail: failBlock
Same as requestFileName, but only show directories.

o  requestDirectoryName: title default: aFileName ok: okText abort: abortText ifFail: failBlock acceptReturnAsOK: aBoolean
Same as requestFileName, but only show directories.
Extended to accept return as ok if wanted.

o  requestDirectoryName: titleString default: aFileName ok: okText abort: abortText version: versionSymbol pattern: pattern fromDirectory: aDirectoryPath ifFail: failBlock whenBoxCreatedEvaluate: boxCreatedCallback asLoadDialog: aBoolean
same as requestFileName, but only show directories

o  requestFileName
launch a Dialog, which allows the user to enter a filename.
Return the pathname string consisting of the full pathname of the filename,
or an empty string (if cancel was pressed).

o  requestFileName: titleString
launch a Dialog, which allows user to enter a filename.
Return the pathname string consisting of the full pathname of the filename,
or an empty string (if cancel was pressed).

o  requestFileName: titleString default: defaultName
launch a Dialog, which allows user to enter a filename.
The box will not allow pressing 'ok' without an entered string.
Return the pathname string consisting of the full pathname of the filename,
or an empty string (if cancel was pressed).

o  requestFileName: titleString default: defaultName fromDirectory: aDirectoryPath
launch a Dialog, which allows user to enter a filename.
The box will not allow pressing 'ok' without an entered string.
Return the pathname string consisting of the full pathname of the filename,
or an empty string (if cancel was pressed).

o  requestFileName: titleString default: defaultName ifFail: cancelBlockOrValue
launch a Dialog, which allows user to enter a filename.
The box will not allow pressing 'ok' without an entered string.
Return the pathname string consisting of the full pathname of the filename,
or an empty string (if cancel was pressed).

o  requestFileName: titleString default: defaultName ifFail: failReturn pattern: pattern fromDirectory: dir
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from dir.
The box will show ok/cancel in its buttons.
The matchPattern is set to pattern initially.
Return the string or failReturn if cancel was pressed.

o  requestFileName: titleString default: defaultName ok: okText abort: abortText
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show okText in its okButton, abortText in the abortButton.
The matchPattern is set to pattern initially.
Return the string or nil if cancel was pressed.

o  requestFileName: titleString default: defaultName ok: okText abort: abortText pattern: pattern
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show okText in its okButton, abortText in the abortButton.
The matchPattern is set to pattern initially.
Return the string or nil if cancel was pressed.

o  requestFileName: titleString default: defaultName ok: okText abort: abortText pattern: pattern fromDirectory: aDirectoryPathOrNil
launch a Dialog, which allows user to enter a filename.
The files presented initially are those in aDirectoryPathOrNil, or the
last fileBox directory (default: current directory) (if a nil path is given).
The box will show okText in its okButton, abortText in the abortButton.
The matchPattern is set to pattern initially.
Return the string, or nil if cancel was pressed.

o  requestFileName: titleString default: defaultName ok: okText abort: abortText pattern: pattern fromDirectory: aDirectoryPathOrNil whenBoxCreatedEvaluate: boxCreatedCallback
launch a Dialog, which allows user to enter a filename.
The files presented initially are those in aDirectoryPathOrNil, or the
last fileBox directory (default: current directory) (if a nil path is given).
The box will show okText in its okButton, abortText in the abortButton.
The matchPattern is set to pattern initially.
Return the string, or nil if cancel was pressed.

o  requestFileName: titleString default: defaultName ok: okText abort: abortText version: versionSymbol ifFail: failBlock pattern: pattern fromDirectory: aDirectoryPath whenBoxCreatedEvaluate: boxCreatedCallback asLoadDialog: aBoolean
launch a Dialog, which allows user to enter a filename.
The files presented initially are those in aDirectoryPathOrNil, or the
last fileBox directory (default: current directory) (if a nil path is given).
The box will show okText in its okButton, abortText in the abortButton.
The matchPattern is set to pattern initially.
Return the string, or nil if cancel was pressed
The version argument allows validation of the files existance;
it may be any of:
#mustBeNew - fail (return empty string) if the file exists
#new - confirm if the file exists
#mustBeOld - fail if the file does not exist
#old - confirm if the file does not exist
#any (other) - no validation

o  requestFileName: titleString default: defaultName pattern: pattern
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show ok/cancel in its buttons.
The matchPattern is set to pattern initially.
Return the string or nil if cancel was pressed.

o  requestFileName: titleString default: defaultName pattern: pattern fromDirectory: aDirectory
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show ok/cancel in its buttons.
The matchPattern is set to pattern initially.
Return the string or nil if cancel was pressed.

o  requestFileName: titleString default: defaultName version: versionSymbol
launch a Dialog, which allows user to enter a filename.
The box will not allow pressing 'ok' without an entered string.
Return the pathname string or the empty string if cancel was pressed.
The version argument allows validation of the files existance;
it may be any of:
#mustBeNew - fail (return empty string) if the file exists
#new - confirm if the file exists
#mustBeOld - fail if the file does not exist
#old - confirm if the file does not exist
#any (other) - no validation

o  requestFileName: titleString default: defaultName version: versionSymbol ifFail: failBlock
launch a Dialog, which allows user to enter a filename.
The box will not allow pressing 'ok' without an entered string.
Return the string or the value of failBlock if cancel was pressed.
The version argument allows validation of the files existance;
it may be any of:
#mustBeNew - fail (return empty string) if the file exists
#new - confirm if the file exists
#mustBeOld - fail if the file does not exist
#old - confirm if the file does not exist
#any (other) - no validation

o  requestFileName: titleString default: defaultName version: versionSymbol ifFail: failBlock fromDirectory: aDirectoryPath
launch a Dialog, which allows user to enter a filename.
Return the string or the value of failBlock if cancel was pressed.
The version argument allows validation of the files existance;
it may be any of:
#mustBeNew - fail (return empty string) if the file exists
#new - confirm if the file exists
#mustBeOld - fail if the file does not exist
#old - confirm if the file does not exist
#any (other) - no validation

o  requestFileName: titleString default: defaultName version: versionSymbol ifFail: failBlock pattern: pattern fromDirectory: aDirectoryPath
launch a Dialog, which allows user to enter a filename.
Return the string or the value of failBlock if cancel was pressed.
The version argument allows validation of the files existance;
it may be any of:
#mustBeNew - fail (return empty string) if the file exists
#new - confirm if the file exists
#mustBeOld - fail if the file does not exist
#old - confirm if the file does not exist
#any (other) - no validation

o  requestFileName: titleString default: defaultName version: versionSymbol ifFail: failBlock pattern: pattern fromDirectory: aDirectoryPath whenBoxCreatedEvaluate: boxCreatedCallback
launch a Dialog, which allows user to enter a filename.
Return the string or the value of failBlock if cancel was pressed.
The version argument allows validation of the files existance;
it may be any of:
#mustBeNew - fail (return empty string) if the file exists
#new - confirm if the file exists
#mustBeOld - fail if the file does not exist
#old - confirm if the file does not exist
#any (other) - no validation

o  requestFileName: titleString fromDirectory: aDirectory
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show ok/cancel in its buttons.
Return the string or nil if cancel was pressed.

o  requestFileName: titleString ifFail: cancelBlockOrValue
launch a Dialog, which allows user to enter a filename.
Return the pathname string consisting of the full pathname of the filename,
or the value from evaluating cancelBlock (if cancel was pressed).

o  requestFileName: titleString pattern: pattern
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show ok/cancel in its buttons.
The matchPattern is set to pattern initially.
Return the string or nil if cancel was pressed.

o  requestFileName: titleString pattern: pattern fromDirectory: aDirectory
launch a Dialog, which allows user to enter a filename.
The files presented initially are those from the current directory.
The box will show ok/cancel in its buttons.
The matchPattern is set to pattern initially.
Return the string or nil if cancel was pressed.

o  requestFileNames: titleString default: defaultName ok: okText abort: abortText ifFail: failBlock pattern: pattern fromDirectory: aDirectoryPath whenBoxCreatedEvaluate: boxCreatedCallback asLoadDialog: asLoadDialog
launch a Dialog, which allows user to enter a filename.
The files presented initially are those in aDirectoryPathOrNil, or the
last fileBox directory (default: current directory) (if a nil path is given).
The box will show okText in its okButton, abortText in the abortButton.
The matchPattern is set to pattern initially.
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed

o  requestNewFileName: titleString default: defaultName
launch a Dialog, which allows user to enter a filename.
We expect a new files (i.e. nonexisting) name to be enterred,
and confirm if it already exists.
The box will not allow pressing 'ok' without an entered string.
Return the pathname string consisting of the full pathname of the filename,
or an empty string (if cancel was pressed).

o  requestSaveFileName: title default: defaultOrNil fromDirectory: directoryOrNil action: action appendAction: appendActionOrNil
save contents into a file - ask user for filename using a fileSelectionBox.
Append is NOT offered, if appendActionOrNil is nil.

fill in the blank dialogs
o  forRequestText: title editViewClass: editViewClass lines: numLines columns: numCols initialAnswer: initialText model: textModel
return a dialog asking for multiline text.
The box is not shown yet, for further customization

o  forRequestText: title editViewClass: editViewClass lines: numLines columns: numCols initialAnswer: initialText model: textModel setupWith: aSetupBlockOrNil
return a dialog asking for multiline text.
The box is not shown yet, for further customization

o  forRequestText: title lines: numLines columns: numCols initialAnswer: initialText model: textModel
return a dialog asking for multiline text.
The box is not shown yet, for further customization

o  request: aString
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or the empty string (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centered action: resultAction initialAnswer: initial
launch a Dialog, which allows user to enter a string.
If aPoint is nonNil, the box is shown there, optionally centered around
that point.
If it is nil, it is shown at the current pointer position or at the
screen center.
Return the string or an empty string (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centered action: resultAction initialAnswer: initial okLabel: okLabel cancelLabel: cancelLabel onCancel: cancelValue
launch a Dialog, which allows user to enter a string.
If aPoint is nonNil, the box is shown there, optionally centered around it.
If it is nil, it is shown at the current pointer position or at the
screen center (if centered is true).
The ok-button is labelled okLabel (or the default, ifNil),
the cancel-button is labelled cancelLabel (or the default, ifNil).
Return the string or the value of cancelValue (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centered action: resultAction initialAnswer: initial okLabel: okLabel cancelLabel: cancelLabel title: titleString onCancel: cancelValue
launch a Dialog, which allows user to enter a string.
The dialogs window is titled titleString, or the default (if nil).
If aPoint is nonNil, the box is shown there, optionally centered around it.
If it is nil, it is shown at the current pointer position or at the
screen center (if centered is true).
The ok-button is labelled okLabel (or the default, ifNil),
the cancel-button is labelled cancelLabel (or the default, ifNil).
Return the string or the value of cancelValue (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centered action: resultAction initialAnswer: initial okLabel: okLabel cancelLabel: cancelLabel title: titleString onCancel: cancelValue list: listToSelectFrom
launch a Dialog, which allows user to enter a string.
The dialogs window is titled titleString, or the default (if nil).
If aPoint is nonNil, the box is shown there, optionally centered around it.
If it is nil, it is shown at the current pointer position or at the
screen center (if centered is true).
The ok-button is labelled okLabel (or the default, ifNil),
the cancel-button is labelled cancelLabel (or the default, ifNil).
Return the string or the value of cancelValue (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centered action: resultAction initialAnswer: initial okLabel: okLabel cancelLabel: cancelLabel title: titleString onCancel: cancelValue list: listToSelectFrom initialSelection: anInterval
launch a Dialog, which allows user to enter a string.
The dialogs window is titled titleString, or the default (if nil).
If aPoint is nonNil, the box is shown there, optionally centered around it.
If it is nil, it is shown at the current pointer position or at the
screen center (if centered is true).
The ok-button is labelled okLabel (or the default, ifNil),
the cancel-button is labelled cancelLabel (or the default, ifNil).
Return the string or the value of cancelValue (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centeredOrNil action: resultAction initialAnswer: initial okLabel: okLabel cancelLabel: cancelLabel title: titleString onCancel: cancelValue list: listToSelectFrom initialSelection: anInterval entryCompletionBlock: entryCompletionBlock
launch a Dialog, which allows user to enter a string.
The dialogs window is titled titleString, or the default (if nil).
If aPoint is nonNil, the box is shown there, optionally centered around it.
If it is nil, it is shown at the current pointer position or at the
screen center (if centered is true).
The ok-button is labelled okLabel (or the default, ifNil),
the cancel-button is labelled cancelLabel (or the default, ifNil).
Return the string or the value of cancelValue (if cancel was pressed)

o  request: aString displayAt: aPoint centered: centered action: resultAction initialAnswer: initial onCancel: cancelValue
launch a Dialog, which allows user to enter a string.
If aPoint is nonNil, the box is shown there, optionally centered.
If it is nil, it is shown at the current pointer position or at the screen center.
Return the string or the value of cancelValue (if cancel was pressed)

o  request: aString displayAt: aPoint initialAnswer: initial
launch a Dialog, which allows user to enter something.
The boxes topLeft is placed at aPoint, or under the mouse pointer (if aPoint is nil).
Return the entered string (may be empty string) or nil (if cancel was pressed)

o  request: aString initialAnswer: initial
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string) or nil (if cancel was pressed)

o  request: aString initialAnswer: initial entryCompletionBlock: entryCompletionBlock
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string) or nil (if cancel was pressed)

o  request: aString initialAnswer: initial initialSelection: anInterval
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string) or nil (if cancel was pressed)

o  request: aString initialAnswer: initial list: aList
launch a Dialog, which allows user to enter something,
or select from a list of values.
Return the entered string (may be empty string) or nil (if cancel was pressed)

o  request: aString initialAnswer: initial okLabel: okLabel title: titleString
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or cancelValue (if cancel was pressed)

o  request: aString initialAnswer: initial okLabel: okLabel title: titleString list: list
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or cancelValue (if cancel was pressed)

o  request: aString initialAnswer: initial okLabel: okLabel title: titleString onCancel: cancelAction
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or cancelValue (if cancel was pressed)

o  request: aString initialAnswer: initial okLabel: okLabel title: titleString onCancel: cancelAction list: listOfChoices
launch a Dialog, which allows user to enter something
(with a list of choices for fast input).
Return the entered string (may be empty string)
or cancelValue (if cancel was pressed)

o  request: aString initialAnswer: initial okLabel: okLabel title: titleString onCancel: cancelAction list: listOfChoices entryCompletionBlock: entryCompletionBlock
launch a Dialog, which allows user to enter something
(with a list of choices for fast input).
Return the entered string (may be empty string)
or cancelValue (if cancel was pressed)

o  request: aString initialAnswer: initial onCancel: cancelAction
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or cancelValue (if cancel was pressed)

o  request: aString list: listOfChoices
launch a Dialog, which allows user to enter something,
but adds a list of choices for fast input.
Return the entered string (may be empty string)
or the empty string (if cancel was pressed)

o  request: aString okLabel: okLabel
launch a Dialog, which allows user to enter something.
The okButton is labelled as okLabel.
Return the entered string (may be empty string)
or the empty string (if cancel was pressed)

o  request: aString okLabel: okLabel onCancel: cancelValue
launch a Dialog, which allows user to enter something.
The okButton is labelled as okLabel.
Return the entered string (may be empty string)
or the value from evaluating cancelValue (if cancel was pressed)

o  request: aString okLabel: okLabel title: titleString onCancel: cancelValue
launch a Dialog, which allows user to enter something.
The okButton is labelled as okLabel.
Return the entered string (may be empty string)
or the value from evaluating cancelValue (if cancel was pressed)

o  request: aString onCancel: cancelActionOrValue
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string)
or the value of cancelAction (if cancel was pressed).

o  request: aString title: titleString initialAnswer: initial
launch a Dialog, which allows user to enter something.
Return the entered string (may be empty string) or nil (if cancel was pressed)

o  requestNumber: aString
launch a Dialog, which allows user to enter a number.
Return the numeric value or nil
(for an invalid number or if cancel was pressed)

o  requestNumber: aString initialAnswer: aNumber
launch a Dialog, which allows user to enter a number.
Return the numeric value or nil
(for an invalid number or if cancel was pressed)

o  requestPassword: aString
launch a Dialog, which allows user to enter something invisibly.
Return the entered string (may be empty string)
or nil (if cancel was pressed)

o  requestText: title
open a dialog asking for multiline text.
Return a stringCollection or nil if cancelled.

o  requestText: title initialAnswer: initialAnswer
open a dialog asking for multiline text.
Return a stringCollection or nil if cancelled.

o  requestText: title lines: numLines columns: numCols initialAnswer: initialText
open a dialog asking for multiline text.
Return a stringCollection or nil if cancelled.

multiple choice dialogs
o  choose: aString fromList: list lines: maxLines
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list lines: maxLines initialSelection: initialSelection
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list lines: maxLines initialSelection: initialSelection title: windowTitle
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list lines: maxLines title: windowTitle
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues buttons: buttonLabels values: buttonValues lines: maxLines cancel: cancelBlock
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues buttons: buttonLabels values: buttonValues lines: maxLines cancel: cancelBlock multiple: multiple
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
If a list is present, multiple controls if multiple selections are allowed.
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues buttons: buttonLabels values: buttonValues lines: maxLines cancel: cancelBlock multiple: multiple postBuildBlock: aBlockOrNil
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
If a list is present, multiple controls if multiple selections are allowed.
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues buttons: buttonLabels values: buttonValues lines: maxLines cancel: cancelBlock postBuildBlock: postBuildBlock
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues initialSelection: initialListSelectionOrNil buttons: buttonLabels values: buttonValues default: defaultValue lines: maxLines cancel: cancelBlock multiple: multiple postBuildBlock: aBlockOrNil
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
If a list is present, multiple controls if multiple selections are allowed.
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues initialSelection: initialListSelectionOrNil buttons: buttonLabels values: buttonValues default: defaultValue lines: maxLines cancel: cancelBlock multiple: multiple title: windowTitle postBuildBlock: aBlockOrNil
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
If a list is present, multiple controls if multiple selections are allowed.
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues initialSelection: initialListSelectionOrNil buttons: buttonLabels values: buttonValues lines: maxLines cancel: cancelBlock multiple: multiple postBuildBlock: aBlockOrNil
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
If a list is present, multiple controls if multiple selections are allowed.
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: listValues lines: maxLines cancel: cancelBlock
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: values lines: maxLines cancel: cancelBlock title: windowTitle
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: values lines: maxLines initialSelection: initialSelection title: windowTitle
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString fromList: list values: values lines: maxLines title: windowTitle
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  choose: aString label: windowLabel image: imageOrNil labels: buttonLabels values: values default: default onCancel: cancelValue
launch a Dialog, which allows user to enter any of buttonLabels.
Returning a corresponding value from the values-array.
The default entries button is marked as a return button and entering
return will choose that value; hitting escape returns cancelValue.
For a good userInterface style, we recommend this being the last
entry (to make the right-most button the default button).

o  choose: aString label: windowLabel labels: buttonLabels values: values default: default
launch a Dialog, which allows user to enter any of buttonLabels.
Returning a corresponding value from the values-array.
The default entries button is marked as a return button and entering
return will choose that value; hitting escape returns nil.
For a good userInterface style, we recommend this being the last
entry (to make the right-most button the default button).

o  choose: aString label: windowLabel labels: buttonLabels values: values default: default onCancel: cancelValue
launch a Dialog, which allows user to enter any of buttonLabels.
Returning a corresponding value from the values-array.
The default entries button is marked as a return button and entering
return will choose that value; hitting escape returns cancelValue.
For a good userInterface style, we recommend this being the last
entry (to make the right-most button the default button).

o  choose: aString labels: buttonLabels values: values default: default
launch a Dialog, which allows user to enter any of buttonLabels.
Returning a corresponding value from the values-array.
The default entries button is marked as a return button and entering
return will choose that value.
For a good userInterface style, we recommend this being the last
entry (to make the right-most button the default button).

o  chooseMultiple: aString fromList: list values: listValues buttons: buttonLabels values: buttonValues lines: maxLines cancel: cancelBlock
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

o  chooseMultiple: aString fromList: list values: listValues initialSelection: initialListSelectionOrNil lines: maxLines
launch a Dialog showing the message and list.
The user can select an item and click ok; in this case, the corresponding value
from listValues is returned (doubleclick works as well).
The list may be suppressed (if the list arg is nil).
Below the list, an optional row of buttons is shown, which can also be
clicked upon, and a corresponding value from buttonValues is returned.
If cancel is pressed, the value of cancelBlock is returned.
Pressing ok without a selection is treated like cancel.

private
o  showAndThenDestroyBox: aBox

o  showBox: aBox

queries
o  defaultOKButtonAtLeft
somewhat of a kludge:
some viewStyles have ok at left (motif), others at right...

o  defaultParentWindow
return a default parent (top-) window for the dialog.
Here, the currently active view is returned, if there
is one; otherwise, the first encountered topView is
returned.

smalltalk dialogs
o  requestClass: aString
launch a Dialog, which allows user to enter an existing classes name.
Return the entered class or nil (if cancel was pressed).
The entryField does classNameCompletion on TAB.

o  requestClass: aString initialAnswer: initialAnswer
launch a Dialog, which allows user to enter an existing classes name.
Return the entered class or nil (if cancel was pressed).
The entryField does classNameCompletion on TAB.

o  requestClass: aString list: list okLabel: okLabel initialAnswer: initial
launch a Dialog, which allows user to enter an existing classes name.
Return the entered class or nil (if cancel was pressed).
The entryField does classNameCompletion on TAB.

o  requestClass: aString okLabel: okLabel initialAnswer: initial
launch a Dialog, which allows user to enter an existing classes name.
Return the entered class or nil (if cancel was pressed).
The entryField does classNameCompletion on TAB.

o  requestClassName: aString list: list okLabel: okLabel initialAnswer: initial
launch a Dialog, which allows user to enter a class name.
Return the entered string (may be empty string) or nil (if cancel was pressed).
The entryField does classNameCompletion on TAB.

o  requestClassName: aString okLabel: okLabel initialAnswer: initial
launch a Dialog, which allows user to enter a class name.
Return the entered string (may be empty string) or nil (if cancel was pressed).
The entryField does classNameCompletion on TAB.

o  requestName: title fromList: nameList title: boxTitle initialAnswer: initialTextOrNil
Ask for a name from a list (used for namespaces and sharedPools)

o  requestNameSpace: title initialAnswer: initialTextOrNil
Ask for a namespaces name

o  requestNameSpace: title title: boxTitle initialAnswer: initialTextOrNil
Ask for a namespaces name

o  requestProject: title from: listOfProjects initialAnswer: initialTextOrNil suggestions: suggestions
Ask for a project (package-id)

o  requestProject: title initialAnswer: initialTextOrNil suggestions: suggestions
Ask for a project (package-id)

o  requestSelector: aString initialAnswer: initial
launch a Dialog, which allows user to enter a method selector.
Return the entered string (may be empty string) or nil (if cancel was pressed).
The entryField does selectorCompletion on TAB.

o  requestSelector: aString okLabel: okLabel initialAnswer: initial
launch a Dialog, which allows user to enter a method selector.
Return the entered string (may be empty string) or nil (if cancel was pressed).
The entryField does selectorCompletion on TAB.

o  requestSharedPool: title title: boxTitle initialAnswer: initialTextOrNil
Ask for a sharedPools name


Instance protocol:

accessing-behavior
o  abortAction: aBlock
define the action to be performed when abort is pressed

o  acceptCheck: aBlock
if nonNil, the acceptCheck-block is evaluated when the dialog is
accepted (ok-button or Return-key). If it returns true, the box is closed,
otherwise not. Of course, you may also use a valueHolder instead of a block
to provide the check value.

o  acceptOnLeave: aBoolean
define the behavior when the last input field is left via cursor keys.
The default is to accept & close the dialog (i.e. true).

o  acceptReturnAsOK: aBoolean
turn on/off interpretation of return-key as ok.
Default is on

o  action: aBlock
set the action to be performed when user presses ok-button;
aBlock must be nil or a block. This method simply
reuses okAction: and has been added for a consistent action-setting
protocol.

o  focusOnField: anInputField
arrange for the argument to get the focus (initially)

o  focusToOKOnLeave: aBoolean
define the behavior when the last input field is left via a return
or cursor key.
The default is to shift the focus to the OK button (i.e. true).
If turned off, the OK is immediately performed, i.e.
the dialog is accepted & closed.

o  hideOnAccept: aBoolean
control if the dialog should close when accepted.
The default is true

o  makeTabable: aComponentOrSubcomponent
add a component (usually a subcomponent, of which the dialog
does not know) to the list of tabable ones (i.e. those, that can be
stepped through via FocusNext/FocusPrevious).
Toplevel tabable components are usually added with #addComponent:tabable:

o  makeTabable: aComponentOrSubcomponent after: anotherComponent
add a component (usually a subcomponent, of which the dialog
does not know) to the list of tabable ones (i.e. those, that can be
stepped through via FocusNext/FocusPrevious).
Toplevel tabable components are usually added with #addComponent:tabable:

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  makeUntabable: aComponentOrSubcomponent

o  noAction: aBlock
define the action to be performed when 'no' is pressed

o  okAction: aBlock
define the action to be performed when ok is pressed

o  title: aString yesAction: yesBlock noAction: noBlock
define title and actions

o  yesAction: aBlock
define the action to be performed when 'yes' is pressed

o  yesAction: yesBlock noAction: noBlock
define both actions

accessing-components
o  abortButton
return the abortButton - this access is provided to allow
setting the buttons look (for example: colors or font)

o  buttonPanel
return the buttonPanel - this access is provided to allow
setting the buttons look (for example: colors or font)

o  cancelButton
same as #abortButton;
return the abortButton - this access is provided to allow
setting the buttons look (for example: colors or font)

o  noButton
return the no-button

o  okButton
return the okButton - this access is provided to allow
setting the buttons look (for example: colors or font)

o  verticalPanel
if there is none yet, create and add a vertical panel.
This can be used to additional components in an aboutToOpen hook callback.

o  yesButton
return the 'yes'-button

accessing-elements
o  componentAt: name
retrieve a component by name - to access it, it must have been
named previously with #name:as:

o  name: element as: name
assign a name to a component. This can be done during construction,
to allow later access to the components (i.e. without a need to
remember them in some instVars)

accessing-look
o  abortText: aString
define the label in the abort-button

o  hideButtons
hides the buttonPanel (i.e. the ok and cancel buttons if any)

o  noLabel: aString
define the label of the 'no'-button.
And alias for #noText: - for backward compatibility

o  noText: aString
define the label of the no-button.
If not set, it defaults to the resource-string for 'no'.

o  okText: aString
define the text in the ok-button

o  okText: okString abortText: abortString
set both texts displayed in the buttons

o  okText: yesString noText: noString
define the labels of both buttons.
Alias for yesText:noText: for backward compatibility.

o  title: aString yesText: yesString noText: noString
define title and button labels

o  yesLabel: aString
define the label of the 'yes'-button.
An alias for #yesText: for backward compatibility.

o  yesText: aString
define the label of the 'yes'-button

o  yesText: yesString noText: noString
define the labels of both buttons

accessing-models
o  accept
return the valueHolder holding true when the box
is accepted, false if closed via the windowManager or
the cancel button.
This is confusing: this method was originally called #acceptValue,
but renamed for compatibility with ST-80.
This looks like a bad name to me, since in most other situations, #accept
is used to force an accept, not to return some valueHolder ...).

o  acceptChannel
same as #accept: return the valueHolder which is set to true when the box
is accepted

o  acceptChannel: aValueHolder
set the valueHolder which is set to true when the box
is accepted

o  aspectAt: anAspectSymbol put: aDataModel
return the dataModel for some aspect, nil if no such dataModel was defined;
requires that a corresponding dataModel has been set (usually during
initialization) via the #aspectAt:put: message.
Allows users of boxes to access individual values - especially useful,
in multi-field dialogs.

o  aspectFor: anAspectSymbol
return the dataModel for some aspect, nil if no such dataModel was defined;
requires that a corresponding dataModel has been set (usually during
initialization) via the #aspectAt:put: message.
Allows users of boxes to access individual values - especially useful,
in multi-field dialogs.

o  cancel

construction-adding
o  addComponent: aComponent
add any component with its preferred height and full width.
Returns the component.

o  addComponent: aComponent indent: indent
add any component with its preferred height and full width.
The indent is temporarily changed to indent.
Returns the component.

o  addComponent: aComponent indent: indent tabable: tabable
add any component with its preferred height and full width.
The indent is temporarily changed to indent.
Returns the component.

o  addComponent: aComponent indent: indent withExtent: ext
add any component with some given extent.
Returns the component.

o  addComponent: aComponent indent: indent withHeight: height
add any component with some given height and full width.
Returns the component.

o  addComponent: aComponent tabable: tabable
add any component with its preferred height and full width.
Returns the component.

o  addComponent: aComponent tabable: tabable tabbedComponent: subComponent
add any component with its preferred height and full width.
Returns the component.

o  addComponent: aComponent withExtent: ext
add any component with some given extent.
Returns the component.

o  addComponent: aComponent withHeight: height
add any component with some given height and full width.
Returns the component.

o  addLabelledField: aView label: labelString adjust: labelAdjust tabable: tabable from: leftX to: rightX separateAtX: relativeX
add a label and some view side-by-side.
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
The labels string is defined by labelString and adjusted according to labelAdjust.
The inputField gets model as its model.
Return the inputField.

o  addLabelledField: aView label: labelString adjust: labelAdjust tabable: tabable from: leftX to: rightX separateAtX: relativeX nameAs: aName
add a label and some view side-by-side.
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
The labels string is defined by labelString and adjusted according to labelAdjust.
The inputField gets model as its model.
Return the inputField.

o  addLabelledField: aView label: labelString adjust: labelAdjust tabable: tabable from: leftX to: rightX separateAtX: relativeX nameAs: aName foregroundColor: fgColor
add a label and some view side-by-side.
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
The labels string is defined by labelString and adjusted according to labelAdjust.
The inputField gets model as its model.
Return the inputField.

o  addLabelledField: aView label: labelString adjust: labelAdjust tabable: tabable separateAtX: relativeX
add a label and some view side-by-side.
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
The labels string is defined by labelString and adjusted according to labelAdjust.
The inputField gets model as its model.
Return the inputField.

o  addMessage: labelString centered: centered

o  addMessage: labelString textLine: valueHolder boundary: fraction

o  addMessage: labelString textLine: valueHolder type: typeSymbolOrNil boundary: fraction

o  addTextLabel: aString
create a text label - the name has been choosen for ST-80 compatibility;
however, ST/X labels allow image labels too.
Returns the label.

o  addTextLabelOn: aValueHolder
create a text label showing the contents of a valueHolder.
Returns the label.

o  addToInputFieldGroup: aComponentOrSubcomponent
add a component to the input group.
The argument, aComponentOrSubcomponent may even be a nested subcomponent of
a topLevel component.

o  addToInputFieldGroup: aComponentOrSubcomponent before: anotherComponent
add a component to the input group.
The argument, aComponentOrSubcomponent may even be a nested subcomponent of
a topLevel component.

o  removeFromInputFieldGroup: aComponentOrSubcomponent
remove a component from the input group.
The argument, aComponentOrSubcomponent may even be a nested subcomponent of
a topLevel component.

construction-buttons
o  addAbortAndOkButtons
create both abort- and Ok Buttons

o  addAbortButton
create an abortButton - to be sent from redefined initialize
methods in subclasses or when creating a box programmatically.
Returns the button.

o  addAbortButton: aButton
add an already created abortButton - to be sent from redefined initialize
methods in subclasses or when creating a box programmatically.
Returns the button.

o  addAbortButtonLabelled: buttonLabel
create an abortButton with a label - to be sent from redefined initialize
methods in subclasses or when creating a box programmatically.
A nil argument creates one with the default label.
Returns the button.

o  addButton: aButton
add a button into the buttonPanel.
Returns the button.

o  addButton: aButton after: someOtherButtonOrNil
add a button into the buttonPanel.
If the argument someOtherButtonOrNil is nil, the button is
added at the end.

o  addButton: aButton before: someOtherButtonOrNil
add a button into the buttonPanel.
If the argument someOtherButtonOrNil is nil, the button is
added upFront.

o  addHelpButtonFor: pathToHelpText
add a help button to the buttonPanel.
The argument, pathToHelpText should specify the path to the help
text under either the doc/online/<language> or the help/<language>
directory.

o  addOK: checkBlock

o  addOkButton
create an okButton - to be sent from redefined initialize
methods in subclasses or when creating a box programmatically.
Returns the button.

o  addOkButton: aButton
add an already created okButton - to be sent from redefined initialize
methods in subclasses or when creating a box programmatically.
Returns the button.

o  addOkButtonLabelled: buttonLabel
create an okButton with a label - to be sent from redefined initialize
methods in subclasses or when creating a box programmatically.
A nil argument creates one with the default text.
Returns the button.

construction-check & comboboxes
o  addCheckBox: label on: aModel
create a checkBox with label on aModel and add it.
Returns the box.

o  addCheckBox: label on: aModel tabable: tabable
create a checkBox with label on aModel and add it.
Returns the box.

o  addComboBoxOn: aModel
create a comboBoxView on aModel and add it.
Returns the comboBoxView.

o  addComboBoxOn: aModel tabable: tabable
create a comboBoxView on aModel and add it.
Returns the comboBoxView.

o  addComboListOn: aModel
create a comboListView on aModel and add it.
Returns the comboListView.

o  addComboListOn: aModel tabable: tabable
create a comboListView on aModel and add it.
Returns the comboListView.

construction-inputfields
o  addFilenameInputFieldOn: aModel in: aDirectory tabable: tabable
create a fileName input field on aModel and add it.
Returns the field. This is much like a normal input field,
but supports filename completion.

o  addInputField: aField
add an already created input field.
Returns the field.

o  addInputField: aField tabable: tabable
add an already created input field.
If tabable is true, the field is put into a group, to allow
stepping through the fields with #Cursor/#Return keys.
Returns the field.

o  addInputFieldOn: aModel
create an input field on aModel and add it.
Returns the field.

o  addInputFieldOn: aModel tabable: tabable
create an input field on aModel and add it.
If tabable is false, the field cannot be tabbed into
and return does not close the box.
(pointer must be moved into it).
Returns the field.

o  addLabelledInputField: labelString adjust: labelAdjust on: model tabable: tabable from: leftX to: rightX separateAtX: relativeX
add a label and an inputField side-by-side.
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
The labels string is defined by labelString and adjusted according to labelAdjust.
The inputField gets model as its model.
Return the inputField.

o  addLabelledInputField: labelString adjust: labelAdjust on: model tabable: tabable separateAtX: relativeX
add a label and an inputField side-by-side.
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0.
The labels string is defined by labelString and adjusted according to labelAdjust.
The inputField gets model as its model.
Return the inputField.

construction-layout
o  addGap
VW compatibility

o  addGap: pixels
VW compatibility

o  addHorizontalLine
add a horizontal line as separator

o  addVerticalSpace
add a default vertical space (1 mm)

o  addVerticalSpace: nPixel
add some pixels of space to the next component

o  bottomAlign: widgets
mhmh - seems similar to out stickAtBottom functionality - to be checked

o  bottomAlignLowerEdge: widget
mhmh - seems similar to out stickAtBottom functionality - to be checked

o  leftIndent
return the current indent
(current x position - thats where the next component will be located).

o  leftIndent: aNumber
set the left indent
(current x position - that's where the next component(s) will be located).
Setting this before adding a component will place it indented

o  rightIndent
return the current right indent.

o  rightIndent: aNumber
set the right indent

o  setInitialGap
Created: / 4.2.2000 / 00:01:44 / cg

o  stickAtBottomWithFixHeight: aComponent
arrange for a component to be positioned at a constant offset
from the bottom of the box and its height to remain the same.
This will keep the component at a constant distance from the bottom
(without this setup, it would stay at a constant offset from the top).
ATTENTION: use this as a last step, after all components have been added.

o  stickAtBottomWithFixHeight: aComponent left: left right: right
arrange for a component to be positioned at a constant offset
from the bottom of the box and its height to remain the same.
This will keep the component at a constant distance from the bottom
(without this setup, it would stay at a constant offset from the top).
ATTENTION: use this as a last step, after all components have been added.

o  stickAtBottomWithVariableHeight: aComponent
arrange for a component to be positioned at a constant offset
from the bottom of the box and its height to be adjusted.
This will resize the component for a constant distance from the top,
and the bottom.
(without this setup, its height would remain constant).
ATTENTION: use this as a last step, after all components have been added.

o  yPosition
return the current y position (thats where the next component
will be located).

o  yPosition: aNumber
set the current y position (thats where the next component
will be located).

construction-lists
o  addList: listHolder lines: nLines validation: validateionBlock

o  addListBoxOn: aModel
add a selectionInListView to the box.
The listViews ScrollWrapper is returned

o  addListBoxOn: aModel class: aListViewClass
create & add an instance of aListViewClass to the box.
The listViews ScrollWrapper is returned

o  addListBoxOn: aModel class: aListViewClass withNumberOfLines: numLines
create and add an instance of aListViewClass to the box.
The list has numLines (if nonNil) number of lines shown.
The listViews ScrollWrapper is returned

o  addListBoxOn: aModel class: aListViewClass withNumberOfLines: numLines hScrollable: hs vScrollable: vs
add an instance of aListViewClass (selectionInListView) to the box.
The list has numLines (if nonNil) number of lines shown.
If scrolled, the ScrollWrapper is returned - otherwise the listView.

o  addListBoxOn: aModel withNumberOfLines: numLines
add a selectionInListView to the box.
The list has numLines (if nonNil) number of lines shown.
The listViews ScrollWrapper is returned

o  addListBoxOn: aModel withNumberOfLines: numLines hScrollable: hs vScrollable: vs
add a selectionInListView to the box.
The list has numLines (if nonNil) number of lines shown.
If scrolled, the ScrollWrapper is returned - otherwise the listView.

o  addPopUpList: labelString on: aModel
create a popUpList with a label on aModel and add it.
Returns the box.

o  addPopUpList: labelString on: aModel tabable: tabable
create a popUpList on aModel and add it.
Returns the popUpList.

o  addPopUpListOn: aModel
create a popUpList on aModel and add it.
Returns the box.

o  addPopUpListOn: aModel tabable: tabable
create a popUpList on aModel and add it.
Returns the popUpList.

o  addTextBoxOn: aModel class: aListViewClass withNumberOfLines: numLines hScrollable: hs vScrollable: vs
add an instance of aListViewClass to the box.
The list has numLines (if nonNil) number of lines shown.
If scrolled, the ScrollWrapper is returned - otherwise the listView.

construction-rows & columns
o  addColumn: aRow fromX: leftX toX: rightX collect: aBlock
add some elements in a vertical column.
Equally space elements as returned from aBlock.

o  addColumn: aRow fromX: leftX toX: rightX collect: aBlock tabable: tabable
add some elements in a vertical column.
Equally space elements as returned from aBlock.

o  addColumn: aRow fromX: leftX toX: rightX collect: aBlock tabable: tabable horizontalLayout: hLayout
add some elements in a vertical column.
Equally space elements as returned from aBlock.

o  addRow: aCol fromX: leftX toX: rightX collect: aBlock
add some elements in a horizontal row.
Equally space elements as returned from aBlock.
Advance y.

o  addRow: aCol fromX: leftX toX: rightX collect: aBlock tabable: tabable
add some elements in a horizontal row.
Equally space elements as returned from aBlock.
Advance y.

o  addRow: aCol fromX: leftX toX: rightX collect: aBlock tabable: tabable horizontalLayout: hLayout
add some elements in a horizontal row.
Equally space elements as returned from aBlock.
Advance y.

o  addRow: aCol fromX: leftX toX: rightX collect: aBlock tabable: tabable horizontalLayout: hLayout verticalLayout: vLayout
add some elements in a horizontal row.
Equally space elements as returned from aBlock.
Advance y.

explicit focus control
o  focusOnOk

initialization
o  initialize

o  reAdjustGeometry
sent late in snapin processing - gives me a chance
to resize for changed font dimensions.

private
o  basicAddComponent: aComponent
add a component, dont change its size

o  hideAndEvaluate: aBlock
if I am modal, make myself invisible and evaluate aBlock.
If nonModal, stay up, but also evaluate the block.

o  preOpen
Created: / 4.2.2000 / 00:10:48 / cg

o  realize
if any inputFields where added, activate the first one

o  resize

queries
o  accepted
after the box has closed:
return true if accepted, false if canceled

o  interfaceSpecFor: aSelector
return an interface spec.
Notice - Dialog should be moved under AppModel so this becomes obsolete.

o  maxPreferredWidthOfAddedComponents
helper for computing my preferred extent.
That is the max component width

o  positionOffset
return the delta, by which the box should be displayed
from the mouse pointer. Here, an offset is returned, which
makes the center of the first return-Button in the panel
appear under the cursor. If there is no such button,
use my superclasses offset.

o  preferredExtent
return my preferred extent.
That is the max component width, or my current width (default);
whichever is larger, by the sum of the component's heights.

o  specificationFor: aKey
return an interface specs literal encoding.
Notice - Dialog should be moved under AppModel so this becomes obsolete.

user actions
o  abortPressed
sent by the cancel button; user pressed abort button
- hide myself and evaluate okAction

o  actionArgument

o  closeCancel
closed via escape

o  doAccept
let all components accept (i.e. update their model from the values),
then set my accept value to true.
This is confusing: this method was originally called #accept,
but renamed for compatibility with ST-80, where #accept returns the
accept-valueHolder (which looks like a bad name to me ...).

o  keyPress: aKey x: x y: y
return-key duplicates ok-function if acceptReturnAsOK is true

o  lastFieldLeft
if the dialog involves input fields, this is called
when the last field is left by Return-key or NextField-key

o  okPressed
sent by the okButton; user pressed ok-button
- make myself invisible and if an action was specified do it

o  openDialog


Examples:


historically, DialogBox was used as an abstract class as a base for InfoBox, YesNoBox etc. However, the programmatic construction protocol (#addComponent:) now allows those classes to be easily replaced and future versions of ST/X may do this and make those subclasses obsolete. However, dummy stubs will remain to exist for backward compatibility (i.e. do not fear using YesNoBox, EnterBox etc.) For most simple standard dialogs, there are ready to use methods in the class protocol. For example: info & warnings:


    Dialog information:'hi there'


    Dialog warn:'oops'
yes/no questions:


    (Dialog confirm:'is this simple ?')
    ifTrue:[
        Transcript showCR:'thats what I expected'
    ] ifFalse:[
        Transcript showCR:'read more examples and documentation'
    ]
yes/no question with cancel option:


    |answer|

    answer := Dialog confirmWithCancel:'is this simple ?'.
    answer isNil ifTrue:[
        Transcript showCR:'no easy decision'
    ] ifFalse:[
        answer ifTrue:[
            Transcript showCR:'thats what I expected'
        ] ifFalse:[
            Transcript showCR:'read more examples and documentation'
        ]
    ]
asking for a string:


    |s|

    s := Dialog request:'enter your name, please:'.
    s notEmpty ifTrue:[
        Transcript showCR:'you entered: ' , s.
    ]
asking for a string with given default:


    |s|

    s := Dialog 
            request:'enter your name, please:'
            initialAnswer:(OperatingSystem getLoginName).
    s notEmpty ifTrue:[
        Transcript showCR:'you entered: ' , s.
    ]
asking for a filename:


    |s|

    s := Dialog 
            requestFileName:'select a file, please:'
            default:''.
    Transcript show:'you entered: '; showCR:s.
with a namefiler pattern:


    |s|

    s := Dialog 
            requestFileName:'select a file, please:'
            default:''
            pattern:'*.rc'.
    Transcript show:'you entered: '; showCR:s.
another namefiler pattern:


    |s|

    s := Dialog 
            requestFileName:'select a file, please:'
            default:''
            pattern:'*.rc;*.st;*.h'.
    Transcript show:'you entered: '; showCR:s.
with changed button label and pattern:


    |s|

    s := Dialog 
            requestFileName:'select a file, please:'
            default:''
            ok:'show'
            abort:'cancel'
            pattern:'*.rc'.
    Transcript show:'you entered: '; showCR:s.
asking for a password:


    |s|

    s := Dialog 
            requestPassword:'enter your secret, please:'.
    Transcript show:'you entered: '; showCR:s.
multiple choice dialogs:


    Dialog 
       choose:'choose any' 
       fromList:nil
       values:nil
       buttons:#('one' 'two' 'three' 'four') 
       values:#(1 2 3 4) 
       lines:nil
       cancel:nil
multiple choice dialog, with list & buttons:


     Transcript showCR:(
         Dialog 
            choose:'choose example' 
            fromList:#('one' 'two' 'three' 'four') 
            values:#(1 2 3 4) 
            buttons:#('five' 'six' 'seven')
            values:#(5 6 7)
            lines:4
            cancel:[Transcript flash. #aborted]
     )
You can (and often have to) construct custom dialogs programmatically, from individual components. As shown in the following examples: basic (unusable) example:


    DialogBox new open
still unusable - only an ok-button:


    DialogBox new addOkButton; open
both ok- and abortButtons:


    DialogBox new addAbortButton; addOkButton; open
with different ok-label:


    DialogBox new addAbortButton; addOkButtonLabelled:'yeah'; open
adding a (centered by default) textlabel gives an infoBox:


    DialogBox new
        addTextLabel:'hello';
        addOkButton; 
        open
a textlabel with abort- and okButton gives a yesNoBox:


    DialogBox new
        addTextLabel:'hello';
        addAbortButton; 
        addOkButton; 
        open
the same, adjusting the labels contents to the left:


    |box|

    box := DialogBox new.
    (box addTextLabel:'hello') adjust:#left.
    box addAbortButton; 
        addOkButton; 
        open
with modified buttons:


    |box|

    box := DialogBox new.
    (box addTextLabel:'are you certain ?') adjust:#left.
    box addAbortButtonLabelled:'not really'. 
    (box addOkButtonLabelled:'yes, absolutely') 
            activeBackgroundColor:Color red. 
    box open
mswindows style (different up/down bitmaps in buttons): ((try tabbing ...)


    |b box|

    box := DialogBox new.
    (box addTextLabel:'are you certain ?') adjust:#left.
    b := Button new.
    b activeLogo:(Image fromFile:'cancel_down.bmp' inPackage:'stx:goodies/bitmaps/winImages').
    b passiveLogo:(Image fromFile:'cancel_up.bmp' inPackage:'stx:goodies/bitmaps/winImages').
    b focusLogo:(Image fromFile:'cancel_focus.bmp' inPackage:'stx:goodies/bitmaps/winImages').
    b beImageButton.
    box addAbortButton:b.

    b := Button new.
    b activeLogo:(Image fromFile:'ok_down.bmp' inPackage:'stx:goodies/bitmaps/winImages').
    b passiveLogo:(Image fromFile:'ok_up.bmp' inPackage:'stx:goodies/bitmaps/winImages').
    b focusLogo:(Image fromFile:'ok_focus.bmp' inPackage:'stx:goodies/bitmaps/winImages').
    b beImageButton.
    box addOkButton:b.
    box open
two textlabels:


    DialogBox new
        addTextLabel:'hello';
        addTextLabel:'world';
        addAbortButton; 
        addOkButton; 
        open
fixing the dialogs size (suppres it calculating its size from the preferredExtents of its components):


    DialogBox new
        label:'a simple dialog';
        addTextLabel:'hello';
        addAbortButton; 
        addOkButton; 
        extent:200@200;
        sizeFixed:true;
        open
asking the box if it was closed via ok:


    (DialogBox new
        label:'a simple dialog';
        addTextLabel:'hello';
        addAbortButton; 
        addOkButton; 
        extent:200@200;
        sizeFixed:true;
        open
    ) accepted ifTrue:[
        Transcript showCR:'yes'
    ] ifFalse:[
        Transcript showCR:'no'
    ]
textLabels are not limited to strings (although, the name which is used for ST-80 compatibility, suggests it):


    DialogBox new
        addTextLabel:(Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages');
        addOkButton; 
        open


    DialogBox new
        addTextLabel:'hello';
        addTextLabel:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages')
                            magnifiedTo:200@150);
        addTextLabel:'world';
        addAbortButton; 
        addOkButton; 
        open
adding an input field (on a string model):


    |stringModel|

    stringModel := '' asValue.
    (DialogBox new
        addTextLabel:'Please enter a string:';
        addInputFieldOn:stringModel; 
        addAbortButton; 
        addOkButton; 
        open
    ) accepted ifTrue:[
        Transcript showCR:'entered: ', stringModel value
    ]
multiple input fields (notice, that the dialog connects the fields in a group, so stepping is allowed via Cursor and Return keys):


    |firstName lastName|

    firstName := '' asValue.
    lastName := '' asValue.
    (DialogBox new
        addTextLabel:'Please enter your name:';
        addInputFieldOn:firstName; 
        addVerticalSpace;
        addInputFieldOn:lastName; 
        addAbortButton; 
        addOkButton; 
        open
    ) accepted ifTrue:[
        Transcript showCR:'entered: ', firstName value , ' ' , lastName value
    ]
of course, the model may contain a value initially:


    |firstName lastName p line i name|

    firstName := '' asValue.
    lastName := '' asValue.
    p := PipeStream readingFrom:'finger ' , OperatingSystem getLoginName.
    p notNil ifTrue:[
        line := p nextLine.
        (i := line findString:'Name:') ~~ 0 ifTrue:[
            name := line copyFrom:(i + 'Name:' size).
        ] ifFalse:[
            (i := line findString:'real life:') == 0 ifTrue:[
                line := p nextLine.
            ].
            (i := line findString:'real life:') ~~ 0 ifTrue:[
                name := line copyFrom:(i + 'real life:' size).
            ]
        ].
        name notNil ifTrue:[
            firstName value: name asCollectionOfWords first.
            lastName  value: name asCollectionOfWords last.
            Transcript showCR:'initially ' , firstName value , ' ' , lastName value.
        ].
        p close.
    ].

    (DialogBox new
        addTextLabel:'Please enter your name:';
        addInputFieldOn:firstName; 
        addVerticalSpace;
        addInputFieldOn:lastName; 
        addAbortButton; 
        addOkButton;
        open
    ) accepted ifTrue:[
        Transcript showCR:'entered: ', firstName value , ' ' , lastName value
    ]
validated password entry:


    |box firstEntry secondEntry|

    firstEntry := '' asValue.
    secondEntry := '' asValue.

    box := DialogBox new.
    (box addTextLabel:'Please enter your secret:') adjust:#left.
    (box addInputFieldOn:firstEntry) passwordCharacter:$*. 
    box addVerticalSpace.
    (box addInputFieldOn:secondEntry) passwordCharacter:$*. 
    box addAbortButton. 
    box addOkButton. 
    box open.
    box accepted ifTrue:[
        firstEntry value ~= secondEntry value ifTrue:[
            Transcript showCR:'wrong input - try again'
        ] ifFalse:[
            Transcript showCR:'entered: ', firstEntry value
        ]
    ]
input fields with a label:


    |box firstNameHolder middleNameHolder lastNameHolder|

    firstNameHolder := 'John' asValue.
    middleNameHolder := 'F' asValue.
    lastNameHolder := 'Peters' asValue.

    box := DialogBox new.
    box 
        addLabelledInputField:'first name:'
        adjust:#right
        on:firstNameHolder
        tabable:true
        separateAtX:0.4.

    box 
        addLabelledInputField:'middle initial:'
        adjust:#right
        on:middleNameHolder
        tabable:true
        separateAtX:0.4.

    box 
        addLabelledInputField:'last name:'
        adjust:#right
        on:lastNameHolder
        tabable:true
        separateAtX:0.4.

    box addOkButton.
    box open.
constructing a dialog from other elements: adding a fileSelectionList: (since the dialog adds the component with its preferred extent, ignoring the 300-height, this looks ugly ... ... especially when resized vertically)


    |top l scr fileName|

    fileName := '' asValue.

    top := DialogBox new.

    l := FileSelectionList new.
    l useIndex:false.
    l doubleClickAction:[:name | top okPressed].
    l action:[:name | fileName value:name].
    scr := ScrollableView forView:l.
    scr extent:(1.0 @ 300).

    top addComponent:scr.
    top addAbortButton; addOkButton.
    top openModal.

    top accepted ifTrue:[
        Transcript show:'fileName: '; showCR:fileName value storeString.
    ]
same, looks better, since the height is made larger (not using fileLists preferredExtent):


    |top l scr fileName|

    fileName := '' asValue.

    top := DialogBox new.

    l := FileSelectionList new.
    l useIndex:false.
    l doubleClickAction:[:name | top okPressed].
    l action:[:name | fileName value:name].
    scr := ScrollableView forView:l.

    top addComponent:scr withExtent:300@300.
    top addAbortButton; addOkButton.
    top openModal.

    top accepted ifTrue:[
        Transcript show:'fileName: '; showCR:fileName value storeString.
    ]
again, setting the boxes initial size and fixing it (let it ignore the components' preferredExtent):


    |top fixFrame l scr fileName|

    fileName := '' asValue.

    top := DialogBox new.
    top extent:300@300.

    fixFrame := View new.
    fixFrame extent:(1.0 @ 300).

    l := FileSelectionList new.
    l useIndex:false.
    l doubleClickAction:[:name | top okPressed].
    l action:[:name | fileName value:name].
    scr := ScrollableView forView:l.
    scr origin:0.0@0.0 corner:1.0@1.0.
    fixFrame add:scr.

    top addComponent:fixFrame.
    top addAbortButton; addOkButton.
    top openModal.

    top accepted ifTrue:[
        Transcript show:'fileName: '; showCR:fileName value storeString.
    ]
adding a panel with checkBoxes:


    |top panel b value1 value2 value3 value4|

    value1 := true asValue.
    value2 := false asValue.
    value3 := false asValue.
    value4 := true asValue.

    top := DialogBox new.
    top extent:200@300.

    panel := VerticalPanelView new.

    b := CheckBox on:value1. b label:'check1'.
    panel addSubView:b.

    b := CheckBox on:value2. b label:'check2'.
    panel addSubView:b.

    b := CheckBox on:value3. b label:'check3'.
    panel addSubView:b.

    b := CheckBox on:value4. b label:'check4'.
    panel addSubView:b.

    top addComponent:panel.
    top addAbortButton; addOkButton.
    top open.

    top accepted ifTrue:[
        Transcript show:'value1: '; showCR:value1 value.
        Transcript show:'value2: '; showCR:value2 value.
        Transcript show:'value3: '; showCR:value3 value.
        Transcript show:'value4: '; showCR:value4 value.
    ]
same, using a more convenient interface:


    |box value1 value2 value3 value4|

    value1 := true asValue.
    value2 := false asValue.
    value3 := false asValue.
    value4 := true asValue.

    box := DialogBox new.
    box extent:200@300.

    box addCheckBox:'check1' on:value1.
    box addVerticalSpace.
    box addCheckBox:'check2' on:value2.
    box addVerticalSpace.
    box addCheckBox:'check3' on:value3.
    box addVerticalSpace.
    box addCheckBox:'check4' on:value4.

    box addAbortButton; addOkButton.
    box open.

    box accepted ifTrue:[
        Transcript show:'value1: '; showCR:value1 value.
        Transcript show:'value2: '; showCR:value2 value.
        Transcript show:'value3: '; showCR:value3 value.
        Transcript show:'value4: '; showCR:value4 value.
    ]
same, using an even better interface:


    |box values labels|

    values := #(true false false true) collect:[:val | val asValue].
    labels := #('check1' 'check2' 'check3' 'check4').

    box := Dialog new.

    box
       addColumn:(1 to:labels size)
       fromX:0.0
       toX:1.0 
       collect:[:index | CheckBox label:(labels at:index) model:(values at:index)]
       tabable:true.
    
    box addAbortButton; addOkButton.
    box open.

    box accepted ifTrue:[
       values with:labels do:[:val :lbl |
          Transcript show:(lbl , ': '); showCR:val value.
       ]
    ]
adding two panels in a frame:


    |box frame vPanel1 vPanel2 m1 m2 m3 m4 chk ef|

    box := Dialog new.
    box label:'example'.

    frame := FramedBox label:'frame'.

    vPanel1 := VerticalPanelView origin:0.0@0.0 corner:0.5@1.0 in:frame.
    vPanel1 horizontalLayout:#leftSpace.
    vPanel1 verticalLayout:#spreadSpace.

    vPanel2 := VerticalPanelView origin:0.5@0.0 corner:1.0@1.0 in:frame.
    vPanel2 horizontalLayout:#leftSpace.
    vPanel2 verticalLayout:#spreadSpace.

    m1 := true asValue.
    m2 := true asValue.
    m3 := true asValue.
    m4 := 'hello' asValue.

    vPanel1 add:(Label label:'check1').
    vPanel1 add:(Label label:'m2').
    vPanel1 add:(Label label:'m3').
    vPanel1 add:(Label label:'enter').
    vPanel1 add:(Label label:'lbl1').
    vPanel1 add:(Label label:'lbl2').

    vPanel2 add:(chk := CheckToggle on:m1). 
    box makeTabable:chk.

    vPanel2 add:(chk := CheckToggle on:m2). 
    box makeTabable:chk.

    vPanel2 add:(chk := CheckToggle on:m3). 
    box makeTabable:chk.

    vPanel2 add:(chk := CheckToggle on:m3). 
    box makeTabable:chk.

    vPanel2 add:(chk := CheckToggle on:m3). 
    box makeTabable:chk.

    vPanel2 add:(ef := EditField on:m4). 
    ef immediateAccept:true.
    box makeTabable:ef.

    box addComponent:frame.

    box addAbortButton; addOkButton.
    box openModal.
    box accepted ifTrue:[
        Transcript showCR:'accepted with:'.
        Transcript showCR:'   m1: ' , m1 value printString.
        Transcript showCR:'   m2: ' , m2 value printString.
        Transcript showCR:'   m3: ' , m3 value printString.
        Transcript showCR:'   m4: ' , m4 value printString.
    ]
a full example (combined settings dialog - as in launcher):


    |box warnSTX allowUnderscore immutableArrays logDoits
     listOfLanguages listOfStyles styleNames 
     frame panel c resourceDir dir |

    warnSTX := Compiler warnSTXSpecials asValue.
    allowUnderscore := Compiler allowUnderscoreInIdentifier asValue.
    immutableArrays := Compiler arraysAreImmutable asValue.

    logDoits := Smalltalk logDoits asValue.

    listOfLanguages := SelectionInList with:#('english'
                                              'french'
                                              'german'
                                              'italian'
                                              'spanish'
                                             ).
    listOfLanguages selection:(Language asString).


    resourceDir := Smalltalk getSystemFileName:'resources'.
    dir := FileDirectory directoryNamed:resourceDir.

    styleNames := dir select:[:aFileName | aFileName endsWith:'.style'].
    styleNames := styleNames collect:[:aFileName | aFileName copyWithoutLast:6].
    listOfStyles := SelectionInList with:styleNames sort.
    listOfStyles selection:(View defaultStyle asString).

    box := Dialog new.
    box label:'Settings'.

    frame := FramedBox label:'Compiler'.
    panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
    panel horizontalLayout:#leftSpace.

    panel add:((CheckBox on:warnSTX) label:'warn about ST/X language extensions'; resize).
    panel add:((CheckBox on:allowUnderscore) label:'allow underscore in identifiers'; resize).
    panel add:((CheckBox on:immutableArrays) label:'literal arrays are immutable'; resize).
    box addComponent:frame.

    frame := FramedBox label:'Misc'.
    panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
    panel horizontalLayout:#leftSpace.

    panel add:((CheckBox on:logDoits) label:'log doIts in changes file'; resize).
    box addComponent:frame.

    frame := FramedBox label:'Language'.
    panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
    panel horizontalLayout:#leftSpace.

    panel add:((PopUpList on:listOfLanguages) width:0.5).
    box addComponent:frame.

    frame := FramedBox label:'Style'.
    panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame.
    panel horizontalLayout:#leftSpace.

    panel add:((PopUpList on:listOfStyles) width:0.5).
    box addComponent:frame.

    box addAbortButton; addOkButton.
    box showAtPointer.

    box accepted ifTrue:[
        Transcript topView withCursor:Cursor wait do:[
            Compiler warnSTXSpecials:warnSTX value.
            Compiler allowUnderscoreInIdentifier:allowUnderscore value.
            Compiler arraysAreImmutable:immutableArrays value.

            Smalltalk logDoits:logDoits value.

            Transcript showCR:'change language to ' , listOfLanguages selection , ' ...'.
            Smalltalk at:#Language put:listOfLanguages selection asSymbol.
            Smalltalk changed:#Language.
            ResourcePack flushCachedResourcePacks.

            Transcript showCR:'change style to ' , listOfStyles selection , ' ...'.
            View defaultStyle:listOfStyles selection asSymbol.
        ]
    ]
an example from Hopkins/Horan:


    |aText index|

    aText := 'Smalltalk/X: An Introduction to Application Development' asText.
    index := aText findString:'Smalltalk/X' startingAt:1.
    aText emphasizeFrom:index 
                     to:'Smalltalk/X' size + index - 1
                   with:#bold.
    index := aText findString:'Introduction' startingAt:index.
    aText emphasizeFrom:index 
                     to:'Introduction' size + index - 1
                   with:#italic.
    Dialog warn:aText        
    
the same, with colors:


    |aText index|

    aText := 'Smalltalk/X: An Introduction to Application Development' asText.
    index := aText findString:'Smalltalk/X' startingAt:1.
    aText emphasizeFrom:index 
                     to:'Smalltalk/X' size + index - 1
                   with:(Array with:#bold with:#underline with:(#color->Color red)).
    index := aText findString:'Introduction' startingAt:index.
    aText emphasizeFrom:index 
                     to:'Introduction' size + index - 1
                   with:#italic.
    Dialog warn:aText        


ST/X 6.1.1; WebServer 1.620 at exept:8081; Thu, 09 Feb 2012 01:51:02 GMT