Chapter 3. PlainBaseDialog, PlainUserDialog, Base Mixin Classes

Table of Contents
PlainUserDialog Class
WindowBase Mixin Class
WindowExtensions Mixin Class

PlainBaseDialog is the base class of all dialog classes in the ooDialog framework. It implements methods that are common to every dialog. PlainBaseDialog should be considered an abstract class. Although, a programmer could instantiate a new PlainBaseDialog object, the class does not implement all the methods that are needed to execute a dialog. Therefore, not much can be done with a simple PlainBaseDialog object. The ooDialog programmer uses subclasses of PlainBaseDialog to actually create and execute a real dialog.

The PlainBaseDialog inherits from the WindowBase mixin class. The WindowBase mixin class implements methods that are common to all windows. Since both dialogs and dialog controls are windows, the DialogControl class also inherits from WindowBase.

The PlainUserDialog class subclasses from PlainBaseDialog class and provides all the methods that normally are required to execute a dialog that is either created dynamically or loaded from a resource script (.RC). Its purpose is to provide a simpler class that can be used for ordinary user interfaces, like the standard dialogs. The ooDialog programmer can subclass from the PlainUserDialog to produce straighforward, uncomplicated user interfaces.

The more advanced dialog classes, ResDialog, RcDialog, UserDialog, subclass the BaseDialog class. The BaseDialog class subclasses PlainBaseDialog, and like PlainBaseDialog should be considered an abstract class. BaseDialog inherits from the WindowExtensions and DialogExtensions mixin classes. These classes implement methods that cover asynchronous dialog execution, scroll bar support, resizing and repositioning, bitmaps, graphics (device context related methods), scrolling text, and menus (action bars). The ResDialog, RcDialog, UserDialog classes, and their subclasses, allow the programmer to produce very sophisticated graphical user interfaces.

Historically, the reason for providing the simpler PlainUserDialog class was to have a smaller package that required less system resources for ordinary user interfaces like the standard dialogs. That reason is probably not as valid in modern times as it was when ooDialog was being developed to run on Windows 3.1.

PlainUserDialog Class

PlainUserDialog is a limited version of the UserDialog class. Use ::requires "OODPLAIN.CLS" in your script to get access to the PlainUserDialog class.

Note: If you use ::requires "OODWIN32.CLS" you do not need to specify the ::requires "OODIALOG.CLS" directive because OODIALOG.CLS is included from OODWIN32.CLS.

Note: If you use ::requires "OODIALOG.CLS" you do not need to specify the ::requires "OODPLAIN.CLS" directive because OODPLAIN.CLS is included from OODIALOG.CLS.

Attributes

The following list briefly describes the attributes of the PlainUserDialog.

Attributes:

Instances of the PlainUserDialog class have the following attributes:

AutoDetect

Automatic data field detection on (=1, default) or off (=0). For the UserDialog subclass the default is off and Connect... methods or a resource script are usually used.

AutomaticMethods

A queue containing the methods that are started concurrently before the execution of the dialog

ConstDir

A directory string storing the numerical values assigned to symbolic IDs (#define-statements in the resource script)

DataConnection

Protected attribute to store connections between dialog items and the attributes of the dialog instance

DlgHandle

A handle to the dialog

Finished

0 if dialog is executing, 1 if terminated with OK, and 2 if canceled

InitCode

After the Init method has finished executing the value of the attribtute is 0 if no errors were detected during initialization, otherwise its value is non-zero. After instantiating a new dialog object, the InitCode attribute should be checked. If its value is not 0 then there was some problem initializing the object. The programmer should treat this as an error condition and not expect that the underlying Windows dialog can be created successfully.

After the dialog is finished, the attribute will be 1 if the user terminated the dialog with the Ok button. Its value will be 2 if the user canceled the dialog.

UseStem

Protected attribute that is true (=1) if a stem variable was passed to init

Methods

The following table lists all the class methods, attributes, and instance methods of the PlainUserDialog class with links to the full documentation. The individual methods are documented in BaseDialog Class or UserDialog Class.

Table 3-1. PlainUserDialog Class Methods

Item......description
Class MethodLink
getFontName (Class method)getFontName
getFontSize (Class method)getFontSize
setDefaultFont (Class method)setDefaultFont
AttributesLink
fontName (Attribute)fontName
fontSize (Attribute)fontSize
Instance MethodsLink
AddAttributeAddAttribute
addBitmapButtonaddBitmapButton
addBlackFrameaddBlackFrame
addBlackRectaddBlackRect
addButtonaddButton
addButtonGroupaddButtonGroup
addCheckBoxaddCheckBox
addCheckBoxStemaddCheckBoxStem
addCheckGroupaddCheckGroup
addComboBoxaddComboBox
AddComboEntryAddComboEntry
addComboInputaddComboInput
addEntryLineaddEntryLine
addEtchedFrameaddEtchedFrame
addGrayFrameaddGreyFrame
addGrayRectaddGrayRect
addGroupBoxaddGroupBox
addEtchedHorizontaladdEtchedHorizontal
addIconaddIcon
addInputaddInput
addInputGroupaddInputGroup
addInputStemaddInputStem
addListBoxaddListBox
AddListEntryAddListEntry
AddMenuItemAddMenuItem
AddMenuSeparatorAddMenuSeparator
addOkCancelLeftBottomaddOkCancelLeftBottom
addOkCancelLeftTopaddOkCancelLeftTop
addOkCancelRightBottomaddOkCancelRightBottom
addOkCancelRightTopaddOkCancelRightTop
addPasswordLineaddPasswordLine
AddPopupMenuAddPopupMenu
addRadioButtonaddRadioButton
addRadioGroupaddRadioGroup
addRadioStemaddRadioStem
addScrollBaraddScrollBar
addTextaddText
addUserMsgaddUserMsg
addEtchedVerticaladdEtchedVertical
addWhiteFrameaddWhiteFrame
addWhiteRectaddWhiteRect
AutoDetectionAutoDetection
CancelCancel
CenterCenter
ChangeComboEntryChangeComboEntry
ChangeListEntryChangeListEntry
ClearMessagesClearMessages
ComboAddDirectoryComboAddDirectory
ComboDropComboDrop
ConnectButtonConnectButton
ConnectCheckBoxConnectCheckBox
connectComboBoxconnectComboBox
ConnectControlConnectControl
ConnectEntryLineConnectEntryLine
ConnectListConnectList
ConnectListBoxConnectListBox
ConnectListLeftDoubleClickConnectListLeftDoubleClick
ConnectMultiListBoxConnectMultiListBox
ConnectRadioButtonConnectRadioButton
CreateCreate
CreateCenterCreateCenter
CreateMenuCreateMenu
DefineDialogDefineDialog
DeInstallDeInstall
DeleteComboEntryDeleteComboEntry
DeleteListEntryDeleteListEntry
DisableDisable
DisableItemDisableItem
EnableEnable
EnableItemEnableItem
ExecuteExecute
FindComboEntryFindComboEntry
FindListEntryFindListEntry
FocusItemFocusItem
GetGet
GetAttribGetAttrib
GetButtonRectGetButtonRect
GetCheckBoxGetCheckBox
GetComboEntryGetComboEntry
GetComboItemsGetComboItems
GetComboLineGetComboLine
GetCurrentComboIndexGetCurrentComboIndex
GetCurrentListIndexGetCurrentListIndex
GetDataGetData
GetDataStemGetDataStem
GetEntryLineGetEntryLine
getExStyleRawgetExStyleRaw
GetIDGetID
GetItemGetItem
GetListEntryGetListEntry
GetListItemsGetListItems
GetListLineGetListLine
GetMultiListGetMultiList
GetPosGetPos
GetRadioButtonGetRadioButton
GetSizeGetSize
getStyleRawgetStyleRaw
getTextSize (deprecated)getTextSize
getTextSizeDlggetTextSizeDlg
GetValueGetValue
HandleMessagesHandleMessages
HelpHelp
HideHide
HideItemHideItem
HideWindowHideWindow
InitInit
InitAutoDetectionInitAutoDetection
InitDialogInitDialog
InsertComboEntryInsertComboEntry
InsertListEntryInsertListEntry
IsDialogActiveIsDialogActive
ItemTitleItemTitle
LeavingLeaving
ListAddDirectoryListAddDirectory
ListDropListDrop
LoadLoad
LoadFrameLoadFrame
LoadItemsLoadItems
LoadMenuLoadMenu
MoveMove
NoAutoDetectionNoAutoDetection
OKOK
ResizeResize
RunRun
SetAttribSetAttrib
SetCheckBoxSetCheckBox
SetComboLineSetComboLine
SetCurrentComboIndexSetCurrentComboIndex
SetCurrentListIndexSetCurrentListIndex
SetDataSetData
SetDataStemSetDataStem
SetEntryLineSetEntryLine
SetListLineSetListLine
SetListTabulatorsSetListTabulators
SetMenuSetMenu
SetMultiListSetMultiList
SetRadioButtonSetRadioButton
SetStaticTextSetStaticText
SetTitleSetTitle
SetValueSetValue
SetWindowTitleSetWindowTitle
ShowShow
ShowItemShowItem
ShowWindowShowWindow
StartItStartIt
StopItStopIt
TitleTitle
Title=Title=
UpdateUpdate
ValidateValidate