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>create dialog</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CREATE DIALOG
Create a dialog
------------------------------------------------------------------------------

Syntax
#include "windows.ch"
#include "topclass.ch"   --or--   #define  NO_C4WCLASS
#include "commands.ch"
CREATE DIALOG <oDlg> | <aDlg>
     [ CLASS <class> ]
     [ TITLE <cTitle> ]
     [ AT [CHAR] <x>, <y> ]  [ SIZE <w>, <h> ]
     [ STYLE <nStyle> ]
     [ VBX ]
     [ FONTNAME <cFace> ]  [ POINTSIZE <nPt> ]
     [ IN  [ DIALOG | WINDOW ] <oParent> ]

OR:

CREATE DIALOG <aDlg>
     RESOURCE <cnId>
     [ VBX ]
     [ INSTANCE <hInst> ]

Arguments
<oDlg> | <aDlg> specifies the variable to receive either the
dialog object (if OO) or a dialog structure (an array) (if
NO_C4WCLASS is defined).

CLASS <class> can be used to specify the class used for
<oWnd>.  For a non-OO application, this is the window class
name (default "C4W").  For an OO application, <class>
specifies the OO class (which determines the window class
name).  The default is WSDIWindow (non-MDI) or WMDIFrame (for
an MDI application).

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

AT [CHAR] <x>, <y>  specify the starting co-ordinates in
pixels (or pseudo rows/cols, if AT CHAR is specified).

SIZE <w>, <h>  specify the width and height in pixels (or
pseudo rows/cols, if AT CHAR is specified).

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

VBX must be specified if the dialog uses any VBX controls.

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.

RESOURCE <cnId>  is the dialog's resource id.

INSTANCE <hInst>  is the module (an application or DLL) handle
containing the resources.

Description
This command can be used to create a dialog in either a non-OO
application (by defining NO_C4WCLASS) or an OO application.
Usually, you leave out nearly all the clauses.  Some depend on
whether OO is being used - refer to COMMANDS.CH for details.
A number of clauses may be ignored, to make it easier to
convert from non-OO to OO.

Example
CREATE DIALOG oDlg RESOURCE "VBXDemoDlg" VBX

@ ID IDC_SPIN1 VBX IN oDlg                                             ;
    ON SpinUp   {|hDlg| SetDlgItemText(hDlg, IDC_VALUE, str(++nSpin))} ;
    ON SpinDown {|hDlg| SetDlgItemText(hDlg, IDC_VALUE, str(--nSpin))}

@ ID IDC_CHANGE_ORIENTATION BUTTON ChangeOrientation IN oDlg

@ ID IDC_VALUE SAY str(nSpin) IN oDlg

SHOW DIALOG oDlg IN oWnd


See Also: @ ID CREATE WINDOW SHOW DIALOG

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