records in a set of Scoped Records
STACK................Display the callstack and optionally edit the source
SUM..................Sum numeric fields in selected database
TAG..................Build or add to a Record Tag Array
TAG CLEAR............Clear the Record Tag Array
UNLOCK...............Unlock the current record
USE..................Open a database file in a work area
USER EDIT............Maintain the DCUSERS.DBF User Database
UTIL.................A menu of database utilities
WHERE PUBLIC.........List .OBJ(s) that contain public function
WHERE SOURCE.........Display a list of .OBJ/.PRG files containing PUBLIC proc
ZAP..................Zap the database
USER-DEFINED COMMANDSCreate a User-Defined object for displaying with GUI reader
DBU..................A Gui Database Management Utility
DCAPICK..............A dialogue for choosing a item from an array pick list.
DCREPORT FORM........A Windows compatible replacement for REPORT FORM
DCTABLE
A command for creating a TABLE in HTML
Syntax:
@ [ < nRow >, < nCol > ] DCTABLE ;
[OBJECT < oTable > ;
[BORDER < nBorder >] ;
[ROWS < nRows >] ;
[COLS,COLUMNS < nCols >] ;
[TRIMROWS] ;
[TRIMCOLS] ;
[FILL < cFill >] ;
[ALIGN < nAlign >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[BGCOLOR < xBGColor > ] ;
[BORDERCOLOR < xBorderColor >] ;
[BORDERCOLORLIGHT < xBorderColorLight >] ;
[BORDERCOLORDARK < xBorderColorDark >] ;
[CELLPADDING < nCellPadding >] ;
[CELLSPACING < nCellSpacing >] ;
[HSPACE < nHspace >] ;
[VALIGN < nValign >] ;
[VSPACE < nVspace >] ;
[WIDTH < cWidth >] ;
[CLASS < cClass >] ;
[CARGO < xCargo >] ;
[PRE,PRETEXT < bcPreHTML >] ;
[POST,POSTTEXT < bcPostHTML >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >]
Arguments:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
OBJECT < oTable > is the name of the variable to assign as a
storage place for this object.
PARENT < oParent > is the name of the variable that was
assigned to the parent of this table. If this argument
is not passed then the parent will be the object set with
the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
TRIMCOLS will suppress writing < td >< /td > column tags
that are empty when at the end of columns.
TRIMROWS will suppress writing < tr >< /tr > column tags that
are empty when at the end of rows.
ROWS < nRows > is the number of rows in the table.
COLS,COLUMNS < nCols > is the number of columns in the table.
HSPACE < nHSpace > is the number of pixels of space on the
outside of the table on both the left and right side.
VSPACE < nVSpace > is the number of pixels of space on the
outside of the table on both the top and bottom.
FILL < cFill > is a character string to put into each table
cell. Any writing to the cells will be appended to the
fill string.
WIDTH < cWidth > is a character string defining the width of
the table. Values may be either an integer--interpreted
as a number of pixels--or a character string defining a
percentage of the horizontal or vertical space. The
value 50% means half the available space while 50 means
50 pixels.
CELLPADDING < nCellPadding > defines the amount of space within table
cells (i.e., between the border and cell contents). The
value may be given as a number of pixels or as a percentage,
though most browsers do not support percentages, treating
"20%" as if it were "20". A percentage value is relative to
the vertical space available for vertical padding or spacing,
and the amount is split evenly between the top and bottom.
Horizontal padding and spacing behave similarly. The padding
or spacing is always applied to all four sides.
CELLSPACING < nCellSpacing > defines the amount of space between
table cells.
Internet explorer lets you alter the colors that make up an
individual cell's border - if border are turned on with the
border attribute. The values for BORDERCOLOR < xBorderColor >,
BORDERCOLORDARK < xBorderColorDark > and
BORDERCOLORLIGHT < xBorderColorLight > may be an RGB color
value (#XXXXXX) , a standard color name, an RGB 3-element
array or a numeric value defined in GRA.CH. The different
colors shade the edges of the border to give it a 3D
appearance with < nBorderColor > shades the central body of
the border.
BORDER < nBorder > specifies the width in pixels of the border
around the table.
ALIGN < nAlign > specifies the default horizontal alignment of
items in the table cells. Possible values are left, right,
and center.
VALIGN < nVAlign > specifies the default vertical alignment of
items in the table cells. Possible values are top, bottom,
and center.
BGCOLOR < xBGColor > specifies the default background color for
the entire table. Value may be an RGB color value (#XXXXXX),
a standard color name, an RGB 3-element array or a numeric
value defined in GRA.CH.
HEADERS < aHeaders > is an array of character strings
containing the headers for each column in the table. The
length of the array should be equivalent to the number of
columns.
FOOTERS < aFooters > is an array of character strings
containing the footers for each column in the table. The
length of the array should be equivalent to the number of
columns.
CLASS < cClass > sets a class name for the table. The class name
is case sensitive. A class is used with style sheets to
give the table a pre-defined appearance.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container of object created by this definition.
PRE,PRETEXT < bcPreHTML > is a character string or a code block
that returns a character string containing any HTML text
that will precede the opening < table > tag in the source
that is written.
POST,POSTTEXT < bcPostHTML > is a character string or a code block
that returns a character string containing any HTML text
that will follow the closing < /table > tag in the source
that is written.
HIDE < bHide > is a code block that is evaluated at the
time the :writeHtml() method is called for the class that
supports this command. If the code block returns a .TRUE.,
then no HTML code will be written.
EVAL < bEval > is a code block that is evaluated after the
object is created in DC_ReadHtml(). A pointer to the
object associated with this command is passed as an
argument to the code block.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETOBJECT() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not used in the HTML output but is simply a description of the
get object which is saved in the GetList.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group.
Description:
The command DCTABLE creates an HTML TABLE definition and
adds the definition to the array named GETLIST which is later
processed by the DC_READHTML() function or by the DCREAD HTML
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD HTML
creates all the DC_Html*() objects from the GetList array
and then invokes the :writeHtml() method of the topmost
parent object to generate the HTML code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all
objects referenced by the GetList array to be released.
Any other HTML element may be inserted into a table by
simply addressing the table element with it's row number
and column number. See example.
Notes:
DCTABLE uses the DC_HtmlTable() class to create the table
object and write the HTML source.
Examples:
/*
This example will build a table with 4 sub-tables.
*/
FUNCTION Xtest()
LOCAL i, j, GetList[0], cHtml, oTable, nTable, aSubTables[2,2]
DCTABLE OBJECT oTable1 ;
ROWS 2 ;
COLUMNS 2 ;
BORDER 5 ;
BORDERCOLOR '#336677' ;
TRIMROWS ;
TRIMCOLS ;
BGCOLOR '#339977'
nTable := 1
FOR i := 1 TO 2
FOR j := 1 TO 2
@ i,j DCTABLE ;
OBJECT aSubTables[i,j] ;
BGCOLOR '#33AA77' ;
ROWS 4 ;
COLUMNS 4 ;
FILL Alltrim(Str(i)) + '/' + Alltrim(Str(j)) ;
PARENT oTable1
@ 1,1 DCSAY '' + Alltrim(Str(nTable++)) + ;
'
' PARENT aSubTables[i,j]
NEXT
NEXT
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN nil
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_html()
dc_readhtml()
dc_htmltable()
OVERVIEW_DUAL_COMM
Dual-Mode Commands
Description:
DUAL-Mode commands have been designed to work in either
TEXT mode or GUI mode. Text mode is selected by calling
DC_GUI(.f.) and GUI mode is selected by calling DC_GUI(.t.).
OVERVIEW_GUI_COMM
GUI commands
Description:
GUI commands are designed to work only in GUI mode. When any of
these commands are used, the dialog reader should be invoked with
the DCREAD GUI command or the DC_ReadGUI() function.
=> (ECHO)
Display the pre-processed output of a DOT PROMPT command
Syntax:
= > < command >
Arguments:
< command > is the command string to translate.
Description:
The =þ> command is used to display the pre-processed output of
commands entered at the dot prompt.
Examples:
. => STACK
DC_CallStack()
. => CLOSE
dbCloseArea()
. => ? K_ESC
Qout( 27 )
See Also:
dc_dot()
@ DC3STATE
Create a 3-STATE object for displaying with the GUI reader
Syntax:
@ < nRow >,< nCol > DC3STATE < uVar > ;
[PROMPT < aVar >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentID >] ;
[MESSAGE < bcMsg > [INTO < oMsg >]] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[HELPCODE < cHelp >] ;
[DATALINK < bLink >] ;
[FONT < bocFont >] ;
[WHEN < bWhen >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[OBJECT < oObject >] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < nCursor >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[VALID < bValid >]
Arguments:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
< nVar > is the variable to GET. This must be a initialized to
a numerical value of 0, 1 or 2. It must not be a macro. < nVar >
is automatically anchored via a Get-Set codeblock created by
DC_GetAnchorCB() unless < nVar > is a custom Get-Set code block.
Macros may be used in a custom Get-Set code block.
OBJECT < oObject > is the variable to use as a container for the
object after it is created by the GUI reader.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
PROMPT < aPrompt > is an array of 3 character strings, one for
each state of the 3-state box, to display immediately to the
right of the 3-state box.
SIZE < nWidth >,< nHeight > is the width and height of the
prompt. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The object
is passed to the code block prior to the object receiving input
focus. This clause behaves similar to the WHEN clause with the
exception that the object is not disabled (grayed out).
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
VALID < bValid > is an optional condition tested during the
execution of the GUI gets by the READ command before a Get
object loses input focus (before it is deactivated). When
the condition returns the value .T. (true), the Get object
loses the input focus. Otherwise, it remains active. < bValid >
is a code block that must return a logical value when it is
evaluated. The Get object is passed to the code block prior
to the Get object losing input focus.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object, except when using
a user-defined Get/Set code block. < bLink > is also
evaluated when DC_GetRefresh() is called unless the < lDataLink >
parameter of DC_GetRefresh() is .FALSE.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the CheckBox object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < nCursor > is an optional mouse pointer to use for this
object. System mouse pointers start with XBPWINDOW_POINTERTYPE_
and are defined in XPB.CH. The default pointer is
XBPWINDOW_POINTERTYPE_POINTER. < nCursor > may also be a resource
ID that points to a Bit-Map that has been compiled with the
resource compiler and linked to the .EXE.
COLOR < bncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. IF < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus.
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus.
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this GET has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
Description:
The command @..DC3STATE creates a new 3-State definitiion
and adds it to the array named GETLIST which is later
processed by the DC_Read*() functions or by the DCREAD *
command. The GETLIST array must be first declared and
initialized to the value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DC3STATE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCTABPAGE.
Notes:
The 3-state object created by @ DC3STATE is an object of the
DC_Xbp3State() class which inherits from Xbp3State(), therefore
it can be manipulated with any iVar or method supported by
Xbp3State().
Examples:
#include "dcdialog.ch"
FUNCTION Xtest()
LOCAL GetList := {}, aForSale, nForSale := 0, oMsgBox
aForSale := { 'Not for Sale','For Sale','Not Sure' }
@ 2,2 DC3STATE nForSale PROMPT aForSale ;
SIZE 12 ;
TABSTOP ;
MESSAGE 'Is this article FOR SALE?' INTO oMsgBox ;
TITLE '3-STATE - For Sale?' ;
ID 'FOR_SALE'
@ 4,2 DCMESSAGEBOX OBJECT oMsgBox SIZE 20,1
DCREAD GUI FIT ADDBUTTONS
RETURN nil
Source/Library:
DCDIALOG.CH
@ DCAPPCRT
Create an APPLICATION CRT object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCAPPCRT < oCrt > ;
[SIZE < nHeight > [,< nWidth >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[CAPTION < cCaption >] ;
[BORDER < nB >] ;
[FONT < bocFont >] ;
[FONTSIZE < nFW >,< nFH >] ;
[ACTION < bAction >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[CARGO < xCargo >] ;
[THREAD < oThread >] ;
[HIDE < bHide >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[PIXEL] ;
[RELATIVE < oRel >]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGET OPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< oCrt > is a local memory variable that will be used to store
the reference to the CRT object.
SIZE < nHeight > ,< nWidth > are the number of rows and
columns. The default is 25 rows by 80 columns.
PARENT < oParent > is the name of the variable that was
assigned to the parent TABPAGE or GROUP for this CRT Object.
Only use this command if you are placing this Browse onto
another dialogue object. If this argument is not passed then
the parent will be the object set with the DCSETPARENT command. .
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
CAPTION < cCaption > is the title to display in the title
line of the CRT window.
BORDER < nB > defines the border type of a CRT window. Constants
defined in the XBP.CH file can be assigned to this instance
variable. The following table shows the valid #define constants
for BORDER .
Constants for border types
Constant Description
-------------------------- ---------------------------
XBPDLG_NO_BORDER No border
XBPDLG_SIZEBORDER Window is sizeable
XBPDLG_THINBORDER *) Thin border, window size
can not be changed
XBPDLG_DLGBORDER Thick border, window size
can not be changed
XBPDLG_RAISEDBORDERTHICK **) Thick, raised border
XBPDLG_RAISEDBORDERTHIN *) Thin, raised border
XBPDLG_RECESSEDBORDERTHICK Thick, recessed border
XBPDLG_RECESSEDBORDERTHIN *) Thin, recessed border
XBPDLG_RAISEDBORDERTHICK_FIXED Thick, raised border,
size can not be changed
XBPDLG_RAISEDBORDERTHIN_FIXED *) Thin, raised border,
size can not be changed
XBPDLG_RECESSEDBORDERTHICK_FIXED Thick, recessed border,
size can not be changed
XBPDLG_RECESSEDBORDERTHIN_FIXED *) Thin, recessed border,
size can not be changed
*) not supported by Windows **) Default border
FONT < cFont > sets the font for the text based display of
characters in the CRT window. < cFont > is a character expression
specifying the name of the font. The default value is
"Alaska CRT". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
If the requested font is not available, the font that provides
the "best fit" is installed.
FONTSIZE < nFW >,< nFH > is the Width and Height of the font.
< nFW > sets the width of characters output in text mode (such as
output by QOut() or @... SAY). The default value is 8. The font
width multiplied by the number of columns :maxCol+1 determines the
width of the CRT window on the screen. The calculation is
< nFW > * (:maxCol+1) == :xSize . The translation of text mode column
coordinates to graphic x coordinates is done using < nFW >.
< nFH > is used to set the font height for characters output in the
text mode (such as output by QOut() or @... SAY). The default
value is 16. The font height is multiplied by the number of
rows :maxRow+1 to determine the height of the CRT window on the
screen. The calculation used is < nFH > * (:maxRow + 1) == :ySize.
Translating row coordinates in the text mode to graphic y
coordinates is also performed using < nFH >.
NOTE: < nFW > and < nFH > are used to select a font with the
corresponding character width and height. This is done by the
methods :create() and :configure() . If the corresponding font is
not available, the font that provides the "best fit" is installed.
ACTION < bAction > is the program to run in the CRT window when
it is brought into focus. If the program is to be run in
another thread, then the THREAD < oThread > option must be used
to start the application immediately in a new thread. < oThread >
is the name of a local variable to store a reference to the
thread object.
COLOR < bncFgC >,< ncBgC >] is a default color to clear the CRT
application screen. The color string must conform to the colors
supported by SetColor().
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the < oCrt >:cargo exported variable, however
it will not be stored in the same manner it is entered. The
:cargo container of DCDIALOG objects is an array of at least
two elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - The value of < xCargo >.
[3] and up - optional values added by the GUI reader.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nRow >, < nCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
Description:
The command @..DCAPPCRT creates a new Application CRT object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
A DCAPPCRT object is based on the XbpCrt class which is the GUI
dialog used for applications partially programmed in text mode.
An XbpCrt object provides a dialog window for text based and
graphic oriented screen output. Using XbpCrt objects,
applications programmed for text mode can be transitioned into
pure PM applications in a stepwise. manner. An XbpCrt object
can display text output using functions such as QOut() or
DispOut() and can display Get data entry fields
(command @... SAY... GET). They can also include graphic dialog
elements such as those provided by objects of the XbpPushButton
and XbpMLE classes. XbpCrt objects create what are called
"hybrid" applications because they combine text and graphic
oriented screen output.
The DCAPPCRT object offers a straightforward way to transition
existing text mode applications into GUI applications which use
the eXPress++ dialog system. An existing CA-Clipper application
can run in an XbpCrt window after being compiled with Xbase++.
The program code can be changed to use Xbase Parts that provide
graphic dialog elements step by step as time permits.
@..DCAPPCRT objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The browse object created by @ DCAPPCRT is an object of the
XbpCrt() class, therefore it can be manipulated with
any iVar or method supported by XbpCrt().
Source/Library:
DCDIALOG.CH
@ DCBROWSE
Create a BROWSE object for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCBROWSE < oBrowse > ;
[DATA < xData > [ELEMENT < nElement >] ] ;
[ALIAS < cAlias >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[INTO < aVar >] ;
* [POINTER < nVar >] ;
* [DATALINK < bLink >] ;
* [PRESENTATION < aPres >] ;
* [CURSORMODE < nCursorMode >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[CARGO < xCargo >] ;
* [PIXEL] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[HIDE < bHide >] ;
[WHEN < bWhen >] ;
* [RBSELECT] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[FONT < bocFont >] ;
* [EDIT < nEditEvent > ;
[ MODE < nEditMode >] ;
[ ACTION < bEditAction >] ;
[ EXIT < bEditExit > ] ] ;
* [INSERT < nInsertEvent > ;
[ INSMODE < nInsMode > ] ;
[ DEFAULT < abDefault >] ;
[ ACTION < bInsertAction >] ;
[ EXIT < bInserExit >] ] ;
[ APPEND < nAppendEvent >] [ APPMODE < nAppMode > ] ];
* [DELETE < nDeleteEvent > ;
[ ACTION < bDeleteAction >] ;
[ EXIT < bDeleteExit > ] ] ;
* [HANDLER < handler > [REFERENCE < xRef >]] ;
[RELATIVE < oRel >] ;
* [ITEMMARKED < bItemMarked >] ;
* [ITEMSELECTED < bItemSelected >] ;
* [MARK < nbMark >] ;
* [MKCOLOR < nbMarkEval >, < nMFgC > [,< nMBgC >] ] ;
[ID < cId >] ;
* [FREEZELEFT < aColLeft > ;
* [FREEZERIGHT < aColRight >] ;
* [ACCELKEY < nKey >] ;
* [GOTFOCUS < bGotFocus >] ;
* [LOSTFOCUS < bLostFocus >] ;
* [TABSTOP] ;
* [NOTABSTOP];
* [TABGROUP < nTabGroup >] ;
* [VISIBLE] ;
* [INVISIBLE] ;
[SCOPE] ;
* [THUMBLOCK < nRecords >] ;
* [NOVSCROLL] ;
* [NOHSCROLL] ;
* [NOSOFTTRACK] ;
* [NOSIZECOLS] ;
[GROUP < cGroup >] ;
* [HEADLINES < nHeaderLines > [DELIMITER < cHeadDelim >]] ;
* [FOOTLINES < nFooterLines > [DELIMITER < cFootDelim >]] ;
* [FIT] ;
* [OPTIMIZE] ;
[TITLE < cTitle >] ;
* [AUTOREFRESH < nTimer >] ;
[SORTSCOLOR < anSortedColorFG > [,< anSortedColorBG >] ];
[SORTUCOLOR < anUnSortedColorFG > [,< anUnSortedColorBG >] ] ;
[SORTUPBITMAP < nBitmapSortUp >] ;
[SORTDOWNBITMAP < nBitmapSortDown >] ;
[DESCENDING]
Arguments:
GUI applications:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
< oBrowse > is the name of the variable to assign as a storage
place for this object.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
ALIAS < cAlias > defines the browse as a database browse. < cAlias)
is a variable containing the alias of the database to browse.
or
DATA < aData > defines the browse as an array browse. < aData > is
a variable containing a pointer to the array to browse. ELEMENT
< nElement > is an optional clause defining the selected element of
< aData >. CAUTION: If a new array pointer is created that points
to a different array, then DC_GetBrowArray() must be used to
update the array pointer in the browse object.
SIZE < nWidth >,< nHeight > is the width and height of the
prompt. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers.
INTO < aVar > is a memory variable to store a sub-array. This clause
is used only when browsing arrays. Each time the user clicks on
a new row of the array browse, the sub-array selected will be
stored in < aVar >. < aVar > must be initialized to an array.
POINTER < nVar > is a memory variable to store the current array
element pointer. This clause is used only when browsing arrays.
Each time the user clicks on a new row of the array browse, the
browse row (element number) will be stored in < nVar >. < nVar >
must be initialized to a numeric value.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
DATALINK < bDataLink > is an optional code block to evaluate
whenever the user double-clicks the mouse or presses the ENTER key
within the browse area. The browse object is passed as a
parameter to the code block.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
EDIT < nEditEvent > is an optional clause that enables "cell-editing"
of the browse cells whenever a specified event occurs that is
associated with the browse object. < nEditEvent > is a numeric
value equivalent to an xbe* event or keyboard value which has
been defined in APPEVENT.CH. For example, cell editing will
occur within the selected cell when < nEditEvent > is equal to
xbeBRW_ItemSelected and the cell is selected with a mouse
double-click or the ENTER key is pressed. MODE < nEditMode > is
the navigation mode within the cells. < nEditMode > is a numeric
value from the following table:
< nEditMode > Description
----------- ------------------------------------
DCGUI_BROWSE_EDITEXIT Exit cell editing after ENTER key
DCGUI_BROWSE_EDITACROSS Move to next column after ENTER key
DCGUI_BROWSE_EDITDOWN Move to next row after ENTER key
DCGUI_BROWSE_EDITACROSSDOWN Move to next column after ENTER key
and move to next row at end of column
DCGUI_BROWSE_EDITACROSSDOWN_APPEND
Move to next column after ENTER key
and move to next row at end of column
Pressing ENTER at last row/last column
appends new element. Pressing DOWN
arrow key at last row appends new
element.
< bEditAction > is an optional code block that is evaluated before
the cells are edited. < bEditExit > is an optional code block that
is evaluated after the cells are edited. The browse object is
passed as a parameter to < bEditAction > and < bEditExit >.
INSERT < nInsertEvent > is an optional clause that enables the
inserting of an element into the array and editing the cell
items. < nInsertEvent > is a numeric value equivalent to an xbe*
event or keyboard value which has been defined in APPEVENT.CH.
For example, cell insertion will occur at the selected row of
the browse when < nEditEvent > is equal to xbeK_INS and the browse
is in focus and the INSERT key is pressed. < bInsertAction > is an
optional code block that is evaluated before a new element is
inserted in the array. < bInsertExit > is an optional code block
that is evaluated after exiting the cell editor. The Browse
Object is passed as a parameter when evaluating < bInsertAction >
and < bInsertExit >. INSMODE < nInsMode > is an additional optional
clause that can only be used with the INSERT clause. < nInsMode >
determines the behavior of insert mode.
< nInsMode > Description
----------- ------------------------------------
DCGUI_BROWSE_SUBMODE_1 Up/Down arrow keys are ignored.
Enter key on last column exits insert.
DCGUI_BROWSE_SUBMODE_2 Up/Down arrow key will move to previous
or next row respectively. If down arrow
pressed in last row, will append new
element.
APPEND < nAppendEvent > is an additional optional clause that can
only be used with the INSERT clause. < nAppendEvent > is a numeric
value equivalent to an xbe* event or keyboard value. This event
forces the insertion of the new element at the end of the array
rather than at the selected row. APPMODE < nAppMode > is an
additional optional clause that can only be used with the APPEND
clause. < nAppMode > determines the behavior of append mode.
< nAppMode > Description
----------- ------------------------------------
DCGUI_BROWSE_SUBMODE_1 Up/Down arrow keys are ignored.
Enter key on last column exits append.
DCGUI_BROWSE_SUBMODE_2 Up/Down arrow key will move to previous
or next row respectively. If down arrow
pressed in last row, will append new
element.
DELETE < nDeleteEvent > is an optional clause that enables the
deleting the current selected element (row) of an array or the
currently selected record. < nDeleteEvent > is a numeric value
equivalent to an xbe* event or keyboard value which has been
defined in APPEVENT.CH. For example, cell deletion will occur
at the selected row of the browse when < nEditEvent > is equal to
xbeK_DEL and the browse is in focus and the DELETE key is pressed.
< bDeleteAction > is an optional code-block that is evaluated before
the element is deleted. < bDeleteExit > is an optional code block
that is evaluated after the element is deleted. The Browse Object
is passed as a parameter when evaluating < bDeleteAction > and
< bDeleteExit >.
HANDLER < cEventHandler > is the name of a Function which points
to a custom event handler. The cell editor uses it's own, default
event handler to manage the objects during the running of the
program. The default event handler makes a call to the
custom event handler before processing it's default events.
The custom event handler uses Appevent() to get information
on the current event and passes the following parameters:
1. nEvent - The event type.
2. mp1 - The first event parameter.
3. mp2 - The second event parameter.
4. oXbp - A pointer to the object creating the event.
5. oDlg - A pointer to the main dialogue object.
6. aGetlist - A pointer to the GetList array.
7. aRef - A pointer to an optional Reference array.
The Function should look like this:
STATIC FUNCTION MyHandler ( nEvent, mp1, mp2, oXbp, oDlg,
aGetlist, aRef )
/* custom code */
RETURN DCGUI_NONE
The function must return a numeric value which controls the
behavior of the event loop as follows:
Return Value Behavior
------------ --------------------------------------------
DCGUI_NONE Continue processing the event
DCGUI_IGNORE Ignore event
DCGUI_CLEAR Ignore event and clear all events from queue
DCGUI_EXIT Exit the Cell editor
REFERENCE < aRef > is any array to pass to the custom event handler.
Programming dialogue systems that must manipulate many variables
is much simpler if all the variables are placed into a single
array and then passed to the dialogue system and its event
handler.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Browse object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
these are also generally set using #define constants from the
GRA.CH file.
CURSORMODE < nCursorMode > determines the browse cursor to be
displayed by the Browse object. #define constants from XBP.CH
must be used for this mode:
Constant Description
XBPBRW_CURSOR_NONE No visible cursor
XBPBRW_CURSOR_CELL Cell cursor (default)
XBPBRW_CURSOR_ROW Row cursor
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < bncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. IF < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ITEMMARKED < bItemMarked > is a code block to evaluate when a data
row or a cell is highlighted in the browser. The code block
must be formatted as {| aRowCol, uNIL2, self | ... } where
< aRowCol > is a two-element array { nRowPos, nColPos } which
indicates the row and column position of the cell that is
clicked with the left mouse button.
ITEMSELECTED < bItemSelected > is a code block to evaluate when
a data row is selected with a double-click of the left mouse
button or by pressing the ENTER key in the browser. The code
block must be formatted as {| uNIL1, uNIL2, self | ... }.
MARK < nbMark > is a numeric value or a code block. A numeric
value is used to point to the array sub-element which contains
a logical value. When the mouse is double-clicked in a browse
column (item selected), the value in the sub-element is toggled
between .TRUE. and .FALSE. IF a code block is entered, then
a double-click will evaluate the code block. For example a
code block can be used to toggle the value of a logical field
in the selected record.
MKCOLOR < nbMarkEval > is an optional code block to evaluate
to display "marked" records or array elements. This code block
must return a LOGICAL value. When the value returned is .TRUE.,
the color of the entire row (all columns) is set to the < ncMFgC >
and < ncMBgC > colors. When the value returned is .FALSE., each
column in the row is displayed in the color established for that
individual row.
< ncMFgC >, < ncMBgC > are foreground and background colors that
are selected when < nbMarkEval > evaluates .TRUE. They may be
character strings representing valid text-based colors supported
by SetColor() or they may be numeric constants which begin with
either the prefix GRA_CLR_ or the prefix XBPSYSCLR_ as defined
in GRA.CH or XBP.CH.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
FREEZELEFT < aColsLeft > is an array of numeric values equal to
the position of the columns in the browse which should be frozen
at the left side of the browse window and prevented from
scrolling off the screen.
FREEZERIGHT < aColsRight > is an array of numeric values equal to
the position of the columns in the browse which should be frozen
at the right side of the browse window and prevented from
scrolling off the screen.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. If < bcMsg > is a code-block, it must
return a character string.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
RBSELECT will cause the right button of the mouse to select a
browse cell in the same manner as the left button.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
SCOPE is an optional argument that enables the browse to display only
the records that adhere to a previous scope that has been set by
DC_SetScope(). This feature utilizes the functions DC_dbGoTop(),
DC_dbGoBottom(), DC_dbSkipper(), DC_KeyCount() and DC_KeyNo() in the
navigation code blocks of the browse to stay in scope. In addition, the
vertical scrollbar will accurately show the record position within the
current scope.
If this argument is not used, the browse will utilize dbGoTop(),
dbGoBottom(), dbSkipper(), OrdKeyNo() and a modified RecCount() in the
navigation code blocks of the browse. These functions will disregard any
previous settings of DC_SetScope(). Additional filtering must be
accomplished by using SET FILTER or conditional indexes.
Note: When using the DBFNTX, DBFCDX or FOXCDX drivers,the eXPress++ scoping
system can slow performance therefore it is recommended that you do not use
it on large databases unless you also use the THUMBLOCK clause. The
eXPress++ scoping system has been designed for optimization, however, when
using third-party DBE's such as COMIX and Advantage Server and will
automatically detect that these drivers are being used. SCOPE also utilizes
the percentage method for determining the position of the scrollbar thumb by
using the DC_KeyNo() and DC_KeyCount() functions. If the database contains
more than 32000 records the thumb is scaled to compensate for the limitation
of the XbpScrollbar class to only 32k positions. DC_KeyNo() is enabled with
DC_KeyStat(.T.).
NOTE: If DC_KeyStat() is set to .FALSE. or a Filter is set on the
database, DC_KeyCount() will return a -1 thereby causing
the vertical scrollbar thumb to occupy the entire scroll
area. It is not possible to determine the key count
when a filter is set.
THUMBLOCK < nRecords > should be used on very large databases which are
indexed or on databases that have a filter. This option forces the
thumb to remain locked in the middle of the vertical scrollbar region
to prevent the user from forcing a skip request that can take a very
long time or to move to an incorrect record when a filter is set on
the database. If the database contains more than < nRecords > the
thumb will be locked however the user may still click above and below
the thumb for page up/page down respectively. The default is 32,000
records. NOTE: THUMBLOCK is ignored if the SCOPE clause is not used.
NOVSCROLL will suppress the vertical scroll bar.
NOHSCROLL will suppress the horizontal scroll bar.
NOSOFTTRACK will force movement of the scroll bars to automatically refresh
the browse while the bar is moving.
NOSIZECOLS will prevent the user from sizing columns.
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
HEADLINES < nHeaderLines > is the number of lines (rows) to use
in the column headers. The default is 1. DELIMITER < cHeadDelim >
is the delimiter character(s) which are used to denote the start
of a new line in the HEADER clause of DCBROWSECOL. The default
delimiter is a semi-colon.
Example: DCBROWSECOL HEADER 'Street Address;City/State'
FOOTLINES < nFooterLines > is the number of lines (rows) to use
in the column footers. The default is 1. DELIMITER < cFootDelim >
is the delimiter character(s) which are used to denote the start
of a new line in the FOOTER clause of DCBROWSECOL. The default
delimiter is a semi-colon.
FIT will automatically size the WIDTH of the browse to the sum
of the widths of all the columns. CAUTION: this clause only
overrides the browse width, not the height. The SIZE clause must
still be used to set the browse height and width or a runtime error
will occur.
OPTIMIZE will enable a double-click in the header column to
resize the column to the optimum width so all items will fit in
the column with no truncated items. The OPTIMIZE clause will
only work when browsing an array.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
AUTOREFRESH < nTimer > is used to set a timer event that automatically
refreshes the browse window (when it is visible) every
< nTimer >/100 seconds.
SORTSCOLOR < anSortedColorFG > [,< anSortedColorBG >] is used to set
the color of the column heading that is chosen as the controlling
sort order when click the mouse in the column heading. See the
SORT clause of DCBROWSECOL.
SORTUCOLOR < anUnSortedColorFG > [,< anUnSortedColorBG >] is used to
set the color of the column headings that are not the controlling
sort order.
SORTUPBITMAP < nBitmapSortUp > is used to set the bitmap that is used
in the column header of the sorted column when the controlling
order is "ascending".
SORTDOWNBITMAP < nBitmapSortDown > is used to set the bitmap that is used
in the column header of the sorted column when the controlling
order is "descending".
DESCENDING is used to set the controlling sort order to descending.
NOTE: The function DC_BrowseSort() is used to set the defaults
for the SORT* clauses.
Description:
The command @..DCBROWSE creates a new Browse definition and
adds it to the array named GETLIST which is later processed
by the DC_Read*() functions or by the DCREAD * commands.
The GETLIST array must be first declared and initialized to
the value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
A DCBROWSE object is a parent to DCBROWSECOL objects (the
columns of the browse). DCBROWSE is used to browse either
arrays or databases.
@..DCSAY..GET objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON, @..DCTABPAGE, @..DCTABLE or @..DCHTML*.
Notes:
Gui Applications :
The browse object created by @ DCBROWSE is an object of the
DC_XbpBrowse() class which inherits from the XbpBrowse()
class, therefore it can be manipulated with any iVar or
method supported by XbpBrowse().
The browse navigation system for arrays looks like this.
oXbp:skipBlock := {|n,o| SkipArray( n, o:cargo ) }
oXbp:goTopBlock := {|o| o:cargo[4] := 1 }
oXbp:goBottomBlock := {|o| o:cargo[4] := Len( o:cargo[5] ) }
oXbp:posBlock := {|o| o:cargo[4] }
oXbp:phyPosBlock := {|o| o:cargo[4] }
oXbp:lastPosBlock := {|o| Len( o:cargo[5] ) }
oXbp:firstPosBlock := {|| 1 }
The :cargo instance variable contains an array of pointers,
VALID, HIDE, WHEN and FREEZE information. When installing a custom
"skipper" system, use :cargo[3] as a complete cargo sub-system.
Here is the standard CARGO convention for all objects created by
DC_ReadGUI():
:cargo[1] is a pointer to the GetList number
:cargo[2] is a pointer to the Getlist array
:cargo[3] is USER-DEFINED cargo
:cargo[4] and up are reserved.
All custom skipper methods should use pointers in cargo[3]. A
custom skipper system would be installed after the objects were
created by DC_ReadGUI(). This can be accomplished by using the
EVAL clause in the DCREAD GUI command to call a user-defined
function.
Example:
oXbp:cargo[3] := Array(2)
oXbp:skipBlock := {|n,o| MySkipArray( n, o:cargo ) }
oXbp:goTopBlock := {|o| o:cargo[3,1] := 1 }
oXbp:goBottomBlock := {|o| o:cargo[3,1] := Len( o:cargo[3,2] ) }
oXbp:posBlock := {|o| o:cargo[3,1] }
oXbp:phyPosBlock := {|o| o:cargo[3,1] }
oXbp:lastPosBlock := {|o| Len( o:cargo[3,2] ) }
oXbp:firstPosBlock := {|| 1 }
/* ---------------------- */
STATIC FUNCTION MySkipArray( nWantSkip, aCargo )
LOCAL nDidSkip, nLastRec := Len( aCargo[3,2] )
IF aCargo[3,1] + nWantSkip <þ 1 // "BoF"
nDidSkip := 1 - aCargo[3,1]
ELSEIF aCargo[3,1] + nWantSkip þ> nLastRec // "EoF"
nDidSkip := nLastRec - aCargo[3,1]
ELSE
nDidSkip := nWantSkip
ENDIF
aCargo[3,1] += nDidSkip
RETURN nDidSkip
/* ------------------------- */
CAUTION: When overloading the Skipper system, you must also
overload the :itemSelected instance variable. The
default codeblock for :itemSelected refers to array
elements in :cargo which have been previously set-up
to work with the default Skipper. If the :cargo array
is modified, then a double-click on a browse column
will cause a runtime error.
------------------------------
HTML Applications :
The browse object created by @ DCBROWSE is an object of the
DC_HtmlBrowse() class.
Examples:
/*
This example demonstrates both a database browse and an
array browse in the same dialogue screen. The database
browse is on Tab Page 1 and the Array browse (directory
listing) is on Tab Page 2.
*/
#include "dcdialog.ch"
#include "xbp.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, GetOptions, oTabPage1, oTabPage2, ;
oBrowse, cAlias, aDirectory, oDirectory
USE COLLECT NEW SHARED
/* ---- Tab Page #1 ---- */
@ 3,3 DCTABPAGE oTabPage1 CAPTION 'Browse' ;
SIZE 60,12
cAlias := "COLLECT"
@ 2,2 DCBROWSE oBrowse PARENT oTabPage1 ;
DATA cAlias SIZE 55,9 FREEZELEFT { 1, 2 }
DCBROWSECOL FIELD COLLECT->descrip ;
HEADER "Description" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->type ;
HEADER "Type" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->sub_type ;
HEADER "SubType" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->location ;
HEADER "Location" PARENT oBrowse
DCBROWSECOL DATA {|a|a:={'Yes','No','Not Sure'},a[COLLECT->for_sale+1]} ;
HEADER "For Sale?" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->date_orig ;
HEADER "Orig Date" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->date_acqu ;
HEADER "Acqu Date" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->orig_price ;
HEADER "Acqu Price" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->appr_value ;
HEADER "Appr Value" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->condition ;
HEADER "Condition" PARENT oBrowse
DCBROWSECOL DATA {||IIF(COLLECT->original,'Yes','No')} ;
HEADER "Orig Owner?" PARENT oBrowse
/* ---- Tab Page #2 ---- */
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Directory' ;
RELATIVE oTabPage1
aDirectory := Directory()
@ 2,2 DCBROWSE oDirectory PARENT oTabPage2 ;
DATA aDirectory SIZE 55,9
DCBROWSECOL ELEMENT 1 HEADER "Name" PARENT oDirectory WIDTH 10
DCBROWSECOL ELEMENT 2 HEADER "Size" PARENT oDirectory WIDTH 8
DCBROWSECOL ELEMENT 3 HEADER "Date" PARENT oDirectory WIDTH 8
DCBROWSECOL ELEMENT 4 HEADER "Time" PARENT oDirectory WIDTH 8
DCREAD GUI ;
TITLE "My COLLECTION" ;
FIT ;
ADDBUTTONS ;
EVAL {||oBrowse:hide(), oBrowse:show()}
RETURN
/*
This example demonstrates an array browse with source
written to HTML.
*/
FUNCTION XTest2()
LOCAL i, j, GetList[0], cHtml, oBrowse, aDir := Directory()
@ 0,0 DCBROWSE oBrowse SIZE 4,10 DATA aDir
DCBROWSECOL ELEMENT 1 HEADER 'File Name' PARENT oBrowse
DCBROWSECOL ELEMENT 2 HEADER 'File Size' PARENT oBrowse
DCBROWSECOL ELEMENT 3 HEADER 'File Date' PARENT oBrowse
DCBROWSECOL ELEMENT 4 HEADER 'File Time' PARENT oBrowse
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DCBROWSECOL
dc_getbrowarray()
dc_browserow()
dc_htmlbrowse()
@ DCCHECKBOX
Create a CHECKBOX object for displaying with GUI reader
Syntax:
@ < nGetRow >,< nGetCol > DCCHECKBOX < uVar > ;
[DELIMVAR < cDelim >] ;
[PROMPT < bcPrompt >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[DATALINK < bLink >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[CARGO < xCargo >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[FONT < bocFont >] ;
[SIZE < nWidth >,< nHeight >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[OBJECT < oObject >] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval,... >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >]
Arguments:
GUI applications:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
< lVar > is the variable to GET. This must be a initialized to
a logical value. It must not be a macro. The < lVar > is
automatically anchored via a Get-Set codeblock created by
DC_GetAnchorCB() unless < lVar > is a custom Get-Set code block.
Macros may be used in a custom Get-Set code block.
OBJECT < oObject > is the variable to use as a container for the
object after it is created by the GUI reader.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
DELIMVAR < cDelim > is for text-based screens only and is
ignored when DC_GUI() is .TRUE. This is a three character
sequence to use for the checkbox - the default is (*).
PROMPT < bcPrompt > is the prompt to display immediately to
the right of the checkbox. It may be a character string or a
code block that returns a character string.
SIZE < nWidth >,< nHeight > is the width and height of the
prompt. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object except when using
a user-defined Get/Set code block. < bLink > is also
evaluated when DC_GetRefresh() is called unless the < lDataLink >
parameter of DC_GetRefresh() is .FALSE.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the CheckBox object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. IF < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
Description:
The command @..DCCHECKBOX creates a new Check Box definition
and it to the array named GETLIST which is later processed by
the DC_Read*() functions or by the DCREAD * commands. The
GETLIST array must be first declared and initialized to the
value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all
objects referenced by the GetList array to be released.
@..DCCHECKBOX objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCTABLE, @..DCPUSHBUTTON or @..DCTABPAGE.
Notes:
GUI Applications :
The checkbox object created by @ DCCHECKBOX is an object of the
DC_XbpCheckBox() class which inherits from the XbpCheckBox()
class, therefore it can be manipulated with any iVar or method
supported by XbpCheckBox().
--------------------
HTML Applications :
The checkbox object created by @ DCCHECKBOX is an object
of the DC_HtmlCheckBox() class.
Examples:
/* (Simple Check Boxes in GUI) */
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL lDict := .f., lSource := .t., lBackup := .f., ;
lPack := .t., GetList := {}
@ 5,10 DCCHECKBOX lDict PROMPT 'Save to Dictionary'
@ 5,40 DCCHECKBOX lSource PROMPT 'Save to Source Code'
@ 7,10 DCCHECKBOX lBackUp PROMPT 'Make a Backup file'
@ 7,40 DCCHECKBOX lPack PROMPT 'Pack the File'
DCREAD GUI FIT ADDBUTTONS
RETURN
/* Simple Checkboxes in HTML */
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oForm, cHtml, oTable, lCheck1, lCheck2, lCheck3
DCFORM OBJECT oForm
DCTABLE OBJECT oTable PARENT oForm ROWS 3 COLUMNS 1
lCheck1 := .t.
lCheck2 := .f.
lCheck3 := .f.
@ 1,1 DCCHECKBOX lCheck1 PROMPT 'Check me first' PARENT oTable
@ 2,1 DCCHECKBOX lCheck2 PROMPT 'Check me second' PARENT oTable
@ 3,1 DCCHECKBOX lCheck3 PROMPT 'Check me third' PARENT oTable
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCDIALOG.CH I
See Also:
dc_htmlcheckbox()
dc_readgui()
dc_readhtml()
DCREAD GUI
DCREAD HTML
@ DCCOMBOBOX
Create a COMBOBOX object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCCOMBOBOX < uOutVar > LIST < aVar > ;
[TYPE < nType >] ;
[SIZE < nGetWidth > [,< nGetHeight >]] ;
[PIXEL] ;
[REFRESH] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[FONT < bocFont >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[VALID < bValid >] ;
[HELPCODE < cHelp >] ;
[PRESENTATION < aPres >] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[DATALINK < bLink >] ;
[OBJECT < oObject >] ;
[RELATIVE < oRel >] ;
[CARGO < xCargo >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >
Arguments:
GUI applications:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE argument is used.
If no parent is assigned, then the parent is the Dialog box.
IF the PIXEL option is set to .TRUE. in DCGETOPTIONS, then
the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
< aVar > is a single-dimensional array of character strings
which is used as the list box of items.
< cOutVar > is the input/output variable. This should be
initialized to a character string. It must not be a macro,
however it may be a code block that contains a macro. The < uVar >
is automatically anchored via a Get-Set codeblock created by
DC_GetAnchorCB() unless < uVar > is a custom Get-Set code block.
TYPE < nType > is a numeric constant which is defined in the XBP.CH
file and are listed in the following table:
Constant Description
XBPCOMBO_SIMPLE List box is always dropped down
XBPCOMBO_DROPDOWN *) List box dropped down via a mouse click
XBPCOMBO_DROPDOWNLIST List box dropped down via a mouse click
and keyboard input in the entry field is
not allowed
*) Default value
SIZE < nWidth >,< nHeight > is the width and height of the
combobox. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers. Note: The height value determines the total
height of the combo box including the pull-down listbox.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
REFRESH will force a refresh of the GetList each time an item is
chosen from the pick-list. Use this clause if other objects in
the GetList contain a WHEN or HIDE clause which is dependent on
the value picked.
OBJECT < oObject > is the variable to use as a container for the
object after it is created by the GUI reader.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. < bcMsg > may be a code block
that returns a character value.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
the object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
VALID < bValid > is an optional condition tested during the
execution of the GUI gets by the READ command before a Get
object loses input focus (before it is deactivated). When
the condition returns the value .T. (true), the Get object
loses the input focus. Otherwise, it remains active. < bValid >
is a code block that must return a logical value when it is
evaluated. The object passed as a parameter to the code block.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this GET has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the ComboBox object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object except when using
a user-defined Get/Set code block. < bLink > is also
evaluated when DC_GetRefresh() is called unless the < lDataLink >
parameter of DC_GetRefresh() is .FALSE.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. IF < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
Description:
The command @..DCCOMBOBOX creates a new Combo Box definition
and adds it to the array named GETLIST which is later
processed by the DC_Read*() functions or by the DCREAD *
commands. The GETLIST array must be first declared and
initialized to the value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCCOMBOBOX objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
GUI Appications :
The combobox object created by @ DCCOMBOBOX is an object of
the DC_XbpComboBox() class which inhertis from XbpComboBox(),
therefore it can be manipulated with any iVar or method
supported by XbpComboBox().
-----------------------------------
HTML Applications :
The combobox object created by @ DCCOMBOBOX is an object of
the DC_HtmlComboBox() class.
Examples:
-- Example 1 (GUI combobox) ---
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL aFields, Getlist := {}, cField
USE Customer
aFields := Array(FCount())
AFields( aFields ) // fill array with field list.
cField := Space(10)
@ 5,10 DCCOMBOBOX cField LIST aFields FONT "10.Courier" ;
SIZE 15,20
DCREAD GUI FIT ADDBUTTONS
RETURN
-- Example 2 (HTML checkboxes) --
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL GetList[0], oForm, cHtml, oTable, aList1, ;
aList2, cVar1, cVar2
DCFORM OBJECT oForm
DCTABLE OBJECT oTable PARENT oForm ROWS 2 COLUMNS 1
cVar1 := Space(10)
cVar2 := Space(12)
aList1 := { 'Men','Women','Dogs','Cats','Mice','Geese','Turkeys' }
aList2 := { 'Democrat','Republican','HandyMan','Doctor','Plumber','Programmer'
}
@ 1,1 DCSAY 'Pick a group' PARENT oTable
@ 1,1 DCCOMBOBOX cVar1 LIST aList1 PARENT oTable
@ 2,1 DCSAY 'Pick a profession' PARENT oTable
@ 2,1 DCCOMBOBOX cVar2 LIST aList2 PARENT oTable
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCDIALOG.CH
See Also:
@ DCLISTBOX
dc_vartolistbox()
dc_readgui()
dc_readhtml()
dc_htmlcombobox()
@ DCCUSTOM
Create a CUSTOM object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCCUSTOM < bCustom > ;
[SIZE < nWidth > [,< nHeight >]] ;
[VAR < uVar >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[CAPTION < cCaption >] ;
[PRESENTATION < aPres >] ;
[TYPE < nType >] ;
[OBJECT < oCustom >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[OPTIONS < aOptions >] ;
[DATALINK < bLink >] ;
[FONT < bocFont >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[HIDE < bHide >] ;
[WHEN < bWhen >] ;
[EDITPROTECT < bProtect >] ;
[VALID < bValid >] ;
[HELPCODE < cHelpCode >] ;
[TOOLTIP < bcToolTip >] ;
[ACTION < bAction >] ;
[CURSOR < naCursor >] ;
[CARGO < xCargo >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval] ;
[PIXEL] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< nRow > is stored in element nGETLIST_STARTROW.
< nCol > is stored in element nGETLIST_STARTCOL.
< bCustom > is a required code block. This is the code block
that is evaluated to create the custom object. It requires
the following form:
{ | < a > | < MyFunc >( < a > ) }
< a > is an array of information that is passed to the custom
function.
Element Type Description
------- ---- ------------------------------------------------
[1] A The GetList array
[2] N The GetList pointer (the element containing this
object).
[3] O The Parent object
[4] A A two element array containing the start column
and start row. The values will be converted to
pixel coordinates.
[5] A A two element array containing the width and
height of the object. The values will be
converted to pixels.
[6] A Optional Presentation Parameters
[7] L A .TRUE. if the object is VISIBLE.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
SIZE < nWidth >, < nHeight > defines the size of the object.
IF the PIXEL option is set to .TRUE. in DCGETOPTIONS, then
the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL in the command.
< nWidth > is stored in element nGETLIST_WIDTH
< nHeight > is stored in element nGETLIST_HEIGHT
VAR < uVar > is an optional memory variable that is used with
this object. It is converted to a code block using the
function DC_GetAnchorCB() and stored in element bGETLIST_VAR.
This code block is usually attached to the :dataLink instance
var of an Xbase Parts object. If < uVar > is a code block, then
it will not be converted by DC_GetAnchorCB(). In this case, it
must be a valid Get-Set code block.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
clause is not used, then the object will be displayed in the
top-level dialogue screen or in the object set with the
DCSETPARENT command. This is converted to a code-block by
the function DC_GetAnchorCB() and is stored in element
oGETLIST_PARENT.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
< oGroup > is the name of the variable to assign as a storage
place for this object. It is converted to a code-block by
the function DC_GetAnchorCB() and is stored in element
oGETLIST_GROUP.
CAPTION < cCaption > is the caption to use with the object
and is stored in element cGETLIST_CAPTION.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file. The array is stored in element
aGETLIST_PRESENTATION.
TYPE < nType > defines the "type" of the object and is stored
in element nGETLIST_TYPE.
OBJECT < oObject > is a local variable to store a reference to
this object. It is converted to a code-block by the function
DC_GetAnchorCB() and is stored in element oGETLIST_OBJECT.
COLOR < cColor > is a text-based color string for the object
that is stored in element cGETLIST_COLOR.
OPTIONS < xOptions > can be any type of variable. It is stored
in element xGETLIST_OPTIONS.
DATALINK is an optional code block that is attached to the
< uVar > via the function DC_GetAnchorCB(). This code block is
evaluated when the :dataLink var is evaluated by an Xbase
Parts object.
FONT < cFont > is a font to use with this object and is stored
in element cGETLIST_FONT. It may be a character string, a font
object or a code block that returns a character string or a font
object to later refresh with DC_GetRefresh().
MESSAGE < cMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
PICTURE < cPict > is a character string specifying formatting
options for the value of < uVar > during display and editing.
It is stored in element cGETLIST_PICTURE.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The code block is stored in element bGETLIST_WHEN.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
VALID < bValid > is an optional condition tested during the
navigation through the dialog objects when an object loses
focus (before it is deactivated). If the condition returns the
value .T. (true), the object loses the input focus, otherwise,
it remains active. < bValid > is a code block that must return a
logical value when it is evaluated. The object is passed to the
code block prior to the object losing input focus. The
code block is stored in element bGETLIST_VALID.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this object has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help. The help code is
stored in element cGETLIST_HELPCODE.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
< xCargo > is stored in element xGETLIST_CARGO.
ACTION < bAction > is a code-block to be used with objects
that execute an action, like push-buttons. This code block
is stored in element bGETLIST_ACTION.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
Description:
The command DCCUSTOM is used to create a reference to a
custom object and adds it to the array named GETLIST which is
later processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
DCCUSTOM is used add a reference to a "custom" object. This
command is used when there is a requirement to use a custom
class or to manipulate an Xbase Parts class in a manner that
is not currently supported by the DCDIALOG system. The
DCCUSTOM command allows the programmer to combine any type
of dialog object with stand DC* objects using a common dialog
management system. Think of DCCUSTOM as an "extend" system
for the eXPress++ dialog system.
Notes:
Another method of creating "custom" eXPress++ commands is to
create "User-Defined Commands" which operate on the GetList
system and are processed by DC_ReadGUI().
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oBanner, bCustom, oTabPage
@ 3,3 DCTABPAGE oTabPage CAPTION 'Banner' SIZE 70, 10
bCustom := {|a,b,c,d,e|DemoBanner(a,b,c,d,e)}
@ 4,5 DCSAY 'Move the mouse across the banner' PARENT oTabPage
@ 5,5 DCCUSTOM bCustom PARENT oTabPage OBJECT oBanner ;
CAPTION 'This is a custom Banner object that scrolls from left to ' + ;
'right and right to left when the mouse is moved across the banner'
;
SIZE 62,2 FONT "20.Helv.Bold" ;
PRESENTATION { { XBP_PP_FGCLR, GRA_CLR_DARKRED }, ;
{ XBP_PP_BGCLR, GRA_CLR_WHITE } }
DCREAD GUI ;
TITLE 'Banner on a Tabpage' ;
FIT ;
ADDBUTTONS
RETURN
/* ---- Custom Class ----------------- */
CLASS XbpBanner FROM XbpStatic
EXPORTED:
VAR ScrollMouseCol // Last Scroll Mouse Column
VAR ScrollType // Scroll Type
VAR ScrollPos // Scroll Position
VAR ScrollCaption // Scroll Caption
VAR ScrollNum // Scroll number
METHOD Init, Create
METHOD Scroll
ENDCLASS
/* ------------------- */
METHOD XbpBanner:Create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::XbpStatic:Create( oParent, oOwner, aPos, aSize, aPP, lVisible )
RETURN self
/* --------------------- */
METHOD XbpBanner:Init( oParent, oOwner, aPos, aSize, aPP, lVisible )
DEFAULT aPP := {}
* initialize base class
::XbpStatic:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
::scrollPos := 1
::scrollType := 1
::scrollCaption := ''
::scrollMouseCol := 0
::scrollNum := 3
::motion := { | aPos | ::Scroll( aPos[1] ) }
RETURN self
/* --------------------- */
METHOD XbpBanner:Scroll( nMouseCol )
::SetCaption( Substr(::scrollCaption,::scrollPos) )
IF nMouseCol > ::scrollMouseCol .AND. ::scrollPos < Len(::scrollCaption)-15
::scrollPos += ::scrollNum
ELSEIF nMouseCol < ::scrollMouseCol .AND. ::scrollPos > 1
::scrollPos -= ::scrollNum
ENDIF
::scrollMouseCol := nMouseCol
RETURN self
/* --------------------- */
STATIC FUNCTION ;
DemoBanner ( GetList, nGetPointer, oParent, aPos, aSize, aLocals )
LOCAL oXbp
oXbp := XbpBanner():new( oParent, , aPos, aSize, ;
GetList[nGetPointer,aGETLIST_PRESENTATION], .t., ;
GetList, nGetPointer )
oXbp:scrollType := Getlist[nGetPointer,nGETLIST_SUBTYPE]
oXbp:scrollCaption := GetList[nGetPointer,cGETLIST_CAPTION]
oXbp:scrollNum := 10
IF !Empty(Getlist[nGetPointer,cGETLIST_FONT])
oXbp:SetFontCompoundName( Getlist[nGetPointer,cGETLIST_FONT] )
ENDIF
oXbp:clipSiblings := .T.
oXbp:caption := oXbp:scrollCaption
oXbp:create()
RETURN oXbp
Source/Library:
DCDIALOG.CH
See Also:
USER-DEFINED COMMANDS
@ DCDIALOG
Create a DIALOG object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCDIALOG < oDialog > ;
[DRAWINGAREA < oDrawingArea >] ;
[FONT < bocFont >] ;
[CAPTION,TITLE < cTitle >] ;
[BITMAP < nBitMap >] ;
[ICON < nIcon >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[PIXEL] ;
[PRESENTATION < aPres >] ;
[CARGO < xCargo >] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[ID < cId >] ;
[MODAL] ;
[VISIBLE] ;
[INVISIBLE] ;
[NOMINBUTTON,NOMINIMIZE] ;
[NOMAXBUTTON,NOMAXIMIZE] ;
[GROUP < cGroup >] ;
[MENU < acMenu > [MSGBOX < oMsgBox >]] ;
[BORDER < nBorder >] ;
[NOTITLEBAR] ;
[NORESIZE] ;
[NOTASKLIST] ;
[MINSIZE < nMinCol >, < nMinRow >] ;
[MAXSIZE < nMaxCol >, < nMaxRow >] ;
[AUTORESIZE] ;
[FIT [FITPAD < nFitPad >]] ;
[SETAPPWINDOW]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< oDialog > is the name of the variable to assign as a storage
place for this object or the drawingArea of this object. If
the DRAWINGAREA < oDrawingArea > clause is used, then < oDrawingArea >
will contain a pointer to XbpDialog():drawingArea and
< oDialog > will contain a point to XbpDialog(). If the
DRAWINGAREA clause is not used, then < oDialog > will contain a
pointer to XbpDialog():drawingArea and the only method for
obtaining a pointer to the XbpDialog() will be via
< oDialog >:setParent().
SIZE < nWidth >,< nHeight > is the width and height of the
prompt. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
CAPTION < cTitle > is the title which is displayed in the title
area of the Dialog window.
BITMAP < nBitmap > is the resource ID of a Bitmap that is linked
into the .EXE. This bitmap will be sized to fill the main dialog
window.
ICON < nIcon > is the resource ID of the ICON to place in the upper
left corner of the dialog window.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Browse object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
ACCELKEY < nKey > is a numeric "hot-key" assignment that will set
focus to the browse object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
MENU < acMenu > is a multi-dimensional array containing an optional
menu to attach to the top of the dialog window. The menu must
conform to the specifications of menus returned by the menu
dictionary system. This may also be a character string of up to
8 characters containing the NAME of the menu. See DC_MenuLoad().
MSGBOX < oMsgBox > is the message box object which will receive
PROMPT messages from the menu when the user navigates throug the
menu.
NOMINBUTTON will suppress the painting of a minimize button on
the dialog window.
NOMAXBUTTON will suppress the painting of a maximize button on
the dialog window.
BORDER < nBorder > defines the border type of the dialog window.
Constants defined in the XBP.CH file can be assigned to < nBorder >.
The following table shows the valid #define constants.
Constant Description
XBPDLG_NO_BORDER No border
XBPDLG_SIZEBORDER Window is sizeable
XBPDLG_THINBORDER *) Thin border, window size
cannot be changed
XBPDLG_DLGBORDER Thick border, window size
cannot be changed
XBPDLG_RAISEDBORDERTHICK **) Thick, raised border
XBPDLG_RAISEDBORDERTHIN *) Thin, raised border
XBPDLG_RECESSEDBORDERTHICK Thick, recessed border
XBPDLG_RECESSEDBORDERTHIN *) Thin, recessed border
XBPDLG_RAISEDBORDERTHICK_FIXED Thick, raised border,
size cannot be changed
XBPDLG_RAISEDBORDERTHIN_FIXED *) Thin, raised border,
size cannot be changed
XBPDLG_RECESSEDBORDERTHICK_FIXED Thick, recessed border,
size cannot be changed
XBPDLG_RECESSEDBORDERTHIN_FIXED *) Thin, recessed border,
size cannot be changed
*) not supported by Windows **) Default border
If a dialog is embedded as MDI client within another dialog,
Windows ignores all border styles except XBPDLG_RAISEDBORDERTHICK
and XBPDLG_RECESSDBORDERTHICK. In all other cases, a border is
displayed for MDI clients that corresponds to
XBPDLG_RAISEDBORDERTHICK.
NOTASKLIST will insure that the dialog window is not placed on
the Windows task bar.
MINSIZE < nMinWidth >, < nMinHeight > is used to establish the
minimum size of the dialog window, in pixels, if the operator
attempts to resize the window. A value of -1 will set the height
or width to the height or width that was automatically set by the
FIT clause of DCREAD GUI.
MAXSIZE < nMaxWidth >, < nMaxHeight > is used to establish the
maximum size of tyhe dialog window, in pixels, if the operator
attempts to resize the window. A value of -1 will set the height
or width to the height or width that was automatically set by the
FIT clause of DCREAD GUI.
NORESIZE will prevent the operator from resizing the dialog
window.
NOTITLEBAR will prevent a titlebar from displaying on the
dialog window. This will also prevent the minimize, maximize,
and close buttons from appearing.
AUTORESIZE is used to automatically resize and reposition all
child objects so they use the real estate of the parent dialog
in the same proportions as the child objects before the parent
was resized. The complete childlist tree is resized. If it
is desired to NOT resize ToolBars and Pushbuttons, then the
:resize callback of the dialog object must be overwritten
rather than using the AUTORESIZE clause as shown:
bReSize := {|a,b,o,x|x := SetAppFocus(), ;
o:drawingArea:hide(), ;
DC_AutoReSize(a,b,o,GetList,.f.), ;
o:drawingArea:show(), ;
SetAppFocus(x) }
@ .. DCDIALOG .. EVAL {|o| o:resize := bReSize }
NOTE: AUTORESIZE will not resize or reposition anything on a
dialog that was painted with a Gra*() function or a DCGRA*
command.
FIT will automatically form the dialog screen to fit comfortably
around the objects within the dialog. This option allows the
programmer to use coordinates on dialog objects for relative
addressing only without worrying about how the objects relate to
the borders of the main dialog. After all the objects are
created, the main dialog borders will be sized to fit the
objects. The amount of dead space padding is set by using the
FITPAD clause. The default is 10 pixels.
SETAPPWINDOW is important for proper modality. If your dialog
calls popup windows in validations, popup buttons, etc. you
will want to insure that the called window is MODAL. If you
use the MODAL clause in the DCREAD GUI command of a popup
window it will not work properly unless the calling window is
the "application window". This is accomplished with the
SETAPPWINDOW clause. When returning from DCREAD GUI the
application window will be restored to the previous setting.
Description:
The command @..DCDIALOG creates a new Dialog object and
adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCDIALOG objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCMULTILINE, etc.
Notes:
The dialog object created by @ DCDIALOG is an object of the
XbpDialog() class, therefore it can be manipulated with
any iVar or method supported by XbpDialog().
Examples:
/*
This example demonstrates both a database browse and an
array browse in the same dialogue screen. The database
browse is on Tab Page 1 and the Array browse (directory
listing) is on Tab Page 2.
*/
#include "dcdialog.ch"
#include "xbp.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, GetOptions, oTabPage1, oTabPage2, ;
oBrowse, cAlias, aDirectory, oDirectory
USE COLLECT NEW SHARED
/* ---- Tab Page #1 ---- */
@ 3,3 DCTABPAGE oTabPage1 CAPTION 'Browse' ;
SIZE 60,12
cAlias := "BASEBALL"
@ 2,2 DCBROWSE oBrowse PARENT oTabPage1 ;
DATA cAlias SIZE 55,9 FREEZELEFT { 1, 2 }
DCBROWSECOL FIELD COLLECT->descrip ;
HEADER "Description" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->type ;
HEADER "Type" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->sub_type ;
HEADER "SubType" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->location ;
HEADER "Location" PARENT oBrowse
DCBROWSECOL DATA {|a|a:={'Yes','No','Not Sure'},a[COLLECT->for_sale+1]} ;
HEADER "For Sale?" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->date_orig ;
HEADER "Orig Date" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->date_acqu ;
HEADER "Acqu Date" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->orig_price ;
HEADER "Acqu Price" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->appr_value ;
HEADER "Appr Value" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->condition ;
HEADER "Condition" PARENT oBrowse
DCBROWSECOL DATA {||IIF(COLLECT->original,'Yes','No')} ;
HEADER "Orig Owner?" PARENT oBrowse
/* ---- Tab Page #2 ---- */
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Directory' ;
RELATIVE oTabPage1
aDirectory := Directory()
@ 2,2 DCBROWSE oDirectory PARENT oTabPage2 ;
DATA aDirectory SIZE 55,9
DCBROWSECOL ELEMENT 1 HEADER "Name" PARENT oDirectory WIDTH 10
DCBROWSECOL ELEMENT 2 HEADER "Size" PARENT oDirectory WIDTH 8
DCBROWSECOL ELEMENT 3 HEADER "Date" PARENT oDirectory WIDTH 8
DCBROWSECOL ELEMENT 4 HEADER "Time" PARENT oDirectory WIDTH 8
DCREAD GUI ;
TITLE "My COLLECTION" ;
FIT ;
ADDBUTTONS ;
EVAL {||oBrowse:hide(), oBrowse:show()}
RETURN
Source/Library:
DCDIALOG.CH
@ DCDIRTREE
Create a DIRECTORY TREE object for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCDIRTREE ;
[DIRS < oDirs > [VAR < cDirVar >] [DATALINK < bDirLink >]] ;
[FILES < oFiles > [VAR < cFileVar >] [DATALINK < bFileLink >]] ;
[PARENT < oParent >] ;
[EXT < ExtList,... >] ;
[COLOR < bfgC > [, < bgC > ]] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[FONT < bocFont >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[DIRSIZE < nDirWidth > [,< nDirHeight >] ;
[DIRPOS < nDirCol >, < nDirRow > ] ;
[FILESIZE < nDirWidth > [,< nDirHeight >] ;
[FILEPOS < nDirCol >, < nDirRow > ] ;
[AVAILDRIVES < cAvailDrives >] ;
[TITLE < title >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[GROUP < cGroup >] ;
[VISIBLE] ;
[INVISIBLE]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
DIRECTORY COMPONENT
DIRS < oDirs > is a local variable name to store the pointer
to the object for the Directory portion of the dialog.
VAR < cDirVar > is a local variable name to store the value
of the directory that is chosen by the user.
DATALINK < bDirLink > is a code block that is evaluated when
a new directory is selected by the user.
FILES COMPONENT
FILES < oFiles > is a local variable name to store the pointer
to the object for the FILES portion of the dialog.
VAR < cFileVar > is a local variable name to store the value
of the file that is chosen by the user.
DATALINK < bFileLink > is a code block that is evaluated when
a new file is selected by the user.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this command if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
EXT < ExtList,... > is a comma-delimited list of file extensions
that will display in a picklist below the FILES portion of the
directory tree dialog. When the user selects one of the
extensions, only files with the chosen extension will be
displayed.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH.
FONT < font > is the name of the font to use for both the
directory and file dialog boxes. It may also be a a character
string, a font object or a code block that returns a character
string or a font object to later refresh with DC_GetRefresh().
SIZE < nWidth >,< nHeight > is the width and height of the
listbox. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers. The DIRECTORY dialog component occupies
60% of the total width and the FILES dialog component occupies
40% of the total width unless a DIRSIZE argument is used.
DIRPOS < nDirCol > and < nDirRow > is the position within the window
of the DIRECTORY component.
DIRSIZE < nDirWidth > and < nDirHeight > is the size of the
DIRECTORY dialog component. If the PIXEL option is set to
.TRUE. in DCGETOPTIONS, then the width is is pixels otherwise
it is in standard text-based numbers. If < nDirWidth > is equal
to or greater than < nWidth > above, then there will be no FILE
COMPONENT displayed.
FILEPOS < nFileCol > and < nFileRow > is the position within the window
of the FILES component.
FILESIZE < nFileWidth > and < nFileHeight > is the size of the
FILES dialog component. If the PIXEL option is set to
.TRUE. in DCGETOPTIONS, then the width is is pixels otherwise
it is in standard text-based numbers.
AVAILDRIVES < cAvailDrives > is a character string containing the
letters of all drives which are available for browsing. For
example the string "CDEHIJK" will prevent the floppy drives
(A and B) from being accessed. The default is all drives.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Tree View objects are created. The FILE object is
passed to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
Description:
The command @..DCDIRTREE creates a new Directory Tree object
and adds the object to the array named GETLIST which is later
processed by the DC_READGGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
DCDIRTREE is a dialog that consists of two parts, a DIRECTORY
component and a FILES component. The directory component
contains a Tree View of the directory and drives of the
computer and the FILES component contains a list of the files
in the selected directory that match the selected wildcard
extension.
@..DCDIRTREE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
The Directory object and File object created by @ DCDIRTREE are
objects of the XbpTreeView() class, therefore they can be manipulated with
any iVar or method supported by XbpTreeView().
Examples:
#include "dcdir.ch"
PROCEDURE XTest( )
LOCAL GetList := {}, oDirs, oFiles, cFileName, ;
oFileName, cDirectory
cFileName := Space(30)
cDirectory := ''
@ 2,1 DCGET cFileName GETSIZE 40 GETOBJECT oFileName
@ 3.5,1 DCDIRTREE ;
DIRS oDirs VAR cDirectory ;
FILES oFiles VAR cFileName DATALINK {||oFileName:SetData()} ;
SIZE 40,10.5 ;
EXT '*.ICO','*.BMP','*.JPG','*.*'
DCREAD GUI ;
TITLE 'eXPress++ Demo Program' ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIR.CH
See Also:
dc_popdir()
@ DCFINDBROWSE
A browse-window find utility that uses AutoSeek
Syntax:
@ [ < nRow >,< nCol > ] DCFINDBROWSE ;
FIELDS < aFields > ;
[PARENT < oParent >] ;
[SIZE < nWidth >, < nHeight >] ;
[TITLE < cTitle >] ;
[AUTOSEEK] ;
[PIXEL] ;
[DATA < acbData >] ;
[POINTER < nPointer >] ;
[EVAL < bEval >] ;
[PRESENTATION < aPres >] ;
[NOHEADERS] ;
[NOHSCROLL] ;
[NOVSCROLL] ;
[EXIT] ;
[SEEKDELAY < nDelay >] ;
[TO < lStatus >] ;
[FONT < cFont >] ;
[LEFTBUTTONSORT] ;
[POPUP < bPopUp >]
Arguments:
FIELDS < aFields > is a multidimensional array that defines the
columns of data to browse.
Element Type Description
------- ----- ---------------------------------------------
[1] B Code Block (ex: {||CUSTOMER- >name})
[2] C Header (ex: "Customer Name")
[3] N Column Width (ex: 10)
[4] C Index Name or Tag (ex: "CUSTNAME")
[5] C Index Prompt (ex: "Customer Name")
[6] C/B Prefix for AutoSeek
[7] B Seek string code block. User input buffer
is passed to this code block and return
value of code block is used for the seek.
ex: {|c|Right(Space(7)+Alltrim(cString),7)}
Note: Only elements 1 and 2 are required.
PARENT < oParent > is the Parent window to paint the objects.
If no parameter is passed a modal window will be created.
< nRow > and < nCol > are the starting coordinates from the top
left of the parent window to paint the objects. These are text
based coordinates which may include decimals. If no parent
parameter is passed, these arguments are not needed.
SIZE < nWidth >, < nHeight > are the width and height of the window
in text-based coordinates. The defaults are 65 columns and
15 rows.
TITLE < cTitle > is the title to display in the titlebar area of the
dialog window.
AUTOSEEK will include a GET for the user to enter keys to seek
automatically. If this argument is not used then only a browse
will be displayed. The prefix value of the selected column is
inserted before the seek string. This may be a code block or
a string. If it is a code block it must return a string when
evaluated.
NOHEADERS will suppress the display of headers and the horizontal
scroll bar in the browse.
PIXEL assumes coordinates are pixel-based, otherwise they are
text-based.
DATA < acbData > is the data source. If it is a code block it
must return an Alias() or an array when evaluated. If it is
an alias the database must already be opened. If it is an
array, the array must be two-dimensional.
POINTER @< nPointer > is a numeric variable (passed by reference)
to store the array element selected when the user double-clicks
on the browse or presses ENTER. Used when browsing arrays only.
EVAL < bEval > is a code block to evaluate after the Browse
object is created and just before invoking the event handler.
The parent dialog object and the browse object are passed as
parameters: {|oDlg,oBrowse|...}
PRESENTATION < aPres > is a two-element array of two subarrays.
The first element is a Presentation Parameters array that
follows the Xbase++ specification for Browse Presentation
parameters. The second element is a two-element array :
{ aHeaderFG, aHeaderBG }
< aHeaderFG > and < aHeaderBG > are the foreground and background
colors of the selected column. This is the column selected by
the user for sorting or selecting an index.
NOHSCROLL will suppress the horizontal scrollbar and not allow
resizing of columns.
NOVSCROLL will suppress the vertical scroll bar.
EXIT exit without destroying the dialog window.
SEEKDELAY < nSeekDelay > is the number of seconds after a key is
pressed to wait before performing the seek. This allows a
string to be typed without performing a seek everytime a key
is pressed. The default is .1 seconds. If < nSeekDelay > is 0
then the seek is not performed until the ENTER key is pressed.
TO < lStatus > is a variable to store a logical value that is
returned by the DC_FindBrowse() function. If the user exits
by selecting an item, < lStatus > will contain a .TRUE. value
otherwise it will be .FALSE.
FONT < cFont > is the Font Compound Name to use for the browse
columns.
LEFTBUTTONSORT will allow the operator to use the left mouse
button on the column headers to select the sort order, otherwise
only the right button will be enabled for sorting and the left
button will allow for sizing the columns.
POPUP < bPopUp > is a code block to evaluate. If this variable is
a code block, a popup button will be placed to the right of the
GET used for entering a seek value. If the user clicks on this
button or presses CTRL-ENTER while in the GET, the code block
will be evaluated. The value in the GET is passed to the code
block and the value returned by the code block is stuffed back
into the GET.
Description:
@ DCFINDBROWSE is a utility command that paints a browse
with user-defined columns and a entry GET for the user to
enter keyboard characters. The keys entered will automatically
seek the selected index and refresh the browse. The user can
click the right mouse button on a column heading to select a
different index. The Up, Down, Page Up, Page Down, Ctrl Page Up,
Ctrl Page Down and Enter keys are all enabled while the user
is in the entry GET to allow the user to navigate the browse
with keys or the mouse or enter keys for seeking.
Examples:
// Example 1 - Popup a Browse with multiple columns and AutoSeek
FUNCTION XTest()
LOCAL GetList := {}, oBrowse, aFields, aHeaders, aPres, nRecord
SET DEFA TO ..\XDOC
USE EXPRESS VIA FOXCDX EXCLUSIVE ALIAS 'XDOC'
SET INDEX TO EXPRESS.CDX
OrdSetFocus('COMMAND')
SET DEFA TO
aFields := {}
DCFINDADDCOL DATA {||XDOC->command} TAG 'COMMAND' PROMPT 'Command' ;
HEADER 'Command' TO aFields
DCFINDADDCOL DATA {||XDOC->short} HEADER 'Short' TO aFields
DCFINDADDCOL DATA {||XDOC->type} HEADER 'Type' TO aFields ;
TAG 'TYPE' PROMPT 'Type'
DCFINDADDCOL DATA {||XDOC->module} HEADER 'Module' TO aFields ;
TAG 'TYPE' PROMPT 'Type' TO aFields
DCFINDADDCOL DATA {||XDOC->see_also} HEADER 'See Also' TO aFields
@ DCFINDBROWSE FIELDS aFields DATA 'XDOC' SIZE 50,10 AUTOSEEK
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
dc_findbrowse()
DCFINDADDCOL
@ DCGET
Create a GET object for displaying with the text/GUI reader
Syntax:
@ < nRow >,< nCol > DCGET < uVar > ;
* [DATALINK < bLink >] ;
[GETCOLOR < bncFgC >,[< ncBgC >] ] ;
* [GETSIZE < nWidth > [,< nHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[VALID < bValid >] ;
[POPUP < bPopUp >] ;
[POPCAPTION < ncaCaption] ;
[POPFONT < cPopFont >] ;
[POPWIDTH < nPopWidth >] ;
[POPHEIGHT < nPopHeight >] ;
[POPSTYLE < nPopStyle >] ;
[POPKEY < anPopKey > ;
[POPTABSTOP] ;
[POPGLOBAL] ] ;
[POPTOOLTIP < bcPopToolTip >] ;
[HELPCODE < cHelp >] ;
* [PICTURE < cPict >] ;
[GETFONT < bocFont >] ;
* [UNREADABLE] ;
* [CONFIRM] ;
* [NOCONFIRM] ;
[HIDE < bHide >] ;
[WHEN < bWhen >] ;
* [EDITPROTECT < bProtect >] ;
* [PIXEL] ;
* [GETPRESENTATION < aPres >] ;
[GETTOOLTIP < bcToolTip >] ;
[GETOBJECT < oObject >] ;
* [CURSOR < naCursor >] ;
[CARGO < xCargo >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[GETID < cId >] ;
[TITLE < cTitle >] ;
* [ACCELKEY < anAccel >] ;
* [GOTFOCUS < bGotFocus >] ;
* [LOSTFOCUS < bLostFocus >] ;
* [TABSTOP] ;
* [NOTABSTOP];
* [TABGROUP < nTabGroup >] ;
* [VISIBLE] ;
* [INVISIBLE] ;
[GROUP < cGroup >] ;
* [KEYBLOCK < bKeyBlock >] ;
* [PROPER [PROPOPTIONS < aPropOptions >]] ;
[COMBO ;
[HEIGHT < nComboHeight >] ;
[DATA < acbComboData >] ;
[FIELD < bField >] ;
[ELEMENT < nElement >] ;
[RETURN < bReturn >] ;
[CAPTION < oncComboCaption >] ;
[FONT < ocComboFont >] ;
[HOTKEY < nComboHotKey >] ] ;
[NAME < cVarName >]
Arguments:
GUI applications:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
< nRow > may be assigned the value DCGUI_ROW. This will paint
the object at the same row as the previous object. It is
provided to emulate the Row() function in text-based applications.
< nCol > may be assigned the value DCGUI_COL + < nOffset >. This
will paint the object immediately to the right of the previous
object plus < nOffset > pixels. It is provided to emulate the Col()
function in text-based applications.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
GET < uVar > is the variable to GET. This may be a variable
of any type except an object or array. It must not be a macro.
The < uVar > is automatically anchored via a Get-Set codeblock
created by DC_GetAnchorCB() unless < uVar > is a custom Get-Set
code block. Macros may be used in a custom Get-Set code block.
OBJECT | GETOBJECT < oObject > is the variable to use as a container
for the object after it is created by the GUI reader.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object except when using
a user-defined Get/Set code block. < bLink > is also
evaluated when DC_GetRefresh() is called unless the < lDataLink >
parameter of DC_GetRefresh() is .FALSE.
CARGO | GETCARGO < xCargo > is any kind of data you wish to to add
to the :cargo container for this object. The cargo may be
accessed at any time via the :cargo exported variable, however
it will not be stored in the same manner it is entered. The
:cargo container of DCDIALOG objects is an array of at least
three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
FONT | GETFONT < cFont > is a character string defining an optional
font. The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
SIZE | GETSIZE < nGetWidth > [,< nGetHeight >]] is the size to
allocate to the GET variable. If the PIXEL option is set to
.TRUE. in DCGETOPTIONS, then the size must be entered in
pixels otherwise it must be entered in standard text
length. If no GETSIZE argument is used, then the get will
be automatically sized to the size established by transforming
the contents of of the get variable to a string to determine
the length of the get. The default font for GETS in
eXpress++ is 12.Courier because this provides the best user
font for data-entry, so it is usually not necessary to use
this option unless you are also using the FONT parameter.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
PICTURE < cPict > is a character string specifying formatting
options for the value of < VarName > during display and editing.
POPUP < bPopUp > will paint a mouse button at the end of the GET
variable on the screen which informs the operator than an
additional picklist will pop-up if the operator single-clicks on
the button or if the operator presses the CTRL-J or CTRL-ENTER
key while the GET has input focus. The code block will be
evaluated when the button is clicked. The following three
parameters are passed to the codeblock :
1. The value in the current GET
2. A pointer to the GET object
3. The reference value established by the REFERENCE clause
The value returned by the code block will be placed back in the
GET. The code block may return an optional array of two
elements rather than a single value to store to the GET. If a
two-element array is returned, the first element must be the
value to store in the GET and the second element must be a
pointer to the object which is to receive focus. This provides
for the ability to force the focus to a different object on a
POPUP other than the GET.
The POPUP clause is used for popups like calendars, calculators,
picklists, etc. The default caption on the button is three dots.
To change the caption or button display options, use the
function DC_GetPopupCaption().
POPCAPTION < ncaCaption > is the optional caption of the button.
This will override the DC_PopupCaption() setting. This will override the
DC_GetPopupCaption() setting. If < ncaCaption > is an array, it
must be an array of 2 elements where the first element is the
bitmap resource number of the caption to display when the GET is
enabled and the second element is the bitmap resource number of
the caption to display when the GET is disabled with the WHEN
clause.
POPFONT < cFont > is the optional font of the button. This will override the
DC_GetPopupCaption() setting.
POPWIDTH < nWidth > is the width (in pixels) of the button. This
will override the default width.
POPHEIGHT < nHeight > is the height (in pixels) of the button.
This will override the default height. POPSTYLE < nStyle > is the
style of the popup button:
POPSTYLE < nStyle > Description
------------------------- ----------------------------------
DCGUI_POPUPSTYLE_OUTSIDE Button is outside and to the right
of the GET.
DCGUI_POPUPSTYLE_IMBEDDED Button is imbedded within the GET.
POPKEY < anPopKey > is a numeric key value or an array of numeric
key values that may be assigned to invoke the popup button when
the key is pressed. An additional POPGLOBAL clause may be used
to establish that the assigned key is active regardless of the
object that is in focus, otherwise the key will be active only
when the associated get has focus. Key values are defined in
APPEVENT.CH and start with the definition xbeK_*.
POPTABSTOP will cause the TABSTOP key to be active on the popup
button so the user may tab from the GET to the popup button.
POPTOOLTIP < bcPopToolTip > is a character string which will display
as a "Tool Tip" next to the popup button the mouse is passed
over the popup button. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
The UNREADABLE clause will cause text to be displayed as asterisks
(*) for inputting sensitive data such as passwords.
The NOCONFIRM clause will cause the GET to be exited when the
cursor reaches the end of the buffer during keyboard entry.
Normally, the GET can be exited only by pressing the ENTER key,
TAB key, UP key, DOWN key or clicked on another object. This
overrides the setting of CONFIRM in DCGETOPTIONS.
The CONFIRM clause will cause the GET to be exited by pressing
the ENTER key. This overrides the setting of NOCONFIRM in
DCGETOPTIONS.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
VALID < bValid > is an optional condition tested during the
execution of the GUI gets by the READ command before a Get
object loses input focus (before it is deactivated). When
the condition returns the value .T. (true), the Get object
loses the input focus. Otherwise, it remains active. < bValid >
is a code block that must return a logical value when it is
evaluated. The object passed as a parameter to the code block.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this GET has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
GETPRESENTATION < aGetPres > is a two-dimensional array. If
specified, this contains presentation parameters for the GET
object. The first column of the array must contain #define
constants from the XBP.CH file starting with the prefix
XBP_PP_. These constants define the presentation parameters
that can be set for the object and include colors and fonts.
The second column of the array in < aSayPres > contains the value
for each setting. These are also generally set using #define
constants from the GRA.CH file.
TOOLTIP | GETTOOLTIP < bcGetToolTip > is a character string which
will display as a "Tool Tip" next to the object when the cursor
is passed over the object. A semi-colon within the text indicates
a new line. If < bcToolTip > is a code-block, it must return a
character string. NOTE: The Tooltip painting method is run in
another thread, therefore the codeblock should not run code that
points to the current work area. It may however, contain local,
public or private variables.
CURSOR | GETCURSOR < naCursor > may be either a numeric value or
an array of 3 elements which defines an optional mouse pointer
to use for this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
COLOR | GETCOLOR < ncFGc >, < ncBGc > are foreground and background
colors. They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
GETID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
KEYBLOCK < bKeyBlock > is a code block to evaluate when a key is
pressed in the GET. The code block should be formatted as follows:
{|mp1,xNil,oXbp|MyFunc(mp1,xNil,oXbp)} where < mp1 > is the
numeric value (defined in APPEVENT.CH) of the key pressed and
oXbp is the GET object.
PROPER will cause the first character of each word to be
capitalized and all other characters to be lower case. The
optional clause PROPOPTIONS designates a two element array
for alternate behavior:
{ lProperLow, cTriggers }
lProperLow - Logical. Force upper case characters to lower case
If not First character in field or following trigger
character.
cTriggers - A list of characters after which a capital is desired.
(ie. " '-1234567890" capitalize after space, apostrophe,
hyphen, or any number)
COMBO is used to create a ComboBox-Style Get with a pull-down
picklist from an array or database. HEIGHT < nComboHeight > is
the Height of the Picklist area in text rows or in pixels if
the PIXEL clause is used. The width of the picklist will be the
same as the width of the Get. DATA < acbComboData > is the data
source of the picklist. < acbComboData > must be a character
string containing the Alias() of the database, a single-dimension
array, a multi-dimensional array or a code-block which returns
an alias or array. FIELD < bField > is a code block containing the
field name of the data to be shown in the picklist (when browsing
a database) or ELEMENT < nElement > is the numeric value of the
column in the array to be shown in the picklist (when browsing an
array). RETURN < bReturn > is a code block to evaluate on return.
If this optional parameter is used, then the return value of the
code block is what is returned to the Get. If the combo picklist
is an array, then the numeric pointer to the element selected
is passed to the code block. NOTE: Use the function
DC_GetComboMode() to set the mouse mode for selecting and item.
(Single click or Double click). CAPTION < oncComboCaption > is used
to set the caption of the dropdown button. FONT < ocComboFont > is
used to set the font of the dropdown button. HOTKEY < nComboHotKey >
is used to set a hotkey to invoke the dropdown when the get has
focus.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
NAME < cVarName > is the variable name to assign to the GET
object (for HTML based applications.)
Description:
The command @..DCSAY...GET creates a new GET definition
and adds it to the array named GETLIST which is later
processed by the DC_Read*() functions or by the DCREAD *
commands. The GETLIST array must be first declared and
initialized to the value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Get object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCSAY..GET works nearly identical to the standard
Xbase++ command @..SAY..GET except for a major difference.
The GetList array has a new structure that supports a more
robust dialog system.
@..DCSAY..GET objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON or @..DCTABPAGE.
Notes:
Clauses marked by an asterisk ( * ) are not supported by
DCREAD HTML or DC_ReadHtml().
------------------
GUI applications:
The GET object created by @ DCSAY..GET is an object of the DC_XbpGet()
class, therefore it can be manipulated with any iVar or method
supported by DC_XbpGet(). DC_XbpGet() is a non-supported class which
is provided with Xbase++ as an example. This class inherits
from the XbpSle() class and the Get() class. It has been modified
to support features required by eXPress++. The source for DC_XbpGet()
is in _DCXBPGT.PRG.
If the CHECKGET option of GETOPTIONS is used, then the GET object
is an object of the DC_XbpCheckBox() class.
-----------------
HTML Applications
The GET object created by @ DCSAY..GET is an object of the
DC_HtmlGet() class.
Examples:
/* Example 1 (Simple Gets - GUI) */
#include "dcdialog.ch"
PROCEDURE Xtest_1()
LOCAL GetList := {}, cLastName := Space(15), cFirstName := Space(15),;
cCompany := Space(25), cStreet := Space(25), cCity := Space(25),;
cState := Space(2), cCountry := Space(20), cPhone := Space(15),;
GetOptions
@ 5,10 DCSAY ' Last Name' GET cLastName
@ 5,40 DCSAY 'First Name' GET cFirstName
@ 7,10 DCSAY ' Company' GET cCompany
@ 8,10 DCSAY ' Street' GET cStreet
@ 9,10 DCSAY ' City' GET cCity
@11,10 DCSAY ' State' GET cState
@11,40 DCSAY ' Country' GET cCountry
@13,10 DCSAY ' Phone' GET cPhone PICT '(999)-999-9999'
DCGETOPTIONS SAYRIGHTJUST
DCREAD GUI ;
FIT ;
ADDBUTTONS ;
OPTIONS GetOptions
RETURN
/* Example 2 (Gets with Whens, Hides, Validations and Pop-ups (GUI)) */
PROCEDURE Xtest_2()
LOCAL GetList := {}, cLastName := Space(15), cFirstName := Space(15),;
cCompany := Space(25), cStreet := Space(25), cCity := Space(25),;
cState := Space(2), cCountry := Space(20), cPhone := Space(15),;
dDate1 := Date(), dDate2 := Date()+1, GetOptions
@ 5,10 DCSAY ' Last Name' GET cLastName ;
VALID {||DC_ReadEmpty(cLastName)}
@ 5,40 DCSAY 'First Name' GET cFirstName ;
VALID {||DC_ReadEmpty(cFirstName)}
@ 7,10 DCSAY ' Company' GET cCompany
@ 8,10 DCSAY ' Street' GET cStreet ;
VALID {||DC_ReadEmpty(cStreet)}
@ 9,10 DCSAY ' City' GET cCity ;
VALID {||DC_ReadEmpty(cCity)}
@11,10 DCSAY ' State' GET cState PICT '@!' ;
VALID {||DC_ReadEmpty(cState)} ;
WHEN {||!Empty(cCity)}
@11,40 DCSAY ' Country' GET cCountry
@13,10 DCSAY ' Phone' GET cPhone PICT '(999)-999-9999'
@15,10 DCSAY 'Start Date' GET dDate1 ;
POPUP {|d|DC_PopDate(d)}
@16,10 DCSAY ' End Date' GET dDate2 ;
HIDE {||dDate1 = Date()}
DCGETOPTIONS SAYRIGHTJUST
DCREAD GUI ;
FIT ;
ADDBUTTONS ;
OPTIONS GetOptions
RETURN
/* Example 3 (Says and Gets in HTML) */
#include "dcdialog.ch"
#include "dchtml.ch"
PROCEDURE Xtest_3()
LOCAL i, GetList[0], oForm, cHtml, oTable, cUserId, cPassword
DCFORM OBJECT oForm
DCTABLE OBJECT oTable PARENT oForm ROWS 2 COLUMNS 2 WIDTH '200'
cUserId := Space(10)
cPassword := Space(10)
@ 1,1 DCSAY 'User ID' PARENT oTable
@ 1,2 DCGET cUserId PARENT oTable NAME 'App.User'
@ 2,1 DCSAY 'Password' PARENT oTable
@ 2,2 DCGET cUserId PARENT oTable NAME 'App.Password' PASSWORD
DCREAD GUI HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN
Source/Library:
DCDIALOG.CH
See Also:
dc_getpopupcaption()
@ DCSAY
dc_getcombomode()
@ DCGRABOX
Draw a Box
Syntax:
@ < nSRow >,< nSCol > TO < nERow >,< nECol > DCGRABOX ;
[COLOR < ncFgC > [,< ncBgC >] ] ;
[PARENT < oParent >] ;
[PIXEL] ;
[ATTRIBUTE < aAttr >] ;
[RELATIVE < oRel >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
[FILL < nFill >] ;
[HRADIUS < nHrad >] ;
[VRADIUS < nVrad >]
Arguments:
< nSRow >, < nSCol >, < nERow >, < nECol > are the row and column of
the screen. Coordinates are always relative to position 0,0
ie. Top,Left of the parent object, unless the RELATIVE < oRel >
argument is used. If no parent is assigned, then the parent
is the Dialog box. IF the PIXEL option is set to .TRUE. in
DCGETOPTIONS, then the numbers are in pixels otherwise they
are in standard text-based coordinates. You can also force
the pixel mode by including PIXEL as a command argument.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
COLOR < nFGc > is the color of the box to be drawn. It must be
a numeric constant which begin with either the prefix
GRA_CLR_ or the prefix XBPSYSCLR_ as defined in GRA.CH or
XBP.CH.
ID < cId > is a unique identifier for this object.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh(),
DC_PaintGraControls() or DC_ReadGui().
ATTRIBUTE < aAttr > is an array of attributes that meets the
specification for area attributes such as color, mixmode,
pattern, etc.
< aAttr > := Array( GRA_AA_COUNT )
< aAttr > is an array whose elements contain the attributes for
character strings drawn by the function GraBoxLine().
#define constants of the attribute array for lines.
These contants are defined in GRA.CH.
#define constants of the attribute array for areas
Array element #define | value Default value
GRA_AA_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AA_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AA_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AA_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AA_SYMBOL GRA_SYM_* GRA_SYM_SOLID
Attributes for areas
Array element Description
GRA_AA_COLOR Foreground color
GRA_AA_BACKCOLOR Background color
GRA_AA_MIXMODE Color mix attribute for foreground
GRA_AA_BGMIXMODE Color mix attribute for background
GRA_AA_SYMBOL Fill pattern
FILL < nFill > specifies whether the rectangle is drawn as an
outline or is filled. The following table shows the #define
constants from the GRA.CH file to use for < nFill > :
Fill attributes for GraBox()
Constant Description
GRA_FILL Fills rectangle
GRA_OUTLINE *) Only draws rectangle border
GRA_OUTLINEFILL Draws rectangle border and fills
*) Default value
HRADIUS < nHRad > and VRADIUS < nVRad > determine how much to
round the corners of the rectangle. Both are positive integers
which, taken together, determine the distance (radius of
curvature) from a corner to the middle of the rectangle. This
distance provides the measure from which the corners are
rounded. < nHRad > indicates the horizontal distance. When
< nHRad > is equal to < nVRad > , the corners are rounded by a
90o arc. < nVRad > determines the vertical curvature radius for
rounding the corners. For rounded corners, both parameters
< nHRad > and < nVRad > must be greater than 0.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
Description:
The command @..DCGRABOX creates a new GraBox() object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the display/edit mode for all objects found in the GetList array.
A Get object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD GUI command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCGRABOX objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON or @..DCTABPAGE.
Notes:
The @ DCGRABOX command uses the function GraBox() to draw the
box therefore it does not create an object.
CAUTION: Do not use DCGRA* commands with the FIT clause of
DCREAD GUI or the AUTORESIZE clause of DCGETOPTIONS,
unless the DCGRA* object is drawn on an object that
does not get resized or repositioned at a later time.
Auto-Sizing and Auto-Fitting is accomplished by
traversing child list of the Parent object and reading
the size and/or coordinates of all objects. DCGRA*
commands are not objects, therefore they cannot be
repositioned correctly.
Examples:
#include "dcgra.ch"
LOCAL GetList := {}, GetOptions, i
@ .5,3 DCGRASTRING ;
{'DCGRA* commands are useful when creating dialogs that require', ;
'a lot of text, images, lines, boxes or other graphic primitives.', ;
'These commands automatically handle locking of presentation space', ;
'and repainting of the graphic area' } ;
FONT '12.Arial Bold Italic' COLOR GRA_CLR_BLUE ROWSPACE 18
@ 5,4 TO 10,76 DCGRABOX FILL GRA_OUTLINEFILL COLOR GRA_CLR_YELLOW
@ 6.2,15 DCGRAPROC {|o,c,r|_BitMaps(o,c,r)}
FOR i := 1 TO 15
@ 10.5, i*4 TO 13.5, i*4 DCGRALINE COLOR i
@ 10.3 + (.22*i),4 TO 10.3 + (.22*i),56 DCGRALINE COLOR i
NEXT
DCGETOPTIONS ;
WINDOWHEIGHT 400 ;
WINDOWWIDTH 600
DCREAD GUI ;
OPTIONS GetOptions ;
ADDBUTTONS
RETURN nil
/* -------------------- */
STATIC FUNCTION _Bitmaps( oPresSpace, nCol, nRow )
LOCAL aTarget, aSource, oBitMap, nResource, i, nSaveCol
nSaveCol := nCol
FOR nResource := 7110 TO 7119
oBitMap := XbpBitMap():new():create(oPresSpace)
oBitMap:load( NIL, nResource )
aTarget := {nCol,nRow,nCol+oBitmap:xSize,nRow+oBitmap:ySize}
aSource := {0,0,oBitmap:xSize,oBitmap:ySize}
nCol += oBitmap:xSize + 5
IF nResource = 7114
nRow -= 40
nCol := nSaveCol
ENDIF
oBitmap:draw( oPresSpace, aTarget, aSource, , GRA_BLT_BBO_IGNORE )
oBitmap:destroy()
NEXT
RETURN nil
Source/Library:
DCGRA.CH
See Also:
@ DCGRASTRING
@ DCGRALINE
@ DCGRALINE
Draw a line
Syntax:
@ < nSRow >,< nSCol > TO < nERow >,< nECol > DCGRALINE ;
[COLOR < ncFgC >] ;
[PARENT < oParent >] ;
[PIXEL] ;
[ATTRIBUTE < aAttr >] ;
[RELATIVE < oRel >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
Arguments:
< nSRow >, < nSCol >, < nERow >, < nECol > are the row and column of
the screen. Coordinates are always relative to position 0,0
ie. Top,Left of the parent object, unless the RELATIVE < oRel >
argument is used. If no parent is assigned, then the parent
is the Dialog box. IF the PIXEL option is set to .TRUE. in
DCGETOPTIONS, then the numbers are in pixels otherwise they
are in standard text-based coordinates. You can also force
the pixel mode by including PIXEL as a command argument.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
COLOR < nFGc > is the color of the line to be drawn. It must be
a numeric constant which begin with either the prefix
GRA_CLR_ or the prefix XBPSYSCLR_ as defined in GRA.CH or
XBP.CH.
ID < cId > is a unique identifier for this object.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh(),
DC_PaintGraControls() or DC_ReadGui().
ATTRIBUTE < aAttr > is an array of attributes that meets the
specification for line attributes such as color, mixmode,
line width, line type, etc.
< aAttr > := Array( GRA_AL_COUNT )
< aAttr > is an array whose elements contain the attributes for
character strings drawn by the function GraLine().
#define constants of the attribute array for lines.
These contants are defined in GRA.CH.
#define constants of the attribute array for lines
Array element #define group Default value
GRA_AL_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AL_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AL_WIDTH GRA_LINEWIDTH_* GRA_LINEWIDTH_NORMAL
GRA_AL_TYPE GRA_LINETYPE_* GRA_LINETYPE_SOLID
Attributes for lines
Array element Description
GRA_AL_COLOR Foreground color
GRA_AL_MIXMODE Color mix attribute for foreground
GRA_AL_WIDTH Line width
GRA_AL_TYPE Line type
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
Description:
The command @..DCGRALINE creates a new GraLine() object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the display/edit mode for all objects found in the GetList array.
A Get object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD GUI command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCGRALINE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON or @..DCTABPAGE.
Notes:
The @ DCGRALINE command uses the function GraLine() to draw the
line therefore it does not create an object.
CAUTION: Do not use DCGRA* commands with the FIT clause of
DCREAD GUI or the AUTORESIZE clause of DCGETOPTIONS,
unless the DCGRA* object is drawn on an object that
does not get resized or repositioned at a later time.
Auto-Sizing and Auto-Fitting is accomplished by
traversing child list of the Parent object and reading
the size and/or coordinates of all objects. DCGRA*
commands are not objects, therefore they cannot be
repositioned correctly.
Examples:
#include "dcgra.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, GetOptions, i
FOR i := 1 TO 15
@ 1.5, i*4 TO 4.5, i*4 DCGRALINE COLOR i
@ 1.3 + (.22*i),4 TO 1.3 + (.22*i),56 DCGRALINE COLOR i
NEXT
DCGETOPTIONS ;
WINDOWWIDTH 500 ;
WINDOWHEIGHT 200
DCREAD GUI ADDBUTTONS OPTIONS GetOptions
RETURN
Source/Library:
DCGRA.CH
See Also:
@ DCGRASTRING
@ DCGRABOX
@ DCGRAPROC
Draw a screen object with a custom procedure
Syntax:
@ < nRow >,< nCol > DCGRAPROC < bProc > ;
[PARENT < oParent >] ;
[PIXEL] ;
[ID < cId >] ;
[GROUP < cGroup >]
Arguments:
< nSRow >, < nSCol > are the row and column coordinates of
the screen. Coordinates are always relative to position 0,0
ie. Top,Left of the parent object. If no parent is assigned,
then the parent is the Dialog box. IF the PIXEL option is set
to .TRUE. in DCGETOPTIONS, then the numbers are in pixels
otherwise they are in standard text-based coordinates. You
can also force the pixel mode by including PIXEL as a command
argument.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
ID < cId > is a unique identifier for this object.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh(),
DC_PaintGraControls() or DC_ReadGui().
Description:
The command @..DCGRAPROC creates a custom Gra*() object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the display/edit mode for all objects found in the GetList array.
A Get object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD GUI command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCGRAPROC objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON or @..DCTABPAGE.
Notes:
CAUTION: Do not use DCGRA* commands with the FIT clause of
DCREAD GUI or the AUTORESIZE clause of DCGETOPTIONS,
unless the DCGRA* object is drawn on an object that
does not get resized or repositioned at a later time.
Auto-Sizing and Auto-Fitting is accomplished by
traversing child list of the Parent object and reading
the size and/or coordinates of all objects. DCGRA*
commands are not objects, therefore they cannot be
repositioned correctly.
Examples:
#include "dcgra.ch"
LOCAL GetList := {}, GetOptions, i
@ .5,3 DCGRASTRING ;
{'DCGRA* commands are useful when creating dialogs that require', ;
'a lot of text, images, lines, boxes or other graphic primitives.', ;
'These commands automatically handle locking of presentation space', ;
'and repainting of the graphic area' } ;
FONT '12.Arial Bold Italic' COLOR GRA_CLR_BLUE ROWSPACE 18
@ 5,4 TO 10,76 DCGRABOX FILL GRA_OUTLINEFILL COLOR GRA_CLR_YELLOW
@ 6.2,15 DCGRAPROC {|o,c,r|_BitMaps(o,c,r)}
FOR i := 1 TO 15
@ 10.5, i*4 TO 13.5, i*4 DCGRALINE COLOR i
@ 10.3 + (.22*i),4 TO 10.3 + (.22*i),56 DCGRALINE COLOR i
NEXT
DCGETOPTIONS ;
WINDOWHEIGHT 400 ;
WINDOWWIDTH 600
DCREAD GUI ;
OPTIONS GetOptions ;
ADDBUTTONS
RETURN nil
/* -------------------- */
STATIC FUNCTION _Bitmaps( oPresSpace, nCol, nRow )
LOCAL aTarget, aSource, oBitMap, nResource, i, nSaveCol
nSaveCol := nCol
FOR nResource := 7110 TO 7119
oBitMap := XbpBitMap():new():create(oPresSpace)
oBitMap:load( NIL, nResource )
aTarget := {nCol,nRow,nCol+oBitmap:xSize,nRow+oBitmap:ySize}
aSource := {0,0,oBitmap:xSize,oBitmap:ySize}
nCol += oBitmap:xSize + 5
IF nResource = 7114
nRow -= 40
nCol := nSaveCol
ENDIF
oBitmap:draw( oPresSpace, aTarget, aSource, , GRA_BLT_BBO_IGNORE )
oBitmap:destroy()
NEXT
RETURN nil
Source/Library:
DCGRA.CH
See Also:
@ DCGRASTRING
@ DCGRALINE
@ DCGRASTRING
Write a text string
Syntax:
@ < nSayRow >,< nSayCol > DCGRASTRING < abcText > ;
[COLOR < nFgC >,[< nBgC >] ] ;
[FONT < bocFont >] ;
[PARENT < oParent >] ;
[PICTURE < cPict >] ;
[PIXEL] ;
[ATTRIBUTE < aAttr >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >]
Arguments:
< nSayRow > and < nSayCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
< abcText > is the text to display. This may be a character string,
an array of character string or a code-block which returns a
character string or array of character strings.
of any type except an object or array. It must not be a macro.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
FONT < cFont > is a character string defining an optional font
for the text. The font string must conform to the Xbase++
standard, ie. "10.Courier.Bold. It may also be a font object or
a code block that returns a character string or a font object
to later refresh with DC_GraPaintControls().
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PICTURE < cPict > is a character string specifying formatting
options for the value of < VarName > during display and editing.
COLOR < nFGc >, < nBGc > are foreground and background colors for
the text. They must be numeric constants which begin with
either the prefix GRA_CLR_ or the prefix XBPSYSCLR_ as defined
in GRA.CH or XBP.CH.
ID < cId > is a unique identifier for this object.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh(),
DC_PaintGraControls() or DC_ReadGui().
ATTRIBUTE < aAttr > is an array of attributes that meets the
specification for string attributes such as color, mixmode,
alignment, etc.
< aAttr > := Array( GRA_AS_COUNT )
< aAttr > is an array whose elements contain the attributes for
character strings drawn by the function GraStringAt().
#define constants of the attribute array for character strings.
These contants are defined in GRA.CH.
Array element #define | value Default value
GRA_AS_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AS_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AS_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AS_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AS_BOX { nXsize, nYsize } dependent on output device
GRA_AS_ANGLE { nX, nY } { 1, 0 }
GRA_AS_SHEAR { nX, nY } { 0, 1 }
GRA_AS_DIRECTION GRA_CHDIRN_* GRA_CHDIRN_LEFTRIGHT
GRA_AS_HORIZALIGN GRA_HALIGN_* GRA_HALIGN_LEFT
GRA_AS_VERTALIGN GRA_VALIGN_* GRA_VALIGN_BASE
GRA_AS_EXTRA nExtra 0
GRA_AS_BREAK_EXTRA nBreakExtra 0
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
Description:
The command @..DCGRASTRING creates a new GraStringAt() object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the display/edit mode for all objects found in the GetList array.
A Get object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD GUI command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCGRASTRING works similarly to the @..DCSAY command except
that it uses the Xbase++ GraStringAt() function rather than an
XbpStatic() object. It is recommended that this command be
used in place of @..DCSAY when there is a lot of text to write
to a GUI screen as it uses far less memory resources and paints
faster.
@..DCGRASTRING objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON or @..DCTABPAGE.
Notes:
The @ DCGRASTRING command uses the function GraStringAt() to
draw the text therefore it does not create an object.
CAUTION: Do not use DCGRA* commands with the FIT clause of
DCREAD GUI or the AUTORESIZE clause of DCGETOPTIONS,
unless the DCGRA* object is drawn on an object that
does not get resized or repositioned at a later time.
Auto-Sizing and Auto-Fitting is accomplished by
traversing child list of the Parent object and reading
the size and/or coordinates of all objects. DCGRA*
commands are not objects, therefore they cannot be
repositioned correctly.
Examples:
#include "dcgra.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, cLastName := Space(15), cFirstName := Space(15),;
cCompany := Space(25), cStreet := Space(25), cCity := Space(25),;
cState := Space(2), cCountry := Space(20), cPhone := Space(15),;
GetOptions
@ 5,10 DCGRASTRING ;
{ 'Last Name', ;
'First Name', ;
'Company', ;
'Street', ;
'City', ;
'State', ;
'Country', ;
'Phone' }
@ 5,25 DCGET cLastName
@ 6,25 DCGET cFirstName
@ 7,25 DCGET cCompany
@ 8,25 DCGET cStreet
@ 9,25 DCGET cCity
@10,25 DCGET cState
@11,25 DCGET cCountry
@12,25 DCGET cPhone PICT '(999)-999-9999'
DCREAD GUI ;
FIT ;
ADDBUTTONS ;
RETURN
Source/Library:
DCGRA.CH
See Also:
@ DCSAY GET
@ DCGROUP
Create a GROUP object for displaying with GUI reader
Syntax:
@ < nSRow >,< nSCol > DCGROUP < oGroup > ;
[BOX < cBox >] ;
[SIZE < nWidth >, < nHeight >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[CAPTION < cText >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[HELPCODE < cHelpCode >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < naCursor >] ;
[CARGO < xCargo >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[GROUP < cGroup >] ;
[VISIBLE] ;
[INVISIBLE]
Arguments:
< nSRow >, < nSCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE argument is used.
If no parent is assigned, then the parent is the Dialog box.
< oGroup > is the name of the variable to assign as a storage
place for this object.
BOX < cBox > is used only in text mode. < cBox > is a character
string of eight characters defining the box used for the
group.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
IF the PIXEL option is set to .TRUE. in DCGETOPTIONS, then
the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
SIZE < nWidth >, < nHeight > defines the size of the group.
If no size is given, then the group will be automatically
sized to fit the parent window. IF the PIXEL option is set to
.TRUE. in DCGETOPTIONS, then the numbers are in pixels,
otherwise they are in standard text-based coordinates. You
can also force the pixel mode by including PIXEL in the command.
CAPTION < cCaption > is the caption to place on the group.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed when the mouse is placed
over any area of the Group that does not contain an object.
The help code is used by the Help system to override the
passing of the Procedure and Varname for more specific
context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Group object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
Description:
The command @..DCGROUP creates a new Group object and
adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
A "Group" object is used to group other objects together,
for example, Radio-Buttons must be part of a group to
function properly as a set. A "Group" object is also used
to draw a box around a set of objects and provide a means
to reference all the objects to the home position 0,0 of
the group.
@..DCGROUP objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The group object created by @ DCGROUP is an object of the
XbpStatic() class, therefore it can be manipulated with
any iVar or method supported by XbpStatic().
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, GetOptions, cOption, oMyGroup
cOption := 'P'
@ 4,10 DCGROUP oMyGroup CAPTION "Select an Operation" ;
SIZE 40,8
@ 1,2 DCRADIO cOption PROMPT 'Save to Dictionary' VALUE 'D' ;
PARENT oMyGroup
@ 2,2 DCRADIO cOption PROMPT 'Save to Source Code' VALUE 'S' ;
PARENT oMyGroup
@ 3,2 DCRADIO cOption PROMPT 'Make a Backup file' VALUE 'B' ;
PARENT oMyGroup
@ 4,2 DCRADIO cOption PROMPT 'Pack the File' VALUE 'P' ;
PARENT oMyGroup
DCREAD GUI ;
TITLE 'My Dialogue' ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
@ DCKLMLE
Create a MULTILINE edit for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCKLMLE < uVar > ;
[PARENT < oParent >] ;
[VALID < bValid >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[SIZE < nWidth >,< nHeight >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[FONT < cFont >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[HELPCODE < cHelpCode >] ;
[DATALINK < bLink >] ;
[OBJECT < oObject >] ;
[CARGO < xCargo >] ;
[READONLY] ;
[NOWORDWRAP] ;
[NOBORDER] ;
[NOVERTSCROLL] ;
[NOHORIZSCROLL] ;
[IGNORETAB] ;
[COMPATIBLE] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < nKey >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[EXITKEY < nExitKey >] ;
[MAXLINES < nMaxLines > [MESSAGE < bcMaxLinesMessage >]] ;
[LINELENGTH < nLineLength > [MESSAGE < bcLineLengthMessage >]] ;
[MAXCHARS < nMaxChars > [MESSAGE < bcMaxCharsMessage >]] ;
[MAINDICT < cMainDict >] ;
[ADDONDICT < cAddOnDict >] ;
[SUGGESTFONT < cSuggestFont >] ;
[ABOXPOS < aBoxPos >] ;
[SHORTSPELL < nShortSpell >] ;
[DELWORDKEY < nDelWordKey >] ;
[DELWORDFUN < nDelWordFun >] ;
[DELLINEKEY < nDelLineKey >] ;
[DELLINEFUN < nDelLineFun >] ;
[PRINTFONT < cPrtFont >] ;
[TOPMARGIN < nPrtTopMar >] ;
[LEFTMARGIN < nPrtLeftMar >] ;
[BOTTOMMARGIN < nPrtBotMar >] ;
[WORDDELIMITERS < cWrdDelimit >] ;
[FINDHIGHLIGHT] ;
[MATCHCASE] ;
[REMEMBERFIND] ;
[NOREMEMBERFIND] ;
[SEARCHWRAP] ;
[NOSEARCHWRAP] ;
[FINDBOXPOS < aFindBoxPos >]
Arguments:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
< uVar > is the input/output variable. This should be
initialized to a character string. It must not be a macro, however
it may be a code block that contains a macro. The < uVar > is
automatically anchored via a Get-Set codeblock created by
DC_GetAnchorCB() unless < uVar > is a custom Get-Set
code block.
RELATIVE< oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
SIZE < nWidth >,< nHeight > is the width and height of the
multiline box. If the PIXEL option is set to .TRUE. in DCGET
OPTIONS, then the numbers are in pixels otherwise they are
in standard text-based numbers.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
OBJECT < oObject > is the name of the variable to assign as a
storage place for this object.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold".
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method.If < bcMsg > is a code-block,
it must return a character string.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
VALID < bValid > is an optional condition tested during the
execution of the GUI gets by the READ command before an
object loses input focus (before it is deactivated). When
the condition returns the value .T. (true), the object
loses the input focus. Otherwise, it remains active. < bValid >
is a code block that must return a logical value when it is
evaluated. The object passed as a parameter to the code block.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this object has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the multiline object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
READONLY will not allow editing of the text. The entire text
area will be grayed.
NOWORDWRAP means that the text is not wrapped. The default is
word-wrap ON so that it is completely displayed in the edit
window. Individual text lines that contain more characters
than can be displayed within the edit window are automatically
wrapped at the spaces between words. With NOWORDWRAP, new
lines are started in the edit window only when CRLF explicitly
appears in the edit buffer. Text lines that contain more
characters than can be displayed in the edit window are cut
off and the text must be horizontally scrolled in order to view
all the characters. To enable WORDWRAP the NOHORIZSCROLL clause
must be used.
NOVERTSCROLL will suppress the vertical scrollbar on the right
side of the window.
NOHORIZSCROLLwill suppress the horizontal scrollbar on the
bottom of the window.
IGNORETAB causes the Tab key to navigates between other objects
on the dialog screen and is not interpreted as a character.
The default action is for the Tab key character to be written
to the edit buffer.
NOBORDER suppress the painting of a border around the object.
COMPATIBLE will make navigation keys compatabile with those of
MemoEdit(). This means that keys like CTRL-R, CTRL-C, CRTL-E,
CRTL-X, CTRL-Y, etc. will be recognized in addition to all the
standard "windows-compatabile" keys.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID< cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object. < bLink > is also
evaluated when DC_GetRefresh() is called unless the < lDataLink >
parameter of DC_GetRefresh() is .FALSE.
ACCELKEY < nKey > is a numeric "hot-key" assignment that will set
focus to the memo object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP< nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS.
EXITKEY < nExitKey > defines a key to be used to move focus from
the MULTILINE object to the next GET or MULTILINE object in the
GetList.
MAXLINES < nMaxLines > is the maximum number of lines which may be
entered. If the MESSAGE < bcMaxLinesMessage > clause is used, then
the message will also be displayed when the number of lines is
exceeded.
LINELENGTH < nLineLength > is the maximum number of characters allowed
on a line. If the MESSAGE < bcLineLengthMessage > clause is used, then
the message will also be displayed when a line exceeds the
designated length.
MAXCHARS < nMaxChars > is the maximum number of characters which may
be entered. If the MESSAGE < bcMaxCharsMessage > clause is used, then
the message will also be displayed when the number of characters
is exceeded.
MAINDICT < cMainDict > Path & file name of main dictionary (KL_Spell.dic)
ADDONDICT < cAddOnDict > Path & file name of add on dictionary (Added.dic)
SUGGESTFONT < cSuggestFont > CompoundName Font for suggestion box (Depends
on screen resolution)
ABOXPOS < aBoxPos > Position array for starting position of suggestion box
relative to AppDeskTop() (Default position calculated)
SHORTSPELL < nShortSpell > Shortcut key to start spell check (xbeK_CTRL_Q)
DELWORDKEY < nDelWordKey > Key for delete word (xbeK_CTRL_BS)
DELWORDFUN < nDelWordFun > Function Key for delete word (xbeK_F8)
DELLINEKEY < nDelLineKey > Key for delete line (xbeK_ALT_K)
DELLINEFUN < nDelLineFun > Function Key for delete line (xbeK_F7)
PRINTFONT < cPrtFont > Default Compound Font name for printing
TOPMARGIN < nPrtTopMar > Default top margin for printing
LEFTMARGIN < nPrtLeftMar > Default left margin for printing
BOTTOMMARGIN < nPrtBotMar > Default bottom margin for printing
WORDDELIMITERS < cWrdDelimit > String of all characters which delimit
words for find operations.
FINDHIGHLIGHT Default to highlight found word.
MATCHCASE Forces find operations to be case sensitive.
REMEMBERFIND Logical option to cause KL_MLE to remember the find string for
the
next search operation.
NOREMEMBERFIND Logical option to cause KL_MLE to start each find operation
with
a blank string.
SEARCHWRAP Option to force KL_MLE to wrap back to top of the string at the end
of a search. (not yet functional)
NOSEARCHWRAP Option to cause KL_MLE to stop searching at the end of the
string,
without wrapping (this is the default)
FINDBOXPOS < aFindBoxPos > Position array for starting position of find/replace
box
relative to AppDeskTop() (Default position calculated)
Description:
The command @..DCKLMLE creates a new multi-line edit
object and adds the object to the array named GETLIST which
is later processed by the DC_READGUI() function or by the
DCREAD GUI command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCKLMLE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
DCKLMLE is a special 3rd party class that accesses KL_MLE. KL_MLE
is available from Informed Computer Solutions, Inc. for further
information on ordering KL_MLE, contact:
Ken Levit -þ> KL_MLE@VetsPet.com
The multiline object created by @ DCKLMLE is an object of the
XbpMLE() class, therefore it can be manipulated with any iVar
or method supported by XbpMLE(). In addition the DCKLMLE supports
the following special methods: (Refer to KL_MLE documentation for
details on these methods and shortcut keys available in KL_MLE.
DeHighlight() GoTop() RowHeight()
DeleteLine() isOnScreen() RowsOnScreen()
DeleteWord() LineCount() ScrollToCursor()
Find() Print() SetTabs()
GetLine() ReplaceAllFind() SelectAll()
GoBottom() ReplaceLastFind() SpellCheck()
Examples:
#include "dcdialog.ch"
#include "dc3p.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, cMemo, lOk
USE COLLECT NEW SHARED
cMemo := COLLECT->memo
@ 0,0 DCMULTILINE cMemo FONT "10.Courier" SIZE 80,10
@ 1,1 DCKLMLE cMemo ;
NOHORIZSCROLL ;
SIZE 77.5,9.5 ;
FONT "10.Courier" ;
GROUP "NoteField" ;
ID "TheNote" ;
SUGGESTFONT "10.Arial Bold" ;
MAINDICT "Test.Dic" ;
ADDONDICT "TestAdd.Dic" ;
PRINTFONT "10.Courier New" ;
OBJECT oNote
DCREAD GUI ;
FIT ;
ADDBUTTONS TO lOk
IF lOk .AND. DC_RecLock()
REPL COLLECT->memo WITH cMemo
UNLOCK
ENDIF
CLOSE collect
RETURN
Source/Library:
DC3P.CH
See Also:
@ DCMULTILINE
@ DCLISTBOX
Create a LISTBOX object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCLISTBOX < uOutVar > LIST < aVar > ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[SIZE < nWidth >,< nHeight >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[FONT < bocFont >] ;
[PRESENTATION < aPres >] ;
[HORIZSCROLL] ;
[MARKMODE < nMarkMode >] ;
[SELECT < aSelect >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[DATALINK < bLink >] ;
[ITEMMARKED < bItemMarked >] ;
[ITEMSELECTED < bItemSelected >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[OBJECT < oObject >] ;
[CARGO < xCargo >] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[MULTICOLUMN] ;
[NAME < cVarName >]
Arguments:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE argument is used.
If no parent is assigned, then the parent is the Dialog box.
IF the PIXEL option is set to .TRUE. in DCGETOPTIONS, then
the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
< uOutVar > is the output variable. This may be initialized to
either a character string variable or an array. If it is a
character string, then only one choice in the listbox will be
allowed and the choice will be returned as a character string
in the variable < uOutVar >. If it is an array, then the listbox
will allow multiple choices which will be returned as a
set of characters in a single-dimensional array and stored
in < uOutVar >. It must not be a macro, however it may be a code
block that contains a macro. The < uOutVar > is automatically
anchored via a Get-Set codeblock created by DC_GetAnchorCB()
unless < uVar > is a custom Get-Set code block.
< aVar > is a single-dimensional array of character strings
which is used as the list box of items.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
SIZE < nWidth >,< nHeight > is the width and height of the
listbox. If the PIXEL option is set to .TRUE. in DCGET
OPTIONS, then the numbers are in pixels otherwise they are
in standard text-based numbers.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
OBJECT < oObject > is the name of the variable to assign as a
storage place for this object.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
MARKMODE < nMarkMode > is a constant from the following table:
Constant Description
XBPLISTBOX_MM_SINGLE *) Only one item can be marked
XBPLISTBOX_MM_MULTIPLE Multiple items can be marked
(special keys are ignored)
XBPLISTBOX_MM_EXTENDED Multiple items can be marked
(special keys are supported)
*) default
The above constants are defined in XBP.CH.
If XBPLISTBOX_MM_MULTIPLE is used, any number of items can be
marked and/or selected with the mouse. The space bar toggles
the selection. The extended selection mode
(XBPLISTBOX_MM_EXTENDED) allows for selecting multiple items by
holding the left button down and moving the mouse. In addition,
the special keys Shift and Ctrl are supported.
SELECT < aSelect > is an array of pointers into < aVar >. This
array is used to Pre-Select items in the list box. For example,
to pre-select items 4, 10, and 15, < aSelect > will be equal to
{ 4, 10, 15 }.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the listbox object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method.If < bcMsg > is a code-block,
it must return a character string.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < aVar > into the object except when using
a user-defined Get/Set code block.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
By default, the list box is displayed without a horizontal scroll
bar. If items in the list have more characters than can be
displayed in the width of the display window, a horizontal scroll
bar can be provided by using the HORIZSCROLL clause.
ITEMMARKED < bItemMarked > is a code block to evaluate when a data
row is highlighted in the picklist. The code block must be
formatted as {| uNIL1, uNIL2, self | ... }.
ITEMSELECTED < bItemSelected > is a code block to evaluate when
a data row is selected with a double-click of the left mouse
button or by pressing the ENTER key in the browser. The code
block must be formatted as {| uNIL1, uNIL2, self | ... }.
MULTICOLUMN causes items to be displayed in multiple columns
that can be scrolled horizontally. The vertical scrollbar is
automatically hidden and the HORIZSCROLL clause is ignored.
NAME < cVarName > is the variable name to assign to the GET
object (for HTML based applications.)
Description:
The command @..DCLISTBOX creates a new List Box object and
adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCLISTBOX objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
GUI Applications :
The listbox object created by @ DCLISTBOX is an object of the
DC_XbpListBox() class which inherits from the XbpListBox()
class, therefore it can be manipulated with any iVar or method
supported by XbpListBox().
------------------
HTML Applications:
The listbox object created by @ DCLISTBOX is an object of the
DC_HtmlListBox() class.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, aFields, cField
USE Customer
aFields := Array(FCount())
AFields( aFields ) // fill array with field list.
@ 5,10 DCLISTBOX cField LIST aFields FONT "10.Courier" ;
SIZE 15,10
DCREAD GUI ;
TITLE 'List Box Demo' ;
FIT ;
ADDBUTTONS
Source/Library:
DCDIALOG.CH
See Also:
@ DCCOMBOBOX
@ DCPICKLIST
dc_vartolistbox()
@ DCMESSAGEBOX
Create a MESSAGE BOX area for displaying with GUI reader
Syntax:
[ @ < nRow >,< nCol > ] DCMESSAGEBOX ;
[OBJECT < oMsgBox >] ;
[TEXTOBJECT < oMsgBoxText >] ;
[TYPE < nType >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[FONT < bocFont >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[CARGO < xCargo >] ;
[PRESENTATION < aPres >] ;
[ALIGN < nAlign >] ;
[PIXEL] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[MOTION]
Arguments:
OBJECT < oMsgBox > is the name of the variable to assign as a
storage place for the box portion of this object.
TYPE < nType > is the type of message box. Message boxes are created
using XbpStatic() objects, so valid constants start with the
prefix XBPSTATIC_TYPE_ and are listed in XBP.CH. The default
is XBPSTATIC_TYPE_HALFTONEFRAME.
TEXTOBJECT < oMsgBoxText > is the name of the variable to assign
as a storage place for the text portion of the object :
XbpStatic() type text.
ALIGN < nAlign > is a numeric constant defined in DCDIALOG.CH.
There are two alignment options:
MESSAGEBOX_TOP Anchor to top of the dialog or parent.
MESSAGEBOX_BOTTOM Anchor to bottom of dialog or parent.
< nRow > and < nCol > is the starting location of the Message Box
in text-based coordinates, unless the PIXEL clause is used. If
no < nRow > and < nCol > arguments are used, then the message box
is located in acordance with the ALIGN < nAlign > option.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
clause is not used, then the object will be displayed in the
top-level dialogue screen.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
SIZE < nWidth >, < nHeight > optionally define the size of the
message box. If no size is given, then the message box will be
automatically sized horizontally to fit the parent window. IF
the PIXEL option is set to .TRUE. in DCGETOPTIONS, then the
numbers are in pixels otherwise they are in standard text-based
coordinates. You can also force the pixel mode by including
PIXEL in the command.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Message Box object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
FONT < cFont > is the font to use for the text that is displayed
in the message box. The default font is "10.Helv". It may also
be a font object or a code block that returns a character string
or a font object to later refresh with DC_GetRefresh().
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
MOTION determines whether messages are visible when the mouse is
placed over the object rather than when the object obtains focus.
Description:
The command DCMESSAGEBOX creates a message box at the top or
the bottom of the dialog screen for displaying messages that
are attached to objects. The Message Box object is added to
the array named GETLIST which is later processed by the
DC_READGUI() function or by the DCREAD GUI command. The GETLIST
array must be first declared and initialized to the value of {}.
The command DCREAD GUI activates the edit mode for all objects
found in the GetList array. A Getlist object remains stored as
long as it is referenced in an array or by a variable. The
commands CLEAR and CLEAR GETS assign an empty array to the
GetList variable. This also occurs after the completion of the
DCREAD command if it is called without the SAVE option, causing
all Get objects referenced by the GetList array to be released.
Any Getlist object in the GetList array can have a message
attached to it via the MESSAGE option for the respective
command. When the object is brought into focus, the message is
displayed in the message box.
DCMESSAGEBOX objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
The objects created by @ DCMESSAGEBOX are objects of the
XbpStatic() class, therefore they can be manipulated with
any iVar or method supported by XbpStatic(). Two objects are
created, one for the static area and one for the message text.
Examples:
#include "dcdialog.ch"
PROCEDURE XTest()
LOCAL GetList := {}, cDesc, cMemo, oMsgBox, lOk
USE Collect NEW SHARED
cDesc := COLLECT->descrip
cMemo := COLLECT->memo
DCMESSAGEBOX oMsgBox
@ 2,0 DCSAY 'Enter Desc' GET cDesc ;
MESSAGE 'Enter the full description of this item'
@ 5,0 DCMULTILINE cMemo FONT "10.Courier.New" SIZE 70,10 ;
MESSAGE 'Tell us something about how you acquired this item'
DCREAD GUI ;
TITLE 'Message Box Demo' ;
TO lOk ;
ADDBUTTONS ;
FIT
IF lOk .AND. DC_RecLock()
REPL COLLECT->memo WITH cMemo, ;
COLLECT->descrip WITH cDesc
UNLOCK
ENDIF
RETURN
Source/Library:
DCDIALOG.CH
@ DCMULTILINE
Create a MULTILINE edit for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCMULTILINE < uVar > ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[VALID < bValid >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
* [EDITPROTECT < bProtect >] ;
[SIZE < nWidth >,< nHeight >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[FONT < bocFont >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[HELPCODE < cHelpCode >] ;
* [DATALINK < bLink >] ;
[OBJECT < oObject >] ;
[CARGO < xCargo >] ;
* [READONLY] ;
* [NOWORDWRAP] ;
* [NOBORDER] ;
* [NOVERTSCROLL] ;
* [NOHORIZSCROLL] ;
* [IGNORETAB] ;
* [COMPATIBLE] ;
* [PRESENTATION < aPres >] ;
* [PIXEL] ;
* [TOOLTIP < bcToolTip >] ;
* [CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
* [ACCELKEY < nKey >] ;
* [GOTFOCUS < bGotFocus >] ;
* [LOSTFOCUS < bLostFocus >] ;
* [TABSTOP] ;
* [NOTABSTOP] ;
* [TABGROUP < nTabGroup >] ;
* [VISIBLE] ;
* [INVISIBLE] ;
[GROUP < cGroup >] ;
* [EXITKEY < nExitKey >] ;
* [MAXLINES < nMaxLines > [MESSAGE < bcMaxLinesMessage >]] ;
* [LINELENGTH < nLineLength > [MESSAGE < bcLineLengthMessage >]] ;
* [MAXCHARS < nMaxChars > [MESSAGE < bcMaxCharsMessage >]] ;
[NAME < cVarName >]
Arguments:
GUI applications:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
< uVar > is the input/output variable. This should be
initialized to a character string. It must not be a macro, however
it may be a code block that contains a macro. The < uVar > is
automatically anchored via a Get-Set codeblock created by
DC_GetAnchorCB() unless < uVar > is a custom Get-Set
code block.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
SIZE < nWidth >,< nHeight > is the width and height of the
multiline box. If the PIXEL option is set to .TRUE. in DCGET
OPTIONS, then the numbers are in pixels otherwise they are
in standard text-based numbers.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
OBJECT < oObject > is the name of the variable to assign as a
storage place for this object.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method.If < bcMsg > is a code-block,
it must return a character string.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
VALID < bValid > is an optional condition tested during the
execution of the GUI gets by the READ command before an
object loses input focus (before it is deactivated). When
the condition returns the value .T. (true), the object
loses the input focus. Otherwise, it remains active. < bValid >
is a code block that must return a logical value when it is
evaluated. The object passed as a parameter to the code block.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this object has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the multiline object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
READONLY will not allow editing of the text. The entire text
area will be grayed.
NOWORDWRAP means that the text is not wrapped. The default is
word-wrap ON so that it is completely displayed in the edit
window. Individual text lines that contain more characters
than can be displayed within the edit window are automatically
wrapped at the spaces between words. With NOWORDWRAP, new
lines are started in the edit window only when CRLF explicitly
appears in the edit buffer. Text lines that contain more
characters than can be displayed in the edit window are cut
off and the text must be horizontally scrolled in order to view
all the characters. To enable WORDWRAP the NOHORIZSCROLL clause
must be used.
NOVERTSCROLL will suppress the vertical scrollbar on the right
side of the window.
NOHORIZSCROLL will suppress the horizontal scrollbar on the
bottom of the window.
IGNORETAB causes the Tab key to navigates between other objects
on the dialog screen and is not interpreted as a character.
The default action is for the Tab key character to be written
to the edit buffer.
NOBORDER suppress the painting of a border around the object.
COMPATIBLE will make navigation keys compatabile with those of
MemoEdit(). This means that keys like CTRL-R, CTRL-C, CRTL-E,
CRTL-X, CTRL-Y, etc. will be recognized in addition to all the
standard "windows-compatabile" keys.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object except when using
a user-defined Get/Set code block. < bLink > is also
evaluated when DC_GetRefresh() is called unless the < lDataLink >
parameter of DC_GetRefresh() is .FALSE.
ACCELKEY < nKey > is a numeric "hot-key" assignment that will set
focus to the memo object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS.
EXITKEY < nExitKey > defines a key to be used to move focus from
the MULTILINE object to the next GET or MULTILINE object in the
GetList.
MAXLINES < nMaxLines > is the maximum number of lines which may be
entered. If the MESSAGE < bcMaxLinesMessage > clause is used, then
the message will also be displayed when the number of lines is
exceeded. If the message is a string, then a message box will
display the contents of the string. If the message is a code
block, it will be evaluated to display any custom message window.
LINELENGTH < nLineLength > is the maximum number of characters allowed
on a line. If the MESSAGE < bcLineLengthMessage > clause is used, then
the message will also be displayed when a line exceeds the
designated length. If the message is a string, then a message box
will display the contents of the string. If the message is a code
block, it will be evaluated to display any custom message window.
MAXCHARS < nMaxChars > is the maximum number of characters which may
be entered. If the MESSAGE < bcMaxCharsMessage > clause is used, then
the message will also be displayed when the number of characters
is exceeded. If the message is a string, then a message box will
display the contents of the string. If the message is a code
block, it will be evaluated to display any custom message window.
NAME < cVarName > is the variable name to assign to the GET
object (for HTML based applications.)
Description:
The command @..DCMULTILINE creates a new multi-line edit
definition and adds it to the array named GETLIST which
is later processed by the DC_Read*() functions or by the
DCREAD * commands. The GETLIST array must be first declared and
initialized to the value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCMULTILINE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
Clauses marked by an asterisk ( * ) are not supported by
DCREAD HTML or DC_ReadHtml().
------------------
GUI applications:
The multiline object created by @ DCDIALOG is an object of the
DC_XbpMLE() class which inherits from the XbpMle() class,
therefore it can be manipulated with any iVar or method
supported by XbpMLE().
------------------
HTML applications:
The multiline object created by @ DCDIALOG is an object of the
DC_HtmlMLE() class.
Examples:
-- Example 1 (GUI) --
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, cMemo, lOk
USE COLLECT NEW SHARED
cMemo := COLLECT->memo
@ 0,0 DCMULTILINE cMemo FONT "10.Courier" SIZE 80,10
DCREAD GUI ;
FIT ;
ADDBUTTONS TO lOk
IF lOk .AND. DC_RecLock()
REPL COLLECT->memo WITH cMemo
UNLOCK
ENDIF
CLOSE collect
RETURN
-- Example 2 (HTML) --
#include "dcdialog.ch"
#include "dchtml.ch"
PROCEDURE Xtest_2()
LOCAL i, GetList[0], oForm, oHtml, oParent, cHtml, oMainHtml, ;
aGetListItem, bBlock, oTable, cComment1, cComment2
DCFORM OBJECT oForm
DCTABLE OBJECT oTable PARENT oForm ROWS 2 COLUMNS 1 WIDTH '200'
cComment1 := 'This is memo 1'
cComment2 := 'This is memo 2'
@ 1,1 DCMULTILINE cComment1 PARENT oTable SIZE 30,10 NAME 'Memo1'
@ 2,1 DCMULTILINE cComment2 PARENT oTable SIZE 30,10 NAME 'Memo2'
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN
Source/Library:
DCDIALOG.CH
See Also:
@ DCKLMLE
dc_htmlmle()
@ DCOBJECT
Define an existing object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCOBJECT < oObject > ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[HIDE < bHide >] ;
[WHEN < bWhen >] ;
[EDITPROTECT < bProtect >] ;
[VALID < bValid >] ;
[HELPCODE < cHelpCode >] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < naCursor >] ;
[CARGO < xCargo >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval] ;
[PIXEL] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[GROUP < cGroup >]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< nRow > is stored in element nGETLIST_STARTROW.
< nCol > is stored in element nGETLIST_STARTCOL.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
clause is not used, then the object will be displayed in the
top-level dialogue screen or in the object set with the
DCSETPARENT command. This is converted to a code-block by
the function DC_GetAnchorCB() and is stored in element
oGETLIST_PARENT.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
MESSAGE < cMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The code block is stored in element bGETLIST_WHEN.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
VALID < bValid > is an optional condition tested during the
navigation through the dialog objects when an object loses
focus (before it is deactivated). If the condition returns the
value .T. (true), the object loses the input focus, otherwise,
it remains active. < bValid > is a code block that must return a
logical value when it is evaluated. The object is passed to the
code block prior to the object losing input focus. The
code block is stored in element bGETLIST_VALID.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this object has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help. The help code is
stored in element cGETLIST_HELPCODE.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
< xCargo > is stored in element xGETLIST_CARGO.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to evaluate after the object is
created. The object is passed as a parameter to the code block.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
Description:
The command DCOBJECT is used to create a reference to an already
created object and adds it to the array named GETLIST which is
later processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
DCOBJECT is used add a reference to an "existing" object. This
command is used when there is a requirement to include an object
in a dialog that has been already created by another routine.
Examples:
#include "dcdialog.ch"
FUNCTION CreateIndexDialog()
LOCAL cIndexFile, lIsCDX, lDescend, lUnique, cIndexKey, cIndexFor,;
cTagName, lNewIndex, GetList := {}, GetOptions, oStruDlg, lOk, ;
oStatic
oStruDlg := DC_DBSTRUW(1,5,9,75,.f.) // create browse window
// that lists fields
cIndexFile := SPACE(80)
cIndexKey := SPACE(200)
cIndexFor := SPACE(200)
cTagName := SPACE(10)
STOR .f. TO lIsCDX, lDescend, lUnique
@ 0,7 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT OBJECT oStatic SIZE 76,10.5
@ 0,0 DCOBJECT oStruDlg PARENT oStatic EVAL {|o|o:show()}
@ 11,7 DCSAY 'File Name' GET cIndexFile GETSIZE 50 ;
VALID {||DC_ReadEmpty(cIndexFile)}
@ 12,7 DCSAY 'Index Key' GET cIndexKey GETSIZE 50 ;
VALID {||DC_ReadEmpty(cIndexKey)}
@ 13,7 DCSAY 'Index FOR condition' GET cIndexFor GETSIZE 50 ;
POPUP {|c|DC_Query(c)}
@ 14,7 DCSAY 'Tag Name' GET cTagName PICT '@!'
@ 16,7 DCCHECKBOX lUnique PROMPT 'Unique Index'
@ 17,7 DCCHECKBOX lDescend PROMPT 'Descending Index'
@ 18,7 DCCHECKBOX lIsCDX PROMPT 'Combined Index'
DCGETOPTIONS SAYRIGHT SAYWIDTH 120
DCREAD GUI FIT ADDBUTTONS TO lOk MODAL ;
OPTIONS GetOptions
RETURN { cIndexFile, cIndexKey, cIndexFor, cTagName, ;
lUnique, lDescend, lIsCDX }
Source/Library:
DCDIALOG.CH
See Also:
USER-DEFINED COMMANDS
@ DCPICKLIST
Create a PICKLIST dialog object for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCPICKLIST < aPick > LIST < aList > ;
[DATALINK < bLink >] ;
[PARENT < oParent >] ;
[OBJECT < oObject >] ;
[COLOR < fgC > [, < bgC > ]] ;
[FONT < bocFont >] ;
[SIZE < nWidth > [, < nHeight >]] ;
[CAPTION < cLeftCap > [,< cRightCap >]] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[TOOLTIP < cToolTip >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[IMMEDIATE]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< aPick > is a memory variable containing the array which will be
created from the picked items.
LIST < aList > is a memory variable containing a single-dimensional
array of character strings. This is the "Available Items"
array.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
OBJECT < oObject > is the name of the variable to assign as a
storage place for this object.
DATALINK < bLink > is a code block that is evaluated when the
user clicks on OK after selecting the list.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
FONT < font > is the name of the font to use for both the
directory and file dialog boxes. It may character string, a font
object or a code block that returns a character string or a font
object to later refresh with DC_GetRefresh().
SIZE < nWidth >,< nHeight > is the width and height of the
listbox. If the PIXEL option is set to .TRUE. in DCGET
OPTIONS, then the numbers are in pixels otherwise they are
in standard text-based numbers. The "Available Items" dialog
component occupies 40% of the total width, the "Selected Items"
dialog component occupies 40% of the total width and the select
buttons occupy 20% of the total width.
CAPTION < cLeftCap >, < cRightCap > are the captions in the left
and right pick areas of the dialog respectively, ex "Available
Fields" and "Selected Fields".
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the dialog object is created.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TOOLTIP < cToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. If < bcToolTip > is a code-block, it must return
a character string. NOTE: The Tooltip painting method is run in
another thread, therefore the codeblock should not run code that
points to the current work area. It may however, contain
local, public or private variables.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS.
IMMEDIATE forces the update of the array < aPick > every time an
item is added rather than requiring a click of the OK button.
Description:
The command @..DCPICKLIST creates a new PickList object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
DCPICKLIST is a dialog that consists of two parts, an
"Available Items" component and a "Selected Items" component.
The "Available Items" area contains a list of items which
are transferred to the "Selected Items" area when the user
selects an item an transfers the item with a click on the 'þ>'
or 'þ>þ>' button. "Selected Items" can also be transferred back
to the "Avaialable Items" area by clicking on the '<þ' button
or the '<þ<þ' button.
@..DCPICKLIST objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Examples:
/*
This example will display a list of fields in the
"Available Fields" selection, allow the operator to
select a set of fields, then display a Browse of the
database for the fields selected.
*/
#include "dcpick.ch"
PROCEDURE XTest( )
LOCAL GetList := {}, GetOptions, cAlias, aListField, ;
aPickField, oBrowse, oDialog
USE COLLECT NEW SHARED
cAlias := 'COLLECT'
aListField := Array(FCount())
AFields(aListField)
@ 2,3 DCPICKLIST aPickField LIST aListField ;
CAPTION "Available Fields", "Selected Fields" ;
SIZE 35,12 ;
DATALINK {||BrowseCollect(cAlias,oDialog,@oBrowse,@aPickField)}
DCGETOPTIONS ;
WINDOW HEIGHT 360 ;
WINDOW WIDTH 600
DCREAD GUI ;
TITLE "Picklist Demo" ;
OPTIONS GetOptions ;
PARENT @oDialog ;
ADDBUTTONS
RETURN
/* --------------------- */
STATIC FUNCTION BrowseCollect ( cAlias, oDialog, oBrowse, aPickField )
LOCAL GetList := {}, i, aChildList
IF Valtype(oBrowse) = 'O'
aChildList := oBrowse:ChildList()
FOR i := 1 TO Len(aChildList)
aChildList[i]:Destroy()
NEXT
oBrowse:Destroy()
ENDIF
oBrowse := nil
IF Empty(aPickField)
RETURN nil
ENDIF
@ 2,40 DCBROWSE oBrowse DATA cAlias SIZE 39,12 PARENT oDialog:drawingArea
SELECT collect
FOR i := 1 TO Len(aPickField)
DCBROWSECOL DATA &('{||COLLECT->'+aPickField[i]+'}') ;
HEADER aPickField[i] PARENT oBrowse
NEXT
DCREAD GUI ;
PARENT oDialog ;
EXIT
oBrowse:hide()
oBrowse:show()
RETURN nil
Source/Library:
DCPICK.CH
See Also:
@ DCLISTBOX
dc_vartolistbox()
dc_varfromlistbox()
@ DCPRINT BITMAP
Send BitMap to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol > [, < nErow >, < nEcol > ] DCPRINT BITMAP < ncRes > ;
[PRINTER < oPrinter >] ;
[AUTOSCALE] ;
[CENTER] ;
[SCALE] ;
[PIXEL] ;
[WHEN < bWhen >]
Arguments:
< nSrow >, < nScol >, < nErow >, < nEcol > are the page coordinates
to print the bitmap. These are row/column text coordinates
unless the PIXEL argument was used with the DCPRINT ON
command, then they are pixel coordinates. If < nErow > and < nECol >
are not used then the end row and end column will be calculated
from the size of the bitmap times the scale.
< ncRes > is the name of a .BMP file, a .JPG file or the number
of a bitmap resource that has been linked to the application.
PRINTER < oPrinter > is the printer object returned by the
DCPRINT ON command or the DC_Printer() class. If this clause
is not used then the printer object referenced by
DC_PrinterObject() is the default.
AUTOSCALE will automatically scale the bitmap image to the
coordinates to maintain the aspect ratio.
CENTER will center the bitmap within the coordinates.
SCALE is a numerical value used to scale the size of the bitmap.
The default is 1. This clause is ignored if all four coordinates
are used. For example, to print a bitmap two times larger than
the original size use SCALE 2.
PIXEL will cause coordinates NOT to be text-based. Normally,
coordinates are text-based and are scaled to the coordinate
system defined by the UNITS command. The scaling is based on
the SIZE clause.
WHEN < bWhen > is a condition codeblock that is evaluated before
the command is executed during previewing and printing from
preview. The DC_Printer() object is passed to the code block.
The code block must return a logical .TRUE. to enable the command.
Description:
@..DCPRINT BITMAP prints a Bitmap on the page using
@..SAY style coordinates. The BitMap may be a resources that
has been linked into the program .EXE, a .BMP file or a .JPG
file. Support for .JPG (JPEG) files requires that the
DCLIPIMG.DLL and _ISOURCE.DLL files are found in the path.
Examples:
#include "dcprint.ch"
PROCEDURE XTest( lPreview )
LOCAL aFor_Sale, oPrinter, i, nLineCount, cMemo, cMemoLine, cScrn
lPreview := IIF( Valtype(lPreview)='L',lPreview,.t.)
USE collect NEW
aFor_Sale := { 'No','Yes','Not Sure' }
BEGIN SEQUENCE
IF lPreview
DCPRINT ON SIZE 60,100 TO oPrinter FONT '12.Courier' PREVIEW
ELSE
DCPRINT ON SIZE 60,100 TO oPrinter FONT '12.Courier'
ENDIF
IF Valtype(oPrinter) # 'O' .OR. !oPrinter:lActive
BREAK
ENDIF
DC_Gui(.t.)
IF !lPreview
cScrn := DC_WaitOn()
ENDIF
DO WHILE !Eof()
@ 2,0,20,45 DCPRINT BITMAP COLLECT->bitmap1
@ 2,50,20,95 DCPRINT BITMAP COLLECT->bitmap2
DCPRINT FONT '12.Courier'
@ 23, 5, 37, 90 DCPRINT BOX
@ 24,10 DCPRINT SAY ' Description:'
@ 25,10 DCPRINT SAY ' Type:'
@ 26,10 DCPRINT SAY ' Sub-Type:'
@ 27,10 DCPRINT SAY ' Condition:'
@ 28,10 DCPRINT SAY ' Location:'
@ 29,10 DCPRINT SAY ' For Sale?:'
@ 30,10 DCPRINT SAY ' Original Date:'
@ 31,10 DCPRINT SAY ' Acquired Date:'
@ 32,10 DCPRINT SAY ' Original Price:'
@ 33,10 DCPRINT SAY 'Appraised Value:'
@ 34,10 DCPRINT SAY ' Comments:'
@ 35,10 DCPRINT SAY ' Bit Map 1:'
@ 36,10 DCPRINT SAY ' Bit Map 2:'
DCPRINT FONT '14.Terminal'
@ 24,32 DCPRINT SAY COLLECT->descrip
@ 25,32 DCPRINT SAY COLLECT->type
@ 26,32 DCPRINT SAY COLLECT->sub_type
@ 27,32 DCPRINT SAY COLLECT->condition
@ 28,32 DCPRINT SAY COLLECT->location
@ 29,32 DCPRINT SAY aFor_Sale[COLLECT->for_sale+1]
@ 30,32 DCPRINT SAY COLLECT->date_orig
@ 31,32 DCPRINT SAY COLLECT->date_acqu
@ 32,32 DCPRINT SAY COLLECT->orig_price
@ 33,32 DCPRINT SAY COLLECT->appr_value
@ 34,32 DCPRINT SAY COLLECT->comments
@ 35,32 DCPRINT SAY COLLECT->bitmap1
@ 36,32 DCPRINT SAY COLLECT->bitmap2
DCPRINT FONT '12.Arial'
cMemo := Alltrim(COLLECT->memo)
nLineCount := MLCount(cMemo)
FOR i := 1 TO nLineCount - 1
cMemoLine := MemoLine( cMemo, nil, i )
IF Empty(cMemoLine)
EXIT
ENDIF
@ 40+i,10 DCPRINT SAY cMemoLine
NEXT
DCPRINT EJECT
SKIP
ENDDO
IF !lPreview
DC_Impl(cScrn)
ENDIF
END SEQUENCE
DCPRINT OFF
RETURN
Source/Library:
DCPRINT.CH
See Also:
dc_printer()
@ DCPRINT BOX
Send Box to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol >, < nErow >, < nEcol > DCPRINT BOX ;
[FILL < nFill >] ;
[HRADIUS < nHRadius >] ;
[VRADIUS < nVRadius >] ;
[PRINTER < oPrinter >] ;
[AREAATTR < aAreaAttr >] ;
[LINEATTR < aLineAttr >] ;
[LINEWIDTH < nLineWidth >] ;
[NOSCALE] [PIXEL] ;
[WHEN < bWhen >]
Arguments:
< nSrow >, < nScol >, < nErow >, < nEcol > are the page coordinates to
print the box. These are row/column text coordinates unless
the PIXEL argument was used with the DCPRINT ON command,
then they are pixel coordinates.
FILL < nFill > specifies whether the rectangle is drawn as an
outline or is filled. The following table shows the #define
constants from the GRA.CH file to use for < nFill > :
Constant Description
GRA_FILL Fills rectangle
GRA_OUTLINE (*) Only draws rectangle border
GRA_OUTLINEFILL Draws rectangle border and fills
(*) Default value
The parameters < nHRad > and < nVRad > determine how much to round
the corners of the rectangle. Both are positive integers
which, taken together, determine the distance (radius of
curvature) from a corner to the middle o fthe rectangle. This
distance provides the measure from which the corners are
rounded. < nHRad > indicates the horizontal distance. When
< nHRad > is equal to < nVRad > , the corners are rounded by
a 90 degree arc.
PRINTER < oPrinter > is the printer object returned by the
DCPRINT ON command or the DC_Printer() class. If this clause
is not used then the printer object referenced by
DC_PrinterObject() is the default.
AREAATTR < aAreaAttr > is an array of area attributes.
< aAreaAttr > := Array( GRA_AA_COUNT )
< aAreaAttr > is an array whose elements contain the attributes for
areas later drawn by @..DCPRINT BOX.
#define constants of the attribute array for areas
Array element #define | value Default value
GRA_AA_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AA_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AA_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AA_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AA_SYMBOL GRA_SYM_* GRA_SYM_SOLID
LINEATTR < aLineAttr > is an array of line attributes.
< aLineAttr > := Array( GRA_AL_COUNT )
< aLineAttr > is an array whose elements contain the attributes for
lines later drawn by @..DCPRINT BOX.
#define constants of the attribute array for lines
Array element #define | value Default value
GRA_AL_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AL_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AL_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AL_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AL_SYMBOL GRA_SYM_* GRA_SYM_SOLID
HRADIUS < nHRadius > indicates the horizontal distance. When
< nHRadius > is equal to < nVRadius > , the corners are rounded by
a 90o arc.
VRADIUS < nVRadius > determines the vertical curvature radius for
rounding the corners. For rounded corners, both parameters
< nHRadius > and < nVRadius > must be greater than 0.
LINEWIDTH < nLineWidth > is the thickness (in units) of the box
perimeter. The default is 1.
The parameters < nHRadius > and < nVRadius > determine how much to
round the corners of the rectangle. Both are positive integers
which, taken together, determine the distance (radius of
curvature) from a corner to the middle of the rectangle. This
distance provides the measure from which the corners are
rounded.
NOSCALE or PIXEL will cause coordinates NOT to be text-based.
Normally, coordinates are text-based and are scaled to the
coordinate system defined by the UNITS command. The scaling is
based on the SIZE clause.
WHEN < bWhen > is a condition codeblock that is evaluated before
the command is executed during previewing and printing from
preview. The DC_Printer() object is passed to the code block.
The code block must return a logical .TRUE. to enable the command.
Description:
@..DCPRINT BOX prints a Box on the page using @..SAY
style coordinates.
Examples:
#include "dcprint.ch"
PROCEDURE XTest( lPreview )
LOCAL aFor_Sale, oPrinter, i, nLineCount, cMemo, cMemoLine, ;
cScrn, aAttr
lPreview := IIF( Valtype(lPreview)='L',lPreview,.t.)
USE collect NEW
aFor_Sale := { 'No','Yes','Not Sure' }
BEGIN SEQUENCE
IF lPreview
DCPRINT ON SIZE 60,100 TO oPrinter FONT '12.Courier' PREVIEW
ELSE
DCPRINT ON SIZE 60,100 TO oPrinter FONT '12.Courier'
ENDIF
IF Valtype(oPrinter) # 'O' .OR. !oPrinter:lActive
BREAK
ENDIF
DC_Gui(.t.)
IF !lPreview
cScrn := DC_WaitOn()
ENDIF
DO WHILE !Eof()
@ 2,0,20,45 DCPRINT BITMAP COLLECT->bitmap1
@ 2,50,20,95 DCPRINT BITMAP COLLECT->bitmap2
DCPRINT FONT '12.Courier'
aAttr := Array(GRA_AL_COUNT)
aAttr[GRA_AL_COLOR] := GRA_CLR_RED
@ 23, 5, 37, 90 DCPRINT BOX ATTRIBUTE aAttr
@ 24,10 DCPRINT SAY ' Description:'
@ 25,10 DCPRINT SAY ' Type:'
@ 26,10 DCPRINT SAY ' Sub-Type:'
@ 27,10 DCPRINT SAY ' Condition:'
@ 28,10 DCPRINT SAY ' Location:'
@ 29,10 DCPRINT SAY ' For Sale?:'
@ 30,10 DCPRINT SAY ' Original Date:'
@ 31,10 DCPRINT SAY ' Acquired Date:'
@ 32,10 DCPRINT SAY ' Original Price:'
@ 33,10 DCPRINT SAY 'Appraised Value:'
@ 34,10 DCPRINT SAY ' Comments:'
@ 35,10 DCPRINT SAY ' Bit Map 1:'
@ 36,10 DCPRINT SAY ' Bit Map 2:'
DCPRINT FONT '14.Terminal'
@ 24,32 DCPRINT SAY COLLECT->descrip
@ 25,32 DCPRINT SAY COLLECT->type
@ 26,32 DCPRINT SAY COLLECT->sub_type
@ 27,32 DCPRINT SAY COLLECT->condition
@ 28,32 DCPRINT SAY COLLECT->location
@ 29,32 DCPRINT SAY aFor_Sale[COLLECT->for_sale+1]
@ 30,32 DCPRINT SAY COLLECT->date_orig
@ 31,32 DCPRINT SAY COLLECT->date_acqu
@ 32,32 DCPRINT SAY COLLECT->orig_price
@ 33,32 DCPRINT SAY COLLECT->appr_value
@ 34,32 DCPRINT SAY COLLECT->comments
@ 35,32 DCPRINT SAY COLLECT->bitmap1
@ 36,32 DCPRINT SAY COLLECT->bitmap2
DCPRINT FONT '12.Arial'
cMemo := Alltrim(COLLECT->memo)
nLineCount := MLCount(cMemo)
FOR i := 1 TO nLineCount - 1
cMemoLine := MemoLine( cMemo, nil, i )
IF Empty(cMemoLine)
EXIT
ENDIF
@ 40+i,10 DCPRINT SAY cMemoLine
NEXT
DCPRINT EJECT
SKIP
ENDDO
IF !lPreview
DC_Impl(cScrn)
ENDIF
END SEQUENCE
DCPRINT OFF
RETURN
Source/Library:
DCPRINT.CH
See Also:
dc_printer()
@ DCPRINT LINE
Send Line to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol >, < nErow >, < nEcol > DCPRINT LINE ;
[ATTRIBUTE < aAttr >] ;
[NOSCALE] [PIXEL] ;
[WHEN < bWhen >]
Arguments:
< nSrow >, < nScol >, < nErow >, < nEcol > are the page coordinates to
print the box. These are row/column text coordinates unless
the PIXEL argument was used with the DCPRINT ON command,
then they are pixel coordinates.
PRINTER < oPrinter > is the printer object returned by the
DCPRINT ON command or the DC_Printer() class. If this clause
is not used then the printer object referenced by
DC_PrinterObject() is the default.
ATTRIBUTE < aAttr > is an array of attributes.
< aAttr > := Array( GRA_AL_COUNT )
< aAttr > is an array whose elements contain the attributes for
lines drawn by graphic functions.
#define constants of the attribute array for lines. These
con stants are defined in GRA.CH.
Array element #define group Default value
GRA_AL_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AL_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AL_WIDTH GRA_LINEWIDTH_* GRA_LINEWIDTH_NORMAL
GRA_AL_TYPE GRA_LINETYPE_* GRA_LINETYPE_SOLID
NOSCALE or PIXEL will cause coordinates NOT to be text-based.
Normally, coordinates are text-based and are scaled to the
coordinate system defined by the UNITS command. The scaling is
based on the SIZE clause.
WHEN < bWhen > is a condition codeblock that is evaluated before
the command is executed during previewing and printing from
preview. The DC_Printer() object is passed to the code block.
The code block must return a logical .TRUE. to enable the command.
Description:
@..DCPRINT LINE prints a Line on the page using @..SAY
style coordinates.
Examples:
#include "dcprint.ch"
PROCEDURE XTest( lPreview )
LOCAL nRow, nSaveRec, cScrn, aFor_Sale, cFontName, oPrinter, i, nStartRow
USE collect
nSaveRec := RecNo()
GO TOP
aFor_Sale := { 'No','Yes','Not Sure' }
BEGIN SEQUENCE
IF lPreview
DCPRINT ON SIZE 50,98 FONT '9.Terminal' TO oPrinter PREVIEW
ELSE
DCPRINT ON SIZE 50,98 FONT '9.Terminal' TO oPrinter
ENDIF
IF Valtype(oPrinter) # 'O' .OR. !oPrinter:lActive
BREAK
ENDIF
cFontName := oPrinter:GetFontCompoundName()
IF !lPreview
cScrn := DC_WaitOn('Printing..')
ENDIF
FOR i := 1 TO oPrinter:nCopies
GO TOP
nRow := 3
oPrinter:nPage := 1
DO WHILE !Eof() .AND. DC_PrinterOk()
IF nRow <= 3
DCPRINT FONT '14.Arial.Bold'
@ nRow-1, 5, nRow+1, 90 DCPRINT BOX
@ nRow,10 DCPRINT SAY 'My Personal Collection Inventory'
@ nRow,50 DCPRINT SAY 'Page ' + Alltrim(Str(oPrinter:nPage))
@ nRow,70 DCPRINT SAY Date()
nRow += 3
nStartRow := nRow
@ nRow+.5, 4, nRow+.5, 94 DCPRINT LINE
DCPRINT FONT '12.Arial.Bold'
@ nRow+.5,5 DCPRINT SAY 'Description'
@ nRow+.5,40 DCPRINT SAY 'Type'
@ nRow+.5,55 DCPRINT SAY 'Sub-Type'
@ nRow+.5,70 DCPRINT SAY 'Cond'
@ nRow+.5,76 DCPRINT SAY 'For Sale?'
@ nRow+.5,87 DCPRINT SAY 'Value'
nRow += 2
DCPRINT FONT cFontName
ELSE
@ nRow+.3, 4, nRow+.3, 94 DCPRINT LINE
@ nRow,5 DCPRINT SAY COLLECT->descrip
@ nRow,40 DCPRINT SAY COLLECT->type
@ nRow,55 DCPRINT SAY COLLECT->sub_type
@ nRow,70 DCPRINT SAY COLLECT->condition
@ nRow,76 DCPRINT SAY aFor_Sale[COLLECT->for_sale+1]
@ nRow,87 DCPRINT SAY Str(COLLECT->appr_value,7,2)
nRow++
SKIP
IF nRow > ( oPrinter:nRows - 5 ) .OR. Eof()
nRow += .5
nStartRow += .5
@ nRow, 4, nRow, 94 DCPRINT LINE
@ nStartRow, 4, nRow, 4 DCPRINT LINE
@ nStartRow,39, nRow,39 DCPRINT LINE
@ nStartRow,54, nRow,54 DCPRINT LINE
@ nStartRow,69, nRow,69 DCPRINT LINE
@ nStartRow,75, nRow,75 DCPRINT LINE
@ nStartRow,86, nRow,86 DCPRINT LINE
@ nStartRow,94, nRow,94 DCPRINT LINE
DCPRINT EJECT
nRow := 3
ENDIF
ENDIF
ENDDO
NEXT
END SEQUENCE
DCPRINT OFF
IF !lPreview
DC_Impl(cScrn)
ENDIF
GO nSaveRec
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
dc_printer()
@ DCPRINT MARKER
Send Marker to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol > DCPRINT MARKER ;
[ATTRIBUTE < aAttr >] ;
[NOSCALE] [PIXEL] ;
[WHEN < bWhen >]
Arguments:
< nSrow >, < nScol > are the page coordinates to print the marker.
These are row/column text coordinates unless the PIXEL
argument was used with the DCPRINT ON command, then they are
pixel coordinates.
PRINTER < oPrinter > is the printer object returned by the
DCPRINT ON command or the DC_Printer() class. If this clause
is not used then the printer object referenced by
DC_PrinterObject() is the default.
ATTRIBUTE < aAttr > is an array of attributes.
< aAttr > := Array( GRA_AM_COUNT )
< aAttr > is an array whose elements contain the attributes for
lines drawn by graphic functions.
#define constants of the attribute array for lines. These
constants are defined in GRA.CH.
#define constants for the attribute array of GraMarker()
Array element #define | value Default value
GRA_AM_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AM_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AM_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AM_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AM_SYMBOL GRA_MARKSYM_* GRA_MARKSYM_CROSS
GRA_AM_BOX { nXsize, nYsize } Dependent on output device
NOSCALE or PIXEL will cause coordinates NOT to be text-based.
Normally, coordinates are text-based and are scaled to the
coordinate system defined by the UNITS command. The scaling is
based on the SIZE clause.
WHEN < bWhen > is a condition codeblock that is evaluated before
the command is executed during previewing and printing from
preview. The DC_Printer() object is passed to the code block.
The code block must return a logical .TRUE. to enable the command.
Description:
@..DCPRINT MARKER prints a Marker on the page using @..SAY
style coordinates.
Examples:
#include "dcprint.ch"
#include "gra.ch"
PROCEDURE XTest( lPreview )
// Displays all markers
// The example displays all available markers and
// their #define constants.
LOCAL aAttr, aMarker, i
IF lPreview
DCPRINT ON PREVIEW
ELSE
DCPRINT ON
ENDIF
// #define constants as
aMarker:= { ; // text and as values
{ "GRA_MARKSYM_DEFAULT ", GRA_MARKSYM_DEFAULT }, ;
{ "GRA_MARKSYM_CROSS ", GRA_MARKSYM_CROSS }, ;
{ "GRA_MARKSYM_PLUS ", GRA_MARKSYM_PLUS }, ;
{ "GRA_MARKSYM_DIAMOND ", GRA_MARKSYM_DIAMOND }, ;
{ "GRA_MARKSYM_SQUARE ", GRA_MARKSYM_SQUARE }, ;
{ "GRA_MARKSYM_SIXPOINTSTAR ", GRA_MARKSYM_SIXPOINTSTAR }, ;
{ "GRA_MARKSYM_EIGHTPOINTSTAR", GRA_MARKSYM_EIGHTPOINTSTAR }, ;
{ "GRA_MARKSYM_SOLIDDIAMOND ", GRA_MARKSYM_SOLIDDIAMOND }, ;
{ "GRA_MARKSYM_SOLIDSQUARE ", GRA_MARKSYM_SOLIDSQUARE }, ;
{ "GRA_MARKSYM_DOT ", GRA_MARKSYM_DOT }, ;
{ "GRA_MARKSYM_SMALLCIRCLE ", GRA_MARKSYM_SMALLCIRCLE }, ;
{ "GRA_MARKSYM_BLANK ", GRA_MARKSYM_BLANK } ;
}
aAttr := Array( GRA_AM_COUNT ) // create attribute array
FOR i:=1 TO 12
@ i+10,10 DCPRINT SAY aMarker[i,1]
aAttr[ GRA_AM_SYMBOL ] := aMarker[i,2]
@ i+10,50 DCPRINT MARKER ATTR aAttr
NEXT
DCPRINT OFF
RETURN
Source/Library:
DCPRINT.CH
See Also:
dc_printer()
@ DCPRINT SAY
Send text to printer using @..SAY style printing
Syntax:
[ @ < nRow >, < nCol > ] DCPRINT SAY < uText > ;
[PICTURE < cPicture >] ;
[FONT < ocFont > [CODEPAGE < nCodePage >] ] ;
[PRINTER < oPrinter >] ;
[FIXED] ;
[NOSCALE] [PIXEL] ;
[ATTRIBUTE < aAttr >] ;
[ALIGN < nAlign >] ;
[OUTLINE] ;
[WHEN < bWhen >] ;
[WIDTH < nWidth >]
Arguments:
< uText > is any variable.
< nRow >, < nCol > are the start page coordinates to print the
text. These are row/column text coordinates unless the
NOSCALE or PIXEL parameter was used in the DCPRINT ON command
or the NOSCALE or PIXEL argument is used with to the @..DCPRINT SAY
command.
NOSCALE or PIXEL will cause coordinates NOT to be text-based.
Normally, coordinates are text-based and are scaled to the
coordinate system defined by the UNITS command. The scaling is
based on the SIZE clause.
If < nRow > and < nCol > arguments are not used then the text will
be printed at the current pen location which is usually the end
of the last item printed by @..DCPRINT SAY. This is desirable
when printing concatenated text with changes in color or changes
in font.
FONT < ocFont > is the font to use. This may be a font object or
a character string containing the font compound name. If no
font clause is used, then the font selected by the DCPRINT FONT
clause will be the default.
NOTE: To print with UNDERSCORE, use the word "Underscore" in
the FONT clause. ex: "12.Arial Bold Underscore".
CODEPAGE < nCodePage > is the desired code page to use with the
prescribed font other than the default code page.
PICTURE < cPicture > is any picture clause that conforms to the
specification defined in the Xbase++ documentation for the
TRANSFORM() function.
FIXED will print each character of the string on the grid
defined by the SIZE command of the DCPRINT ON command. FIXED
should be used for numeric columns and strings used as heading
separators like '-------'.
PRINTER < oPrinter > is the printer object returned by the
DCPRINT ON command or the DC_Printer() class. If this clause
is not used then the printer object referenced by
DC_PrinterObject() is the default.
ATTRIBUTE < aAttr > is an array of attributes that meets the
specification for string attributes such as color, mixmode,
alignment, etc.
< aAttr > := Array( GRA_AS_COUNT )
< aAttr > is an array whose elements contain the attributes for
character strings drawn by the function GraStringAt().
#define constants of the attribute array for character strings.
These contants are defined in GRA.CH.
Array element #define | value Default value
GRA_AS_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AS_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AS_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AS_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AS_BOX { nXsize, nYsize } dependent on output device
GRA_AS_ANGLE { nX, nY } { 1, 0 }
GRA_AS_SHEAR { nX, nY } { 0, 1 }
GRA_AS_DIRECTION GRA_CHDIRN_* GRA_CHDIRN_LEFTRIGHT
GRA_AS_HORIZALIGN GRA_HALIGN_* GRA_HALIGN_LEFT
GRA_AS_VERTALIGN GRA_VALIGN_* GRA_VALIGN_BASE
GRA_AS_EXTRA nExtra 0
GRA_AS_BREAK_EXTRA nBreakExtra 0
ALIGN < nAlign > is used to justify the text left, center or right
both vertically and horizontally around the specified < nRow > and
< nCol > coordinates. < nAlign > is a summation of define manifest
constants from DCPRINT.CH:
Constant Description
---------------------- --------------------------------------
DCPRINT_ALIGN_LEFT Justify Left (Default)
DCPRINT_ALIGN_BOTTOM Justify Bottom (Default)
DCPRINT_ALIGN_RIGHT Justify Right
DCPRINT_ALIGN_HCENTER Justify Horizontally Centered
DCPRINT_ALIGN_TOP Justify Top
DCPRINT_ALIGN_VCENTER Justify Vertically Centered
OUTLINE will draw a box around the text.
Ex: @ 10,10 DCPRINT SAY 'Testing' ;
ALIGN DCPRINT_ALIGN_CENTER + DCPRINT_ALIGN_VCENTER
WHEN < bWhen > is a condition codeblock that is evaluated before
the command is executed during previewing and printing from
preview. The DC_Printer() object is passed to the code block.
The code block must return a logical .TRUE. to enable the command.
WIDTH < nWidth > will truncate the < uText > to fit within the
specified width.
Description:
@..DCPRINT SAY prints text at a specified row and column.
Notes:
The @..DCPRINT SAY command uses the :AtSay() method
of the printer object. This method looks at the current
::nPage instance variable and compares it to the ::nFrom
value and the ::nTo value. If the current page is outside
the range selected by the user, then no output will be sent
to the printer.
Examples:
#include "dcprint.ch"
PROCEDURE XTest( lPreview )
LOCAL aFor_Sale, oPrinter, i, nLineCount, cMemo, cMemoLine, cScrn
lPreview := IIF( Valtype(lPreview)='L',lPreview,.t.)
USE collect NEW
aFor_Sale := { 'No','Yes','Not Sure' }
BEGIN SEQUENCE
IF lPreview
DCPRINT ON SIZE 60,100 TO oPrinter FONT '12.Courier' PREVIEW
ELSE
DCPRINT ON SIZE 60,100 TO oPrinter FONT '12.Courier'
ENDIF
IF Valtype(oPrinter) # 'O' .OR. !oPrinter:lActive
BREAK
ENDIF
DC_Gui(.t.)
IF !lPreview
cScrn := DC_WaitOn()
ENDIF
DO WHILE !Eof()
@ 2,0,20,45 DCPRINT BITMAP COLLECT->bitmap1
@ 2,50,20,95 DCPRINT BITMAP COLLECT->bitmap2
DCPRINT FONT '12.Courier'
@ 23, 5, 37, 90 DCPRINT BOX
aAttr := Array(GRA_AS_COUNT)
aAttr[GRA_AS_COLOR] := GRA_CLR_BLUE
@ 24,10 DCPRINT SAY ' Description:' ATTR aAttr
@ 25,10 DCPRINT SAY ' Type:'
@ 26,10 DCPRINT SAY ' Sub-Type:'
@ 27,10 DCPRINT SAY ' Condition:'
@ 28,10 DCPRINT SAY ' Location:'
@ 29,10 DCPRINT SAY ' For Sale?:'
@ 30,10 DCPRINT SAY ' Original Date:'
@ 31,10 DCPRINT SAY ' Acquired Date:'
@ 32,10 DCPRINT SAY ' Original Price:'
@ 33,10 DCPRINT SAY 'Appraised Value:'
@ 34,10 DCPRINT SAY ' Comments:'
@ 35,10 DCPRINT SAY ' Bit Map 1:'
@ 36,10 DCPRINT SAY ' Bit Map 2:'
DCPRINT FONT '14.Terminal'
@ 24,32 DCPRINT SAY COLLECT->descrip
@ 25,32 DCPRINT SAY COLLECT->type
@ 26,32 DCPRINT SAY COLLECT->sub_type
@ 27,32 DCPRINT SAY COLLECT->condition
@ 28,32 DCPRINT SAY COLLECT->location
@ 29,32 DCPRINT SAY aFor_Sale[COLLECT->for_sale+1]
@ 30,32 DCPRINT SAY COLLECT->date_orig
@ 31,32 DCPRINT SAY COLLECT->date_acqu
@ 32,32 DCPRINT SAY COLLECT->orig_price
@ 33,32 DCPRINT SAY COLLECT->appr_value
@ 34,32 DCPRINT SAY COLLECT->comments
@ 35,32 DCPRINT SAY COLLECT->bitmap1
@ 36,32 DCPRINT SAY COLLECT->bitmap2
DCPRINT FONT '12.Arial'
cMemo := Alltrim(COLLECT->memo)
nLineCount := MLCount(cMemo)
FOR i := 1 TO nLineCount - 1
cMemoLine := MemoLine( cMemo, nil, i )
IF Empty(cMemoLine)
EXIT
ENDIF
@ 40+i,10 DCPRINT SAY cMemoLine
NEXT
DCPRINT EJECT
SKIP
ENDDO
IF !lPreview
DC_Impl(cScrn)
ENDIF
END SEQUENCE
DCPRINT OFF
RETURN
Source/Library:
DCPRINT.CH
See Also:
dc_printer()
@ DCRIGHTPRINT SAY
DCPRINT ON
@ DCPROGRESS
Create a PROGRESS BAR object for displaying with GUI reader
Syntax:
#command @ < nRow >,< nCol > DCPROGRESS < oProgress > ;
[SIZE < nWidth > [,< nHeight >]] ;
[TYPE < nType >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[PRESENTATION < aPres >] ;
[COLOR < bncFgC > [,< ncBgC >]] ;
[PERCENT] ;
[VERTICAL] ;
[EVERY < nCount >] ;
[MAXCOUNT < nMaxCount >] ;
[TOOLTIP < bcToolTip >] ;
[HIDE < bHide >] ;
[CARGO < xCargo >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[PIXEL] ;
[RELATIVE < oRel > ] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >]
Arguments:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< oProgress > is the name of a local variable to assign to this
object. This variable is passed to DC_GetProgress() to update
the progress bar.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
SIZE < nWidth >,< nHeight > is the width and height of the
Progress Bar. If the PIXEL option is set to .TRUE. in DCGET
OPTIONS, then the numbers are in pixels otherwise they are
in standard text-based numbers.
TYPE < nType > is the style of XbpStatic() box to use for the
progress bar. The default is XBPSTATIC_TYPE_RAISEDBOX. The
constants for static types are contained in XBP.CH.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the multiline object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
The PERCENT clause will paint a small box in the center of the
progress bar for displaying the percentage of progress.
The VERTICAL clause will cause the progress bar to progress in
vertically from to bottom to the top, otherwise it will progress
horizontally from left to right.
EVERY < nCount > determines how often the progress bar is updated.
MAXCOUNT < nMaxCount > is a numeric value equal to the maximum
value of the progress bar. For example, if stepping through a
database, this value would be RECCOUNT().
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. If < bcToolTip > is a code-block, it must return
a character string. NOTE: The Tooltip painting method is run in
another thread, therefore the codeblock should not run code that
points to the current work area. It may however, contain
local, public or private variables.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS.
Description:
The command @..DCPROGRESS creates a new Progress-Bar object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCPROGRESS objects are used in combination with the
DC_GETPROGRESS() function to update a progress bar for any kind
of operation, ie, database indexing, updating, exporting,
searching, etc.
@..DCPROGRESS objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCSTATIC, @..DCBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
The object created by @ DCPROGRESS is an object of the
XbpStatic() class, therefore it can be manipulated with
any iVar or method supported by XbpStatic().
Examples:
#include 'dcdialog.ch'
#include 'xbp.ch'
#include 'gra.ch'
PROCEDURE XTest()
LOCAL Getlist := {}, oProgress, oDialog
USE customer
@ 2,5 DCSAY 'Exporting Data to JUNK.DBF'
@ 4,5 DCPROGRESS oProgress ;
SIZE 60,1.5 ;
MAXCOUNT RecCount();
COLOR GRA_CLR_BLUE ;
PERCENT ;
EVERY Int(RecCount()/100)
DCREAD GUI TITLE 'My Test Dialog' ;
PARENT @oDialog ;
FIT ;
EXIT
oDialog:show()
COPY TO junk WHILE _Progress( oProgress )
DC_Gui(.t.)
DC_MsgBox('Done')
oDialog:Destroy()
RETURN
/* ----------------- */
STATIC FUNCTION _Progress ( oProgress )
DC_GetProgress( oProgress, CUSTOMER->(RecNo()) )
RETURN .t.
Source/Library:
DCDIALOG.CH
See Also:
DC_GetProgress()
@ DCPUSHBUTTON
Create a PUSHBUTTON for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCPUSHBUTTON ;
[CAPTION < bcnoCaption >] ;
[SIZE < nWidth >, < nHeight >] ;
[FANCY] ;
[ACTION < bAction >] ;
[WHEN < bWhen >] ;
[HIDE < bHide > ;
[PARENT < oParent >] ;
[PARENTID < cParentID >] ;
[COLOR < bncFgC > [,< ncBgC >]] ;
[HELPCODE < cHelpCode >] ;
[FONT < bocFont >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[OBJECT < oObject >] ;
[TOOLTIP < bcToolTip >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[CURSOR < naCursor >] ;
[CARGO < xCargo >] [CARGO "CANCEL"] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[STATIC] * ;
[FOCUSCOLOR < nTextColor > [,< nFrameColor >]] * ;
[BITMAP < xBMUp > [,< xBMDown > [,< xBMNeutral > [,< xBMFlash >]]]] * ;
[REGION < aRegion >] * ;
[FLASH < nFlashIterations > [,< nFlashDelay >]]
* Supported by eXPress++ 1.7 or later
Arguments:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE argument is used.
If no parent is assigned, then the parent is the Dialog box.
IF the PIXEL option is set to .TRUE. in DCGETOPTIONS, then
the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
CAPTION < bcnoCaption > is the part of the PushButton object that
is displayed within the area of the pushbutton. The caption may
be one of the following:
1) A character string. An ampersand (&) preceding a character in
the text assigns the ALT-< char > key as a hotkey for the
pushbutton and underlines the character. A tilde (~) preceding
the character will only underline the character and will not
enable the hot-key. A tilde (~) could be used with the
ACCELKEY clause to establish the hot key(s).
2) A bitmap resource. The numeric resource ID of the bitmap is
assigned to the instance variable. If a resource ID is used,
it must be defined in a resource file that is linked to the
EXE file using the resource compiler.
3) A bitmap object created with the XbpBitMap() class. (Xbase++
1.7 or later).
4) A two-element array. This array must contain either two
character strings, two bitmap objects or two bitmap numeric
values. The first value is the caption to use when the
pushbutton is "enabled" by the WHEN clause. The second value
is the caption to use when the pushbutton is "disabled" by
the WHEN clause.
4. A code block. A code block is evaluated whenever the
DC_GetRefresh() function is called. This is used to change
the caption dynamically after the pushbutton object is created.
The code block must return either a character string, a bitmap
numeric resource, a bitmap object or an array of 2 elements.
SIZE < nWidth >,< nHeight > is the width and height of the
PushButton. If the PIXEL option is set to .TRUE. in DCGET
OPTIONS, then the numbers are in pixels otherwise they are
in standard text-based numbers.
FANCY will cause the button to be displayed in a special mode
in which the button will be displayed only as a caption on the
parent object until the mouse is passed over the caption which
will then display the raised button. DC_FancyButtonMode(1) can
be used to override this clause and force normal buttons.
CAUTION: FANCY cannot be used with a caption that is a bitmap
object, however it can be used with a caption that is a bitmap
resource.
ACTION < bAction > is a codeblock that is to be evaluated
when the pushbutton is activated.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
OBJECT < oObject > is the name of the memory variable to assign to
this object.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method.If < bcMsg > is a code-block,
it must return a character string.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this object has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the pushbutton object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
Use the clause CARGO 'CANCEL' if the pushbutton is to be used
to exit a dialog without testing validations. This will insure
that if the pushbutton is clicked while in a DCGET with a
validation the validation code block will not be evaluated.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS.
The following options are supported by eXPress++ 1.7 or later:
When the STATIC * clause is used, a class created from the
XbpDialog() class is used instead of the XbpPushButton() class.
This allows for the creation of complex pushbuttons by allowing
the pushbutton object to be a parent for any other object such
as DCSTATIC or DCSAY for the display of text, icons, bitmaps
etc. on the button.
FOCUSCOLOR * is used to determine the color of any text on the
button when it receives focus by passing the mouse over the button.
< anTextColor > is the color of the text. If this argument is a
NIL the text color will not be changed. < anFrameColor > is the
color of a frame that is drawn around the perimeter of the button
to hilight the button when it receives focus. If this argument
is a NIL, there will be no frame drawn. These arguments may be
be a numeric color defined by GRA_CLR_* in GRA.CH or a 3 element
array of RGB colors.
BITMAP * < xBMUp > is the background bitmap for the button in the
UP (unpressed) condition. < xBMDown > is the background bitmap for
the button in the DOWN (pressed) condition and < xBMNeutral > is the
background bitmap of the button in the NEUTRAL (fancy button)
condition. < xBMFlash > is the bitmap to be used with the FLASH
clause. Each bitmap will be replicated over the entire pushbutton
background area. The bitmaps may be numeric resources,
XbpBitMap() objects, or character strings containing a .BMP, .GIF,
or .JPG file name.
FLASH is used with the < xBMFlash > bitmap. This bitmap will flash
on just before the action block is evaluated. This feature is for
touch-screen applications or other applications where some kind of
tactile feedback is desired to indicate to the user that the button
has been pressed. < nFlashIterations > is the number of times that
the bitmap should flash. < nFlashDelay > is the amount of delay in
100th/second between flashes.
REGION < aRegion > is an array defining the region of the button
to display. All other areas will be removed. < aRegion > may be
an array that is created by DC_RegionArray() or may be any other
multidimensional array containing a set of rectangular regions.
< aRegion > is used to display the button as a circle, ellipse,
octagon, diamond, or other irregular shape.
Description:
The command @..DCPUSHBUTTON creates a new PushButton object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCPUSHBUTTON objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCMULTILINE, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
If the STATIC clause is not used, the object created by
@ DCPUSHBUTTON is an object of the XbpPushButton() class,
therefore it can be manipulated with any iVar or method
supported by XbpPushButton() class.
If the STATIC clause is used, the object created by
@ DCPUSHBUTTON is an object of the XbpDialog() class, therefore
it can be manipulated with any iVar or method supported by the
XbpDialog() class (eXPress++ version 1.7 or later).
Use the clause CARGO 'CANCEL' if the pushbutton is to be used
to exit a dialog without testing validations. This will insure
that if the pushbutton is clicked while in a DCGET with a
validation the validation code block will not be evaluated.
For an example of STATIC buttons, run XDEMO.EXE (sample group 5).
The function DC_BitmapTransparentColor() may be used to set the
default transparent color for pushbuttons that have bitmaps as
captions.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}
@ 5,10 DCPUSHBUTTON CAPTION 'Save to Dictionary' ;
SIZE 20,2 ;
ACTION {||SaveToDictionary()}
@ 5,40 DCPUSHBUTTON CAPTION 'Save to Source Code' ;
SIZE 20,2 ;
ACTION {||SaveToSource()}
@ 8,10 DCPUSHBUTTON CAPTION 'Make a Backup file' ;
SIZE 20,2 ;
ACTION {||MakeBackup()}
@ 8,40 DCPUSHBUTTON CAPTION 'Pack the File' ;
SIZE 20,2 ;
ACTION {||PackFile()}
DCREAD GUI ;
TITLE 'Pushbutton Demo' ;
ADDBUTTONS ;
FIT
RETURN
/* -------------------- */
STATIC PROCEDURE SaveToDictionary()
DC_MsgBox('Data has been saved to Dictionary')
RETURN
/* -------------------- */
STATIC PROCEDURE SaveToSource()
DC_MsgBox('Data has been saved to Source Code')
RETURN
/* -------------------- */
STATIC PROCEDURE MakeBackup()
DC_MsgBox('Backup is complete')
RETURN
/* -------------------- */
STATIC PROCEDURE PackFile()
DC_MsgBox('Pack is complete')
RETURN
Source/Library:
DCDIALOG.CH
See Also:
@ DCTOOLBAR
dc_fancybuttonmode()
@ DCQUICKBROWSE
Create a QUICKBROWSE object for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCQUICKBROWSE < oBrowse > ;
[ALIAS < cAlias >] ;
[FIELDS < aFields >] ;
[DATA < xData >] ;
[COLUMNS < aColumns >] ;
[COLTYPE < aColType >] ;
[COLREPRESENTATION < aColRep >] ;
[COLWIDTH < aColWidth >] ;
[COLALIGN < aColAlign >] ;
[HEADERS < aHeaders >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[STYLE < nStyle >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[INTO < uVar >] ;
[POINTER < nVar >] ;
[ITEMMARKED < bItemMarked >] ;
[DATALINK, ITEMSELECTED < bItemSelected >] ;
[EDIT < nEditEvent > ;
[ MODE < nEditMode >] ;
[ ACTION < bEditAction >] ;
[ EXIT < bEditExit > ] ] ;
[INSERT < nInsertEvent > ;
[ DEFAULT < abDefault >] ;
[ ACTION < bInsertAction >] ;
[ EXIT < bInserExit >] ] ;
[ APPEND < nAppendEvent >] ;
[DELETE < nDeleteEvent > ;
[ ACTION < bDeleteAction >] ;
[ EXIT < bDeleteExit > ] ] ;
[HANDLER < handler > [REFERENCE < xRef >]] ;
[PRESENTATION < aPres >] ;
[MESSAGE < cMsg > [INTO < oMsg >]] ;
[COLOR < bncFgC > [,< ncBgC >]] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[FONT < bocFont >] ;
[CARGO < xCargo >] ;
[CURSORMODE < nCursorMode >] ;
[PIXEL] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP] ;
[NOVSCROLL] ;
[NOHSCROLL] ;
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >]
Arguments:
< nRow >, < nCol > are the coordinates on the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel mode by
including PIXEL as a command argument.
< oBrowse > is the name of the variable to assign as a storage
place for this object.
SIZE < nWidth >,< nHeight > is the width and height of the
prompt. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based numbers.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
ALIAS < cAlias > defines the browse as a database browse. < cAlias)
is a variable containing the alias of the database to browse.
or
DATA < aData > defines the browse as an array browse. < aData > is
a variable containing a pointer to the array to browse. ELEMENT
< nElement > is an optional clause defining the selected element of
< aData >.
COLUMNS < aColumns > is a one-dimensional array of column indexes.
for the columns of < aData > when browsing an array. NOTE: this
parameter is needed when creating a browse where columns are
defined by this clause rather than defined later with the
DCBROWSECOL command.
FIELDS < aFields > is a one-dimensional array of field names for
the fields to be accessed. If not specified, the DacPagedDataStore
object caches all fields of the specified work area. NOTE: this
parameter is needed when creating a browse where fields are
defined by this clause rather than defined later with the
DCBROWSECOL command.
HEADERS < aHeaders > is a one-dimensional array of column headings.
NOTE: this parameter is needed when creating a browse where
headers are defined by this clause rather than defined later
with the DCBROWSECOL command.
STYLE < nStyle > is used to choose a pre-defined display style.
The below constants are defined in XBP.CH.
Style definitions
Constant Description
XBP_STYLE_PLAIN Plain appearance
XBP_STYLE_FANCY Fancy style
XBP_STYLE_3D 3D style
COLTYPE < aColType > is an array defining the type of each column.
Each element is an optional sub-array of three elements:
{ < cValtype >, < nDisplayType >, < cPicture > }. NOTE: this
parameter is needed when creating a browse where column types
are defined by this clause rather than defined later with the
DCBROWSECOL command.
< cValType > is the type of data displayed in the column. It is
specified using a letter equivalent to the return value of the
Valtype() function. These are usually the characters "C", "D",
"L" or "N".
< nDisplayType > defines the display type of the column, or how
data is visualized. Data can be represented in textual (default)
or graphic form. Constants defined in XBP.CH are used for
< nDisplayType > . They are listed in the table below:
Constants used for < nDisplayType >
Constant Description
XBPCOL_TYPE_BITMAP The column displays bitmaps
XBPCOL_TYPE_ICON The column displays icons
XBPCOL_TYPE_SYSICON The column displays system-icons
XBPCOL_TYPE_FILEICON The column displays normal file-icons
XBPCOL_TYPE_FILEMINIICON The column displays small file-icons
XBPCOL_TYPE_TEXT *) The column displays textual data
*) default value
< cPicture > optionally defines a picture string for textual data.
Refer to the Transform() function for picture formatting rules.
COLREPRESENTATION < aColRep > is an array of information about the
presentation of columns. There is one sub-array for each column
defined as follows: < aResource >
< aResource > := { < xValue >, < nNormalID >, < nHiliteID > }
When data in a column cell has the value < xValue > the image
with the resource ID < nNormalID > is displayed in the cell. If
the cell is to be hilited, the image with the ID < nHiliteID > is
displayed. The value -1 is valid for both resource IDs. In this
case, nothing is displayed in the cell. Once a visual
representation is defined, it can be voided by specifying NIL
for the resource IDs.
COLWIDTH < aColWidth > is a one-dimensional array of numeric column
widths in pixels.
COLALIGN < aColAlign > is a one-dimensional array of numeric values
to define horizontal and vertical alignment:
Constants for alignment
Constant Description
XBPALIGN_TOP Alignment at the top
XBPALIGN_LEFT Alignment on the left
XBPALIGN_BOTTOM Alignment at the bottom
XBPALIGN_RIGHT Alignment on the right
XBPALIGN_HCENTER Horizontally centered
XBPALIGN_VCENTER Vertically centered
INTO < nVar > is a memory variable to store a pointer to the record
number of the selected row. Each time the user clicks on a new
row of a database browse, the record number will be stored in
< nVar >.
ITEMMARKED < bItemMarked > is a code block to evaluate every
time the user clicks to a new row of the browse. The browse
object is passed to the code block.
POINTER < nVar > is a memory variable to store the current array
element pointer. This clause is used only when browsing arrays.
Each time the user clicks on a new row of the array browse, the
browse row (element number) will be stored in < nVar >. < nVar >
must be initialized to a numeric value.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
ITEMSELECTED, DATALINK < bItemSelected > is an optional code block
to evaluate whenever the user double-clicks the mouse or presses
the ENTER key within the browse area. The browse object is passed
as a parameter to the code block.
EDIT < nEditEvent > is an optional clause that enables "cell-editing"
of the browse cells whenever a specified event occurs that is
associated with the browse object. NOTE: Cell-Editing will work
only if all browse columns are created via the DCBROWSECOL
command. < nEditEvent > is a numeric value equivalent to an xbe*
event or keyboard value which has been defined in APPEVENT.CH.
For example, cell editing will occur within the selected cell
when < nEditEvent > is equal to xbeBRW_ItemSelected and the cell
is selected with a mouse double-click or the ENTER key is
pressed. MODE < nEditMode > is the navigation mode within the
cells. < nEditMode > is a numeric value from the following table:
< nEditMode > Description
----------- ------------------------------------
DCGUI_BROWSE_EDITEXIT Exit cell editing after ENTER key
DCGUI_BROWSE_EDITACROSS Move to next column after ENTER key
DCGUI_BROWSE_EDITDOWN Move to next row after ENTER key
DCGUI_BROWSE_EDITACROSSDOWN Move to next column after ENTER key
and move to next row at end of column
< bEditAction > is an optional code block that is evaluated before
the cells are edited. < bEditExit > is an optional code block that
is evaluated after the cells are edited. The browse object is
passed as a parameter to < bEditAction > and < bEditExit >.
INSERT < nInsertEvent > is an optional clause that enables the
inserting of an element into the array and editing the cell
items. < nInsertEvent > is a numeric value equivalent to an xbe*
event or keyboard value which has been defined in APPEVENT.CH.
For example, cell insertion will occur at the selected row of
the browse when < nEditEvent > is equal to xbeK_INS and the browse
is in focus and the INSERT key is pressed. < bInsertAction > is an
optional code block that is evaluated before a new element is
inserted in the array. < bInsertExit > is an optional code block
that is evaluated after exiting the cell editor. The Browse
Object is passed as a parameter when evaluating < bInsertAction >
and < bInsertExit >. APPEND < nAppendEvent > is an additional optional
clause that can only be used with the INSERT clause. < nAppendEvent >
is a numeric value equivalent to an xbe* event or keyboard value.
This event forces the insertion of the new element at the end of
the array rather than at the selected row.
DELETE < nDeleteEvent > is an optional clause that enables the
deleting the current selected element (row) of an array or the
currently selected record. < nDeleteEvent > is a numeric value
equivalent to an xbe* event or keyboard value which has been
defined in APPEVENT.CH. For example, cell deletion will occur
at the selected row of the browse when < nEditEvent > is equal to
xbeK_DEL and the browse is in focus and the DELETE key is pressed.
< bDeleteAction > is an optional code-block that is evaluated before
the element is deleted. < bDeleteExit > is an optional code block
that is evaluated after the element is deleted. The Browse Object
is passed as a parameter when evaluating < bDeleteAction > and
< bDeleteExit >.
HANDLER < cEventHandler > is the name of a Function which points
to a custom event handler when cell editing. The cell editor
uses it's own, default event handler to manage the objects
during cell editing. The default event handler makes a call
to the custom event handler before processing it's default
events. The custom event handler uses Appevent() to get
information on the current event and passes the following
parameters:
1. nEvent - The event type.
2. mp1 - The first event parameter.
3. mp2 - The second event parameter.
4. oXbp - A pointer to the object creating the event.
5. oDlg - A pointer to the main dialogue object.
6. aGetlist - A pointer to the GetList array.
7. aRef - A pointer to an optional Reference array.
The Function should look like this:
STATIC FUNCTION MyHandler ( nEvent, mp1, mp2, oXbp, oDlg,
aGetlist, aRef )
/* custom code */
RETURN DCGUI_NONE
The function must return a numeric value which controls the
behavior of the event loop as follows:
Return Value Behavior
------------ --------------------------------------------
DCGUI_NONE Continue processing the event
DCGUI_IGNORE Ignore event
DCGUI_CLEAR Ignore event and clear all events from queue
DCGUI_EXIT Exit the Cell editor
REFERENCE < aRef > is any array to pass to the custom event handler.
Programming dialogue systems that must manipulate many variables
is much simpler if all the variables are placed into a single
array and then passed to the dialogue system and its event
handler.
INTO < uVar > is the name of a numeric variable to store the current
record pointer.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Browse object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
CURSORMODE < nCursorMode > determines the browse cursor to be
displayed by the Browse object. #define constants from XBP.CH
must be used for this mode:
Constant Description
XBPBRW_CURSOR_NONE No visible cursor
XBPBRW_CURSOR_CELL Cell cursor (default)
XBPBRW_CURSOR_ROW Row cursor
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
COLOR < bncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. IF < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. If < bcMsg > is a code-block, it must
return a character string.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
NOVSCROLL will suppress the vertical scroll bar.
NOHSCROLL will suppress the horizontal scroll bar.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
Description:
The command @..DCQUICKBROWSE creates a new QuickBrowse object
and adds the object to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD GUI activates
the edit mode for all objects found in the GetList array.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD GUI command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCQUICKBROWSE objects can be combined with any objects that
that use the DCDIALOG system, such as DCBROWSECOL, @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The browse object created by @ DCQUICKBROWSE is an object of the
XbpQuickBrowse() class, therefore it can be manipulated with
any iVar or method supported by XbpQuickBrowse().
Examples:
* Example 1 - Browsing a Database
FUNCTION XTest_1()
LOCAL GetList := {}, oBrowse, aFields, aHeaders, aPres
SET DEFA TO ..\XDOC
USE EXPRESS VIA FOXCDX EXCLUSIVE ALIAS 'XDOC'
SET INDEX TO EXPRESS.CDX
OrdSetFocus('COMMAND')
SET DEFA TO
aFields := { 'XDOC->COMMAND', ;
'XDOC->SHORT', ;
'XDOC->TYPE', ;
'XDOC->MODULE', ;
'XDOC->SEE_ALSO'}
aHeaders := { 'Command','Short Description','Type','Module','See Also'}
@ 1,1 DCQUICKBROWSE ALIAS 'XDOC' SIZE 70,20 ;
OBJECT oBrowse ;
FIELDS aFields HEADERS aHeaders ;
STYLE XBP_STYLE_FANCY ;
CURSORMODE XBPBRW_CURSOR_CELL
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Quick-Browsing a Database'
RETURN nil
* Example 2 - browsing an array (method 1)
FUNCTION XTest_2()
LOCAL GetList := {}, oBrowse, aDirectory := Directory(), aHeaders, ;
aColumns, aColType, aColAlign, aColWidth
aColumns := { ;
F_NAME , ; // Display files as icons
F_NAME , ; // Display file names as text
F_SIZE , ;
F_WRITE_DATE , ;
F_WRITE_TIME , ;
F_CREATION_DATE , ;
F_CREATION_TIME }
aHeaders := { ;
" " , ;
"File name " , ;
" File size" , ;
" Access date" , ;
" Access time" , ;
"Creation date" , ;
"Creation time" }
aColType := { ;
{ 1, XBPCOL_TYPE_FILEMINIICON }, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil }
aColWidth := { ;
32, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil }
aColAlign := { ;
XBPALIGN_VCENTER + XBPALIGN_HCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER }
@ 1,1 DCQUICKBROWSE DATA aDirectory SIZE 60,20 ;
OBJECT oBrowse ;
COLUMNS aColumns ;
HEADERS aHeaders ;
COLTYPE aColType ;
COLWIDTH aColWidth ;
COLALIGN aColAlign
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Quick-Browsing an Array'
RETURN nil
* Example 2 - browsing an array (method 2)
FUNCTION XTest_3()
LOCAL GetList := {}, oBrowse, aDirectory := Directory(), aHeaders, ;
aColumns, aColType, aColAlign, aColWidth
aColumns := { ;
F_NAME , ; // Display files as icons
F_NAME , ; // Display file names as text
F_SIZE , ;
F_WRITE_DATE , ;
F_WRITE_TIME , ;
F_CREATION_DATE , ;
F_CREATION_TIME }
aHeaders := { ;
" " , ;
"File name " , ;
" File size" , ;
" Access date" , ;
" Access time" , ;
"Creation date" , ;
"Creation time" }
aColType := { ;
{ 1, XBPCOL_TYPE_FILEMINIICON }, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil }
aColWidth := { ;
32, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil, ;
nil }
aColAlign := { ;
XBPALIGN_VCENTER + XBPALIGN_HCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER, ;
XBPALIGN_RIGHT + XBPALIGN_VCENTER }
@ 1,1 DCQUICKBROWSE DATA aDirectory SIZE 60,20 ;
OBJECT oBrowse
FOR i := 1 TO 7
DCBROWSECOL PARENT oBrowse ;
ELEMENT aColumns[i] ;
HEADER aHeader[i] ;
WIDTH aColWidth[i] ;
TYPE aColType[i] ;
ALIGN aColAlign[i]
NEXT
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Quick-Browsing an Array'
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
@ DCBROWSE
DCBROWSECOL
@ DCRADIOBUTTON
Create a RADIO BUTTON object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCRADIO < uVar > ;
[VALUE < xVal >] ;
[ACTION < bAction >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[PROMPT < bcPrompt >] ;
[DELIMVAR < cDelim >] ;
[OBJECT < oObject >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[FONT < bocFont >] ;
[CARGO < xCargo >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval,... >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[NAME < cVarName >]
Arguments:
GUI applications:
< nRow > and < nCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE argument is used.
If no parent is assigned, then the parent is the Dialog box.
IF the PIXEL option is set to .TRUE. in DCGETOPTIONS, then
the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
< uVar > is the variable to GET. This may be a variable
of any type except an object or array. It must not be a macro.
The < uVar > is automatically anchored via a Get-Set codeblock
created by DC_GetAnchorCB() unless < uVar > is a custom Get-Set
code block. Macros may be used in a custom Get-Set code block.
VALUE < xValue > is the value to store into the < uVar >
variable when this object is selected.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
DELIMVAR < cDelim > is for text-based screens only and is
ignored when DC_GUI() is .TRUE. This is a three character
sequence to use for the radio button - the default is (*).
PROMPT < bcPrompt > is the prompt to display immediately to
the right of the radio button. It may be a character string or
a code block that returns a character string.
ACTION < bAction > is a code block to evaluate when the
radio button is selected.
SIZE < nWidth >,< nHeight > is the size of the prompt string.
NOTE: If a < nWidth > parameter is not used then the prompt will
be automatically sized to fit the string. Use of the
:setCaption() method may produce undesirable results if the
caption width is not a sufficient length.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the object will be disabled and grayed.
If the value returned is .TRUE. then the object will be enabled.
The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
OBJECT < oObject > is the name of a memory variable to store this
object after is is created.
FONT < cFont > is a character string defining an optional font.
The font string must conform to the Xbase++ standard, ie.
"10.Courier.Bold". It may also be a font object or a code block
that returns a character string or a font object to later
refresh with DC_GetRefresh().
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Radio object.
The first column of the array must contain #define constants
from the XBP.CH file starting with the prefix XBP_PP_. These
constants define the presentation parameters that can be set
for the object and include colors and fonts. The second column
of the array in < aPres > contains the value for each setting.
These are also generally set using #define constants from the
GRA.CH file.
TOOLTIP < bcToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. A semi-colon within the text indicates a new
line. If < bcToolTip > is a code-block, it must return a character
string. NOTE: The Tooltip painting method is run in another
thread, therefore the codeblock should not run code that points
to the current work area. It may however, contain local, public
or private variables.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method.If < bcMsg > is a code-block,
it must return a character string.
CURSOR < naCursor > may be either a numeric value or an array of
3 elements which defines an optional mouse pointer to use for
this object. System mouse pointers start with
XBPWINDOW_POINTERTYPE_ and are defined in XPB.CH. The default
pointer is XBPWINDOW_POINTERTYPE_POINTER. < naCursor > may be a
numeric resource ID that points to a Bit-Map that has been
compiled with the resource compiler and linked to the .EXE.
< naCursor > may be a 3-element array described as follows:
Element Type Description
------- ---- ---------------------------------------------
[1] C Optional name of .DLL containing the pointer
resource.
[2] N The numeric resource ID of the pointer. If
element 1 is a NIL, then this resource must be
linked into the .EXE.
[3] N The type of resource as defined in XBP.CH.
COLOR < ncFGc >, < ncBGc > are foreground and background colors.
They may be character strings representing valid text-based
colors supported by SetColor() or they may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. If < bncFGc > is a
code block is must return a 2-element array containing a
foreground and background color.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for this object. The cargo may be accessed
at any time via the :cargo exported variable, however it will not
be stored in the same manner it is entered. The :cargo container
of DCDIALOG objects is an array of at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
ID < cId > is a unique identifier for this object. This ID is used
with functions like DC_GETORIGUPDATED() to determine the status
of a get object.
TITLE < cTitle > is a title to assign to this object. The title
is not displayed on the screen but is simply a description of the
get object which is saved in the GetList.
ACCELKEY < anAccel > is a numeric "hot-key" assignment that will set
focus to the checkbox object when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH. < anAccel > may also be an array of numeric
values to assign more than one key to the object.
GOTFOCUS < bGotFocus > is a code block that is evaluated when this
object receives input focus. < bGotFocus > := {|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when this
object loses input focus. < bLostFocus > := {|uNIL1,uNIL2,self|...}
TABSTOP will cause the object (Xbase Part) to be set when using
the Tab key. Note: When logical groups are defined in a dialog
using TABGROUP < nTabGroup >, TABSTOP is usually set to .T. (true)
for the first dialog element in the group. This allows the first
dialog element of a group to be activated using the Tab key.
NOTABSTOP will cause the object (Xbase Part) to be ignored when
using the Tab key. This clause is needed only to override any
default setting of TabStop by the DCGETOPTIONS [TABSTOP] command.
TABGROUP < nTabGroup > allows objects (Xbase Parts) that are created
immediately after one another in the GetList to be combined into
logical groups. This allows the user to navigate within a dialog
from group to group by pressing the Tab key. Within a group of
dialog elements navigation is performed using the cursor keys.
Only constants defined in the XBP.CH file can be used as values
for this instance variable. The following table lists the
available constants:
#define constants for < nTabGroup >:
Constant Description
XBP_NO_GROUP *) Dialog element does not belong to a group
XBP_BEGIN_GROUP Dialog element is the first in a group
(this begins the definition of the group)
XBP_WITHIN_GROUP Dialog element is within a group
XBP_END_GROUP Dialog element is the last in a group
(this ends the definition of the group)
*) Default value
GROUP < cGroup > is a "group" name (case-sensitive) to assign to
this GetList object. Assignment to a group makes it possible to
perform operations only on GetList items which are members of a
specified group, using functions such as DC_GetRefresh() or
DC_ReadGui().
VISIBLE determines whether the object is visible immediately after
the call to the method :create() . By default the object follows
the VISIBLE clause of the DCGETOPTIONS command. Use the
INVISIBLE clause to override the VISIBLE clause of DCGETOPTIONS.
PREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the Xbase Parts object is created. The object is
passed to the code block.
EVAL < bEval > is a code block to be evaluated by the GUI reader
after the Xbase Parts object is created. The object is passed
to the code block.
NAME < cVarName > is the variable name to assign to the GET
object (for HTML based applications.)
Description:
The command @..DCRADIOBUTTON creates a new Radio Button
definition and adds it to the array named GETLIST which is later
processed by the DC_Read*() functions or by the DCREAD *
commands. The GETLIST array must be first declared and
initialized to the value of {}.
The command DCREAD GUI creates the DC_Xbp*() objects and
activates the edit mode for all definitions found in the
GetList array.
The command DCREAD HTML creates the DC_Html*() objects and
writes the HTML source code.
A Getlist object remains stored as long as it is referenced
in an array or by a variable. The commands CLEAR and
CLEAR GETS assign an empty array to the GetList variable.
This also occurs after the completion of the DCREAD command
if it is called without the SAVE option, causing all Get
objects referenced by the GetList array to be released.
@..DCRADIOBUTTON objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCCHECKBOX, @..DCPUSHBUTTON or @..DCTABPAGE.
Exported Instance Variables:
Methods:
Notes:
The object created by @ DCRADIOBUTTON is an object of the
XbpRadioButton() class, therefore it can be manipulated with
any iVar or method supported by XbpRadioButton().
Radio Button objects are grouped by their parent. For
radio buttons to work properly each group of related
radio buttons must have a common parent object.
Examples:
-- Example of GUI radio buttons --
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, cOption
cOption := 'P'
@ 5,10 DCRADIO cOption PROMPT 'Save to Dictionary' VALUE 'D'
@ 5,40 DCRADIO cOption PROMPT 'Save to Source Code' VALUE 'S'
@ 7,10 DCRADIO cOption PROMPT 'Make a Backup file' VALUE 'B'
@ 7,40 DCRADIO cOption PROMPT 'Pack the File' VALUE 'P'
DCREAD GUI ;
TITLE 'Radio Button Demo' ;
ADDBUTTONS ;
FIT
RETURN
-- Example of HTML radio buttons --
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oForm, cHtml, oTable, cProfession := 'Doctor'
aProfession := { 'Democrat','Republican','HandyMan','Doctor', ;
'Plumber','Programmer' }
DCFORM OBJECT oForm
DCTABLE OBJECT oTable PARENT oForm ROWS Len(aProfession) COLUMNS 1
FOR i := 1 TO Len(aProfession)
@ i,1 DCRADIOBUTTON cProfession VALUE aProfession[i] ;
PROMPT aProfession[i] PARENT oTable
NEXT
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCDIALOG.CH
See Also:
dc_htmlradiobutton()
@ DCRIGHTPRINT SAY
Send right-justified text to printer
Syntax:
[ @ < nRow >, < nCol > ] DCRIGHTPRINT SAY < uText > ;
[PICTURE < cPicture >] ;
[FONT < ocFont >] ;
[PRINTER < oPrinter >] ;
[FIXED] ;
[PIXEL] ;
[ATTRIBUTE < aAttr >]
Arguments:
< uText > is any variable.
< nRow >, < nCol > are the page coordinates to print the
text. These are row/column text coordinates unless the
PIXEL parameter was used in the DCPRINT ON command or the PIXEL
argument is passed to the @..DCPRINT SAY command.
FONT < ocFont > is the font to use. This may be a font object or
a character string containing the font compound name. If no
font clause is used, then the font selected by the DCPRINT FONT
clause will be the default.
NOTE: To print with UNDERSCORE, use the word "Underscore" in
the FONT clause. ex: "12.Arial Bold Underscore".
PICTURE < cPicture > is any picture clause that conforms to the
specification defined in the Xbase++ documentation for the
TRANSFORM() function.
FIXED will print each character of the string on the grid
defined by the SIZE command of the DCPRINT ON command. FIXED
should be used for numeric columns and strings used as heading
separators like '-------'.
PRINTER < oPrinter > is the printer object returned by the
DCPRINT ON command or the DC_Printer() class. If this clause
is not used then the printer object referenced by
DC_PrinterObject() is the default.
ATTRIBUTE < aAttr > is an array of attributes that meets the
specification for string attributes such as color, mixmode,
alignment, etc.
< aAttr > := Array( GRA_AS_COUNT )
< aAttr > is an array whose elements contain the attributes for
character strings drawn by the function GraStringAt().
#define constants of the attribute array for character strings.
These contants are defined in GRA.CH.
Array element #define | value Default value
GRA_AS_COLOR GRA_CLR_* GRA_CLR_NEUTRAL
GRA_AS_BACKCOLOR GRA_CLR_* GRA_CLR_BACKGROUND
GRA_AS_MIXMODE GRA_FGMIX_* GRA_FGMIX_OVERPAINT
GRA_AS_BGMIXMODE GRA_BGMIX_* GRA_BGMIX_LEAVEALONE
GRA_AS_BOX { nXsize, nYsize } dependent on output device
GRA_AS_ANGLE { nX, nY } { 1, 0 }
GRA_AS_SHEAR { nX, nY } { 0, 1 }
GRA_AS_DIRECTION GRA_CHDIRN_* GRA_CHDIRN_LEFTRIGHT
GRA_AS_HORIZALIGN GRA_HALIGN_* GRA_HALIGN_LEFT
GRA_AS_VERTALIGN GRA_VALIGN_* GRA_VALIGN_BASE
GRA_AS_EXTRA nExtra 0
GRA_AS_BREAK_EXTRA nBreakExtra 0
Description:
@..DCRIGHTPRINT SAY prints text at a specified row and column
with the text right justified.
Notes:
The @..DCPRINT SAY command uses the :AtSay() method
of the printer object. This method looks at the current
::nPage instance variable and compares it to the ::nFrom
value and the ::nTo value. If the current page is outside
the range selected by the user, then no output will be sent
to the printer.
Examples:
PROCEDURE XTest()
LOCAL GetList := {}, oBrowse, lDataToolTips := .f., GetOptions
USE COLLECT VIA 'DBFNTX'
@ 0,0 DCBROWSE oBrowse SIZE 60,13 PRESENTATION DC_BrowPres() FIT
DCBROWSECOL FIELD COLLECT->descrip WIDTH 10 PARENT oBrowse ;
TOOLTIP 'Description' HEADER "Description" DATATOOLTIP {||lDataToolTips}
DCBROWSECOL FIELD COLLECT->type PARENT oBrowse ;
TOOLTIP 'Type' HEADER "Type"
DCBROWSECOL FIELD COLLECT->memo WIDTH 20 PARENT oBrowse ;
TOOLTIP 'Memo' HEADER "Memo" DATATOOLTIP {||lDataToolTips}
DCBROWSECOL FIELD COLLECT->bitmap1 WIDTH 7 PARENT oBrowse ;
TOOLTIP 'BitMap 1' HEADER "BitMap 1" ;
DATATOOLTIP {||lDataToolTips} TIPBLOCK {||_XSample_152(COLLECT->bitmap1)}
DCBROWSECOL FIELD COLLECT->bitmap2 WIDTH 7 PARENT oBrowse ;
TOOLTIP 'BitMap 1' HEADER "BitMap 2" ;
DATATOOLTIP {||lDataToolTips} TIPBLOCK {||_XSample_152(COLLECT->bitmap2)}
@ 14,0 DCCHECKBOX lDataToolTips PROMPT 'Show DataArea Tooltips'
DCGETOPTIONS TOOLTIPCOLOR GRA_CLR_BLACK, GRA_CLR_CYAN
DCREAD GUI FIT MODAL ADDBUTTONS TITLE 'Data Area ToolTips' ;
OPTIONS GetOptions
CLOSE ALL
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
dc_printer()
@ DCPRINT SAY
@ DCSAY GET
Create a SAY..GET object for displaying with the text/GUI reader
Syntax:
@ < nSayRow >,< nSayCol > DCSAY < bcText > ;
[GET < uVar >] ;
[SAYVAR < uSayVar >], ;
[GETPOS < nGetRow > [,< nGetCol >] ] ;
[DATALINK < bLink >] ;
[SAYCOLOR < bncSayFgC >,[< ncSayBgC >] ] ;
[GETCOLOR < bncGetFgC >,[< ncGetBgC >] ] ;
* [SAYSIZE < nSayWidth > [,< nSayHeight >]] ;
* [GETSIZE < nGetWidth > [,< nGetHeight >]] ;
[SAYFONT < bocSayFont >] ;
[GETFONT < bocGetFont >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[VALID < bValid >] ;
* [UNREADABLE] ;
* [CONFIRM] ;
* [NOCONFIRM] ;
[POPUP < bPopUp > ;
[POPCAPTION < ncCaption] ;
[POPFONT < cPopFont >] ;
[POPWIDTH < nPopWidth >] ;
[POPHEIGHT < nPopHeight >] ;
[POPSTYLE < nPopStyle >] ;
[POPKEY < anPopKey >] ;
[POPTABSTOP] ;
[POPGLOBAL] ] ;
[POPTOOLTIP < bcPopToolTip >] ;
* [PROPER ;
[PROPOPTIONS < aPropOptions >]] ;
[PASSWORD] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
* [EDITPROTECT < bProtect >] ;
[SAYOPTIONS < nSayOpt > | SAYRIGHT | SAYLEFT | SAYCENTER] ;
[HELPCODE < cHelp >] ;
* [PICTURE < cPict >] ;
* [PIXEL] ;
* [SAYPRESENTATION < aSayPres >] ;
* [GETPRESENTATION < aGetPres >] ;
[SAYTOOLTIP < bcSayToolTip >] ;
[GETTOOLTIP < bcGetToolTip >] ;
[SAYOBJECT < oSayObject >] ;
[GETOBJECT < oGetObject >] ;
* [SAYCURSOR < naSayCursor >] ;
* [GETCURSOR < naGetCursor >] ;
[SAYCARGO < xSayCargo >] ;
[GETCARGO < xGetCargo >] ;
[SAYPREEVAL < bSayPreEval >] ;
[GETPREEVAL < bGetPreEval >] ;
[SAYEVAL < bSayEval,... >] ;
[GETEVAL < bGetEval,... >] ;
[RELATIVE < oRel >] ;
[SAYID < cSayId >] ;
[GETID < cGetId >] ;
[SAYTITLE < cSayTitle >] ;
[GETTITLE < cGetTitle >] ;
* [ACCELKEY < anAccel >] ;
* [GOTFOCUS < bGotFocus >] ;
* [LOSTFOCUS < bLostFocus >] ;
* [TABSTOP] ;
* [NOTABSTOP];
* [TABGROUP < nTabGroup >] ;
* [VISIBLE] ;
* [INVISIBLE] ;
[GROUP < cGroup >] ;
* [KEYBLOCK < bKeyBlock >] ;
* [COMBO ;
[HEIGHT < nComboHeight >] ;
[DATA < acbComboData >] ;
[FIELD < bField >] ;
[ELEMENT < nElement >] ;
[RETURN < bReturn >] ;
[CAPTION < oncComboCaption >] ;
[FONT < ocComboFont >] ;
[HOTKEY < nComboHotKey >] ] ;
* [GRASTRING] ;
[NAME < cVarName >]
Arguments:
GUI applications:
< nSayRow > and < nSayCol > are the row and column of the screen.
Coordinates are always relative to position 0,0 ie. Top,Left
of the parent object, unless the RELATIVE < oRel > argument is
used. If no parent is assigned, then the parent is the Dialog
box. IF the PIXEL option is set to .TRUE. in DCGETOPTIONS,
then the numbers are in pixels otherwise they are in standard
text-based coordinates. You can also force the pixel
mode by including PIXEL as a command argument.
< nSayRow > may be assigned the value DCGUI_ROW. This will paint
the object at the same row as the previous object. It is
provided to emulate the Row() function in text-based applications.
< nSayCol > may be assigned the value DCGUI_COL + < nOffset >. This
will paint the object immediately to the right of the previous
object plus < nOffset > pixels. It is provided to emulate the Col()
function in text-based applications.
HTML applications:
< nRow > and < nCol > are the row number and column number of
the table if the parent of this object is a DCTABLE. The
text will be inserted in the cell of the table defined by
the row/column.
< bcText > is the text to display in front of the GET. This may be
a character string or a code-block which returns a character
string. If it is a code-block, it is refreshed with the function
DC_GetRefresh().
GET < uVar > is the variable to GET. This may be a variable
of any type except an object or array. It must not be a macro.
The < uVar > is automatically anchored via a Get-Set codeblock
created by DC_GetAnchorCB() unless < uVar > is a custom Get-Set
code block. Macros may be used in a custom Get-Set code block.
SAYVAR < bcSayVar > is the name of a character-type variable
or a Set Code Block which will may used to set the caption of
the SAY text when the Get List is refreshed with DC_GetRefresh().
DATALINK < bLink > is an optional code block that is evaluated
every time Get/Set codeblock is evaluated, ie when the data
is read from the < uVar > into the object except when using
a user-defined Get/Set code block.
RELATIVE < oRel > is an optional object in the Getlist which
determines the start coordinates of this object. If this
option is used, then the < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
GETPOS < nGetRow >, < nGetCol > are the "optional" coordinates
of the GET. If no argument is used, then the GET will be
placed at the end of the SAY string.
SAYCARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for the SAY object.
GETCARGO < xCargo > is any kind of data you wish to to add to the
:cargo container for the GET object.
The cargo may be accessed at any time via the :cargo exported
variable, however it will not be stored in the same manner it is
entered. The :cargo container of DCDIALOG objects is an array of
at least three elements:
[1] - A numeric value that is a pointer to the Getlist array
for this object.
[2] - A pointer to the GetList array.
[3] - The value of < xCargo >.
[4] and up - optional values added by the GUI reader.
SAYSIZE < nSayWidth > [,< nSayHeight >]] is the size to allocate to
the SAY string. If the PIXEL option is set to .TRUE. in
DCGETOPTIONS, then the size must be entered in pixels otherwise
it must be entered in standard text length. If no SAYSIZE
argument is used, then the say will be automatically sized to
the size established by the SAYSIZE option of the DCGETOPTIONS
command. SAYSIZE 0 will automatically size the SAY (XbpStatic)
object to the size of the text taking into consideration the
selected font.
GETSIZE < nGetWidth > [,< nGetHeight >]] is the size to
allocate to the GET variable. If the PIXEL option is set to
.TRUE. in DCGETOPTIONS, then the size must be entered in
pixels otherwise it must be entered in standard text
length. If no GETSIZE argument is used or GETSIZE is ZERO, then
the get will be automatically sized to the size established by
transforming the contents of of the get variable to a string to
determine the length of the get. The default font for GETS in
eXpress++ is 8.Courier because this provides the best user
font for data-entry, so it is usually not necessary to use
this option unless you are also using the GETFONT parameter.
SAYFONT < bocSayFont > is a character string defining an optional
font for the SAY text. The font string must conform to the
Xbase++ standard, ie. "10.Courier.Bold. It may also be a font
object or a code block that returns a character string or a
font object to later refresh with DC_GetRefresh().
GETFONT < bocGetFont > is a character string defining an optional
font for the GET text. The font string must conform to the
Xbase++ standard, ie. "10.Courier.Bold". The default is
"8.Courier". It may also be a font object or a code block that
returns a character string or a font object to later refresh
with DC_GetRefresh().
PARENT < oParent > is the name of the variable that was assigned to
the parent object for this object. Only use this clause if you
are placing this object onto another dialogue object. If this
argument is not passed then the parent will be the object set
with the DCSETPARENT command.
PARENTID < cParentID > may be used in lieu of the PARENT < oParent >
clause. This identifies the ID of the parent instead of the
parent's object variable name.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the object is in focus. Optionally, INTO < oMsgBox >
will designate which message box to display the message into.
If the INTO clause is not used, then the last message box in the
GetList is the default. < oMsgBox > may also be any object that
supports the :setCaption() method. If < bcMsg > is a code-block,
it must return a character string.
PICTURE < cPict > is a character string specifying formatting
options for the value of < VarName > during display and editing.
WHEN < bWhen > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .FALSE. then the GET object will be disabled and
grayed. If the value returned is .TRUE. then the object will be
enabled. The object is passed as a parameter to the code block.
HIDE < bHide > is a code block that is evaluated in the event loop.
This code block must return a logical value. If the value
returned is .TRUE. then the object will be hidden from view. If
the value returned is .FALSE. then the object will be displayed.
The object is passed as a parameter to the code block.
EDITPROTECT < bProtect > is an optional condition tested during the
execution of the GUI gets by the DCREAD GUI command, before the
object receives input focus (before it is activated). When the
condition returns the value .T. (true), the object receives the
input focus. Otherwise, it is skipped. < bProtect > is a code
block that must return a logical value when evaluated. The code
block is evaluated prior to the object receiving input focus.
This clause behaves similar to the WHEN clause with the exception
that the object is not disabled (grayed out). The object is
passed as a parameter to the code block.
The UNREADABLE clause will cause text to be displayed as asterisks
(*) for inputting sensitive data such as passwords.
The NOCONFIRM clause will cause the GET to be exited when the
cursor reaches the end of the buffer during keyboard entry.
Normally, the GET can be exited only by pressing the ENTER key,
TAB key, UP key, DOWN key or clicked on another object. This
overrides the setting of CONFIRM in DCGETOPTIONS.
The CONFIRM clause will cause the GET to be exited by pressing
the ENTER key. This overrides the setting of NOCONFIRM in
DCGETOPTIONS.
VALID < bValid > is an optional condition tested during the
execution of the GUI gets by the READ command before a Get
object loses input focus (before it is deactivated). When
the condition returns the value .T. (true), the Get object
loses the input focus. Otherwise, it remains active. < bValid >
is a code block that must return a logical value when it is
evaluated. The object is passed as a parameter to the code block.
Note: To exit a dialog with a pushbutton and insure that the
validation code block is not evaluated, use the clause
CARGO 'CANCEL' with the DCPUSHBUTTON command.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed or the HELP button
is clicked when this GET has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
AUTOSIZE automatically sizes the SAY string object to the
length of the string.
POPUP < bPopUp > will paint a mouse button at the end of the GET
variable on the screen which informs the operator than an
additional picklist will pop-up if the operator single-clicks on
the button or if the operator presses the CTRL-J or CTRL-ENTER
key while the GET has input focus. The code block will be
evaluated when the button is clicked. The following three
parameters are passed to the codeblock :
1. The value in the current GET
2. A pointer to the GET object
3. The reference value established by the REFERENCE clause
The value returned by the code block will be placed back in the
GET. The code block may return an optional array of two
elements rather than a single value to store to the GET. If a
two-element array is returned, the first element must be the
value to store in the GET and the second element must be a
pointer to the object which is to receive focus. This provides
for the ability to force the focus to a different object on a
POPUP other than the GET.
The POPUP clause is used for popups like calendars, calculators,
picklists, etc. The default caption on the button is three dots.
To change the caption or button display options, use the
function DC_GetPopupCaption().
POPCAPTION < ncaCaption > is the optional caption of the button.
This will override the DC_PopupCaption() setting. This will override the
DC_GetPopupCaption() setting. If < ncaCaption > is an array, it
must be an array of 2 elements where the first element is the
bitmap resource number of the caption to display when the GET is
enabled and the second element is the bitmap resource number of
the caption to display when the GET is disabled with the WHEN
clause.
POPFONT < cFont > is the optional font of the button.