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>init dialog</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INIT DIALOG
Initialise a dialog object dynamically
------------------------------------------------------------------------------

Syntax
#include "windows.ch"
#include "topclass.ch"
#include "commands.ch"
INIT DIALOG <oDlg>
     [ TITLE <cTitle> ]
     [ STYLE <nStyle> ]
     [ AT <x>, <y> ]  [ SIZE <w>, <h> ]
     [ FONTNAME <cFace> ]  [ POINTSIZE <nPt> ]
     [ IN  [ DIALOG | WINDOW ] <oParent> ]

Arguments
<oDlg> specifies the dialog object

TITLE <cTitle>  specifies the title/caption for the dialog.

STYLE <nStyle>  specifies the window style (using the WS_*
values defined in WINDOWS.CH).

AT <x>, <y>  specify the starting co-ordinates in dialog
units.

SIZE <w>, <h>  specify the width and height in dialog units.

FONTNAME <cFace> specifies the name of the font to be used for
the dialog and its controls.

POINTSIZE <nPt> specifies the size of the font for the dialog
and its controls.

IN [ DIALOG | WINDOW ] <oParent>  specifies the parent (owner)
of the dialog.

Description
This command can be used to initialise a dialog in an OO
application.  It is only intended to be used in the :Init()
method, to set up a dynamic dialog.

Example
// From SOURCE\USERS\USERSCMD.PRG:
INIT DIALOG self                                            ;
     TITLE "User Details"                                   ;
     STYLE DS_MODALFRAME + WS_POPUP + WS_VISIBLE            ;
           + WS_CAPTION + WS_SYSMENU                        ;
     AT 20,20 SIZE 183,127

@ ID IDD_TUSERID   SAY  "User &ID:"                 AT 7,2   SIZE 50,8
@ Id IDD_USERID    Obj ::oUserID     Get ::cUserID  AT 7,13  SIZE 115,13

// . . .

// buttons: (Ok & Cancel methods can default)

@ ID IDOK      BUTTON          TITLE "&Ok"        AT 132,13  SIZE 37,12
@ ID IDCANCEL  BUTTON          TEXT  "&Cancel"    AT 132,37  SIZE 37,12
@ ID IDD_NEXT  BUTTON Next     TITLE "&Next"      AT 132,61  SIZE 37,12
@ ID IDD_PREV  BUTTON Previous TITLE "&Previous"  AT 132,85  SIZE 37,12
@ ID IDD_SAVE  BUTTON Save     TITLE "&Save"      AT 132,109 SIZE 37,12

::Create()


See Also: @ ID CREATE DIALOG SHOW DIALOG

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