Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>appenddialog()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
AppendDialog()
Appends a new item to a dialog
------------------------------------------------------------------------------

Syntax
AppendDialog( <aDlg>, <cnId>, <cnDlgClass>, <nStyle>,
     <nX>, <nY>, <nWidth>, <nHeight>, <cText> )   -->  aDlg

Arguments
<aDlg> is an array used to describe the dialog.  It must have
been obtained originally from CreateDialog().

<cnId> is a character string or a number identifying the item
being added to the dialog.  Any string or number convenient to
the application may be used.  The same string can be used with
GetDialogResult() to retrieve the final value of the dialog item.
Note: if you plan to use a code block with ModalDialog(), use all
numeric id's here.

<cnDlgClass> is a string or number that identifies the class
of the dialog item being appended (one of the DLG_* values from
WINDOWS.CH, or the name of a control class).

<nStyle> is the window style to use (a combination of the WS_*
values from WINDOWS.CH).  Depending on the value of
<cnDlgClass>, other values may also be specified.  See below
for details.

<nX>, <nY> specify the position of the top left-hand corner of
the dialog item relative to the top-left of the whole dialog.

<nWidth>, <nHeight> specify the size of the dialog item being
appended.

<cText> is an optional string to associate with the new dialog
item.  Where appropriate (e.g. in push buttons), the character
"&" placed in front of another character causes the second
character to be underlined and made available as an
accelerator character (one the user can use with the ALT key
to select the item).

Returns
An array of information about the dialog, which may be passed
to the related functions AppendDialog(), GetDialogResult()
and ModalDialog().  This array should not be altered or
examined, and is subject to change in future versions of Clip-4-Win.

Description
This function is used to add a new item to an existing dialog,
which may be displayed using ModalDialog().

The <nStyle> values that may be used depend on the <cnDlgClass>
value as follows:
     <cnDlgClass>    <nStyle>  Comments

     DLG_STATIC     SS_*      static text (can't be altered or selected)

     DLG_BUTTON     BS_*      button style, e.g. check box

     DLG_EDIT       ES_*      edit box style, e.g. left-justify

     DLG_LISTBOX    LBS_*     list box style

     DLG_COMBOBOX   CBS_*     combo box style

Example
// Also see the files LISTBOX.PRG and DIALOG.PRG
aDlg = CreateDialog("Sample Dialog",                   ;
              WS_CAPTION +  WS_SYSMENU                 ;
              + WS_GROUP + WS_TABSTOP                  ;
              + WS_THICKFRAME + WS_VISIBLE             ;
              + WS_POPUP,       24, 12, 180, 160)

aDlg = AppendDialog(aDlg, "ckbox", DLG_BUTTON,         ;
              BS_CHECKBOX + WS_TABSTOP + WS_CHILD      ;
              + WS_VISIBLE,                            ;
              60, 90, 45, 12,                          ;
              "&Check box")

aDlg = AppendDialog(aDlg, "ok", DLG_BUTTON,            ;
              BS_DEFPUSHBUTTON + WS_TABSTOP            ;
              + WS_CHILD + WS_VISIBLE,                 ;
              136, 112, 24, 14,                        ;
              "&Ok")

// Hitting ESCAPE returns 0, in case you want to try it...
?  You chose item", i := ModalDialog(aDlg, hInst, hWnd)


See Also: CreateDialog() GetDialogResult() ModalDialog()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson