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>@ id ... get</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
@ ID ... GET
Use a GET-like edit control in a dialog
------------------------------------------------------------------------------

Syntax
#include "windows.ch"
#include "topclass.ch"   --or--   #define  NO_C4WCLASS
#include "commands.ch"
@ ID  <nId>  GET <var>
     [ PICTURE <pic> ]
     [ VALID <valid> ]
     [ WHEN <when> ]
     [ <clauses> ]

Arguments
<var> is the variable to receive the user's input.  You should
initialise this variable before using the @ ID ... GET
command.

PICTURE <pic> can be used to specify a Clipper picture.

VALID <valid> can be used as in a Clipper GET, but note the
comments in the generic @ ID ... <ControlType> command (e.g.
it can be checked many times, and should not prompt the user).

WHEN <when> specifies a logical expression or a code block
returning a logical value, to be checked when the control is
given the input focus.

See the generic @ ID ... <ControlType> command for details of
the <clauses> and/or parameters allowed.

Description
This command lets you use an edit control with behaviour similar
to a Clipper GET in a dialog.  There is also the @ ID ... EDIT
command, for those occasions where you want a normal Windows edit
control and don't need a picture.

Because you need to make sure the <var> is initialised before
using @ ID ... GET, the TEXT (or INITIAL) clause is not really
useful with this command.

Common styles include ES_AUTOHSCROLL, WS_BORDER and
WS_TABSTOP.

See the generic @ ID ... <ControlType> command for more
information.

Example
// From SOURCE\OO\DBFGEN.PRG:
CLASS DBFDialog INHERIT WDialog
     EXPORT    cLen, cDec AS STRING
     PROTECT   oLen, oDec AS OBJECT
     // . . .
     METHOD Type(cType)                                    ;
            INLINE // . . .
                   ::cDec  := "0",                         ;
                   ::oDec:UpdateBuffer()
     // . . .
ENDCLASS

METHOD OnInitDialog() CLASS DBFDialog
::cLen    = "20"
::cDec    = "0"
// . . .
@ Id IDD_LEN  Obj ::oLen  Get ::cLen  Picture "999"  Valid val(::cLen) != 0
@ Id IDD_DEC  Obj ::oDec  Get ::cDec  Picture "9"


See Also: @ ID ... @ ID ... GET @ ID ... MULTILINE EDIT

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