Compiled Commands
OVERVIEW_DUAL_COMM...Dual-Mode Commands
OVERVIEW_GUI_COMM....GUI commands
=> (ECHO)............Display the pre-processed output of a DOT PROMPT command
@ DC3STATE...........Create a 3-STATE object for displaying with the GUI reader
@ DCACTIVEXCONTROL...Create an ActiveX object for displaying with GUI reader
@ DCAPPCRT...........Create an APPLICATION CRT object for displaying with GUI reader
@ DCBARGRAPH.........A command for creating vertical or horizontal bar graphs
@ DCBROWSE...........Create a BROWSE object for displaying with GUI reader
@ DCBROWSE (2).......Create a BROWSE object for displaying with GUI reader
@ DCCHECKBOX.........Create a CHECKBOX object for displaying with GUI reader
@ DCCOMBOBOX.........Create a COMBOBOX object for displaying with GUI reader
@ DCCUSTOM...........Create a CUSTOM object for displaying with GUI reader
@ DCDIALOG...........Create a DIALOG object for displaying with GUI reader
@ DCDIRTREE..........Create a DIRECTORY TREE object for displaying with GUI reader
@ DCFINDBROWSE.......A browse-window find utility that uses AutoSeek
@ DCGET..............Create a GET object for displaying with the text/GUI reader
@ DCGRABOX...........Draw a Box
@ DCGRALINE..........Draw a line
@ DCGRAPROC..........Draw a screen object with a custom procedure
@ DCGRASTRING........Write a text string
@ DCGROUP............Create a GROUP object for displaying with GUI reader
@ DCHTMLVIEWER.......Create a Web Browser object for displaying with GUI reader
@ DCKLMLE............Create a MULTILINE edit for displaying with GUI reader
@ DCLISTBOX..........Create a LISTBOX object for displaying with GUI reader
@ DCMESSAGEBOX.......Create a MESSAGE BOX area for displaying with GUI reader
@ DCMULTILINE........Create a MULTILINE edit for displaying with GUI reader
@ DCMXPUSHBUTTON.....Create an MXPUSHBUTTON for displaying with GUI reader
@ DCOBJECT...........Define an existing object for displaying with GUI reader
@ DCPICKLIST.........Create a PICKLIST dialog object for displaying with GUI reader
@ DCPRINT BITMAP.....Send BitMap to printer using @..SAY style printing
@ DCPRINT BOX........Send Box to printer using @..SAY style printing
@ DCPRINT LINE.......Send Line to printer using @..SAY style printing
@ DCPRINT MARKER.....Send Marker to printer using @..SAY style printing
@ DCPRINT RTF........Send RTF text to printer using @..SAY style printing
@ DCPRINT SAY........Send text to printer using @..SAY style printing
@ DCPROGRESS.........Create a PROGRESS BAR object for displaying with GUI reader
@ DCPUSHBUTTON.......Create a PUSHBUTTON for displaying with GUI reader
@ DCPUSHBUTTONXP.....Create a XP-Style PUSHBUTTON for displaying with GUI reader
@ DCQUICKBROWSE......Create a QUICKBROWSE object for displaying with GUI reader
@ DCRADIOBUTTON......Create a RADIO BUTTON object for displaying with GUI reader
@ DCRIGHTPRINT SAY...Send right-justified text to printer
@ DCRMCHART..........A command interface to RMChart graphing
@ DCRTF..............Create a RTF editor object for displaying with GUI reader
@ DCSAY GET..........Create a SAY..GET object for displaying with the text/GUI reader
@ DCSAY GET (2)......Create a SAY..GET object for displaying with the text/GUI reader
@ DCSCROLLBAR........Create a SCROLL BAR object for displaying with GUI reader
@ DCSLE..............Create a SINGLE LINE edit for displaying with GUI reader
@ DCSPINBUTTON.......Create a SPIN BUTTON get for displaying with GUI reader
@ DCSPLITBAR.........Create a SPLITBAR object for displaying with GUI reader
@ DCSTATIC...........Create a STATIC object for displaying with GUI reader
@ DCTABPAGE..........Create a TAB PAGE object for displaying with GUI reader
@ DCTOOLBAR..........Create a TOOLBAR object for displaying with GUI reader
@ DCTREEARRAY........Browse a multi-dimensional array using Tree-View
@ DCTREEROOT.........Create a Root object for a Tree View
@ SAYWIN.............Write a SAY text string in a Text or GUI dialog
DCADDBUTTON..........Add BUTTON to TOOLBAR object for displaying with GUI reader
DCADDBUTTONXP........Add XP-Style BUTTON to TOOLBAR object
DCAPPBROWSE..........Create an APPLICATION BROWSE object for displaying with GUI reade
DCAPPEDIT............Create an APPLICATION EDIT object for displaying with GUI reader
DCAPPFIELD...........Create an APPLICATION FIELD object for displaying with GUI reader
DCBDEBUG.............Send debug information to a browse-style debugging window
DCBITMAP.............Create a BITMAP object for displaying with the GUI reader
DCBROWSECOL..........Create a BROWSE column object for displaying with GUI reader
DCDOT................Invoke a Dot-prompt window
DCEVAL...............Evaluate a code block in the GetList
DCFINDADDCOL.........Add column to an array to be used by DCFINDBROWSE
DCFORM...............A command for creating FORM tags in HTML
DCFRAME..............A command for creating FRAME tags in HTML
DCFRAMESET...........A command for creating FRAMESET tags in HTML
DCGETOPTIONS.........Set the options for the Dialog Reader
DCGETOPTIONS (2).....Set the options for the Dialog Reader
DCGRUMPBROW..........An emulation of Greg Lief's GRUMPBROW
DCHOTKEY.............Set a Hot-Key for action by the GUI Reader
DCHTML...............A command for creating any HTML output
DCHTMLBODY...........A ccommand for creating the body tag of an HTML document
DCHTMLMAIN...........A ccommand for creating the main HTML document
DCHYPERLINK..........A command for creating HYPERLINK tags in HTML
DCIMAGE..............A command for creating IMAGE tags in HTML
DCINPUT..............A command for creating input elements for HTML forms
DCLDEBUG.............Send debug information to a debugging Log File
DCLDEBUGOFF..........Send debug information to a debugging Log File
DCLDEBUGOFFQUIET.....Send debug information to a debugging Log File
DCLDEBUGQUIET........Send debug information to a debugging Log File
DCLIST...............A command for creating lists in HTML
DCLISTITEM...........A command for creating list items in HTML
DCMENUBAR............Create a MENUBAR object for displaying with Text/GUI reader
DCMENUITEM...........Add Item to SUBMENU object for displaying with Text/GUI reader
DCMSGBOX.............Display an array of messages in a window
DCMXADDBUTTON........Add an MXPUSHBUTTON to a ToolBar
DCPANEL..............Anchor a Dialog Window to the perimiter of a main Dialog
DCPRINT ?/??.........Send text to printer using ?/?? style printing
DCPRINT ABORT........Abort the print job
DCPRINT ATTRIBUTE....Set the Attributes for printing with DCPRINT commands
DCPRINT EJECT........Eject the printer page
DCPRINT ENDPAGE......Start a new Page in a Print Job
DCPRINT EVAL.........Evaluate a code block to imbed custom graphs in printed page
DCPRINT FIXED........Set FIXED mode ON/OFF within a print job
DCPRINT FONT.........Set the Font for printing with @..SAY style coordinates
DCPRINT FORMSIZE.....Change the form size within a print job
DCPRINT GROUPEJECT...Preview the next print group
DCPRINT OFF..........Destroy a printer object
DCPRINT ON...........Create a printer class object for @..SAY style printing
DCPRINT OPTIONS......Create an option array for setting printing defaults
DCPRINT ORIENTATION..Change the orientation within a print job
DCPRINT PAPERBIN.....Change the paper bin within a print job
DCPRINT SIZE.........Set the size of the print page in rows and columns
DCPRINT STARTPAGE....Start a new Page in a Print Job
DCQDEBUG.............Send debug information to a debugging window
DCQDEBUGOFF..........Send debug information to a debugging window
DCQDEBUGOFFQUIET.....Send debug information to a debugging window
DCQDEBUGQUIET........Send debug information to a debugging window
DCQOUT...............Send data to a debugging window
DCQOUT WINDOW........Establish or Create a CRT window for debugging GUI apps
DCREAD GUI...........Read the DIALOG GetList with the GUI reader
DCREAD HTML..........Read the DIALOG GetList with the HTML reader
DCREAD TEXT..........Read the DIALOG GetList
DCSETCOLOR...........Set the COLOR for successive DC* commands
DCSETFONT............Set the FONT for successive DC* commands
DCSETGROUP...........Set the GROUP name for successive DC* commands
DCSETPARENT..........Set the Parent object for successive DC* commands
DCSETRESIZE..........Set the RESIZE method for successive DC* commands
DCSETSAYOPTION.......Set the text alignment options for successive DCSAY commands
DCSTATUSBAR..........Create a Status Bar area on the perimiter of a dialog
DCSUBMENU............Add Submenu to MENUBAR object for displaying with Text/GUI reader
DCTABGROUP...........A command for creating TABPAGES in HTML
DCTABLE..............A command for creating a TABLE in HTML
DCTREEITEM...........Create a new item for a Tree View
DCUSEREVENT..........Create an action that is tied to a user event
DCVARGROUP...........Create a group of vars in a dynamically-created class
DCVARS...............A command for managing HIDDEN variables in HTML
GETSETFUNCTION.......Create a Get/Set Function
GETSETTHREADFUNCTION.Create a Get/Set Function that is thread-safe
GUI..................Set the Dialogue mode to GUI or TEXT
LOG..................Write system status to a log file
SAVE ARRAY...........Save a multidimensional array to a binary file
WTF..................Send debug information to a browse-style debugging window
USER-DEFINED COMMANDSCreate a User-Defined object for displaying with GUI reader
dc_printergroupeject()Preview the next print group
DCAPICK..............A dialogue for choosing a item from an array pick list.
DCREPORT FORM........A Windows compatible replacement for REPORT FORM
dc_setwindowtransparency()Sets a Dialog Window to any transparency from 0% to 100%
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 >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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 object has focus. This HELPCODE allows
the Help system to override the passing of the Procedure and
Varname for more specific context-help.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpTabPage().
This class should inherit from DC_XbpTabPage().
See the example in \exp19\samples\subclass.
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
@ DCACTIVEXCONTROL
Create an ActiveX object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCACTIVEXCONTROL < oObject > ;
[CLSID < cClsID >] ;
[SIZE < nWidth >, < nHeight >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[PREEVAL < bPreEval >] ;
[POSTEVAL < bPostEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[RESIZE < aResize >] ;
[LICENSE < cLicense >] ;
[SUBCLASS < cSubClass >] ;
[REGISTER < cClsId >, < cOcx > [USERPROMPT]]
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.
OBJECT < oObject > is the name of the variable to assign as a
storage place for this object.
CLSID contains the id of a COM/ActiveX class an application
wants to obtain an instance of. The class ids of the COM/ActiveX
class installed on a computer are stored in the registry.
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 no size is given, then the object will be automatically
sized to fit the caption. 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.
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 Static 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.
POSTEVAL < bPostEval > 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.
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
LICENSE < cLicense > is an license string required by the ActiveX
control developer.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpActiveXControl().
This class should inherit from DC_XbpActiveXControl().
See the example in \exp19\samples\subclass.
REGISTER < cClsid >, < cOcx > is the CLSID and OCX name
respectively.
This clause can be used to automatically register an OCX if it has
not already been registered. USERPROMPT will prompt the user if
the OCX failed to register.
Description:
The command @..DCACTIVEXCONTROL creates an ActiveX 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.
@..DCACTIVEXCONTROL objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The object created by @ DCACTIVEXCONTROL is an object of the
XbpActiveXControl() class, therefore it can be manipulated with
any iVar or method supported by XbpActiveXControl().
Examples:
See the example in SAMPLES\ACTIVEX\ACROBAT.PRG.
Source/Library:
DCDIALOG.CH
See Also:
@ DCHTMLVIEWER
@ 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
@ DCBARGRAPH
A command for creating vertical or horizontal bar graphs
Syntax:
@ < nRow > [, < nCol >] DCBARGRAPH ;
[TYPE < nType >] ;
[DATA < aArray >] ;
[PARENT < oParent >] ;
[PARENTID < cParentID >] ;
[BGCOLOR < abnBgColor >] ;
[TEXTFONT < cTextFont >] ;
[TEXTCOLOR < abnTextfgC > [,< abnTextbgC >]] ;
[SCALEFONT < cScaleFont > ] ;
[SCALECOLOR < abnScalefgC > [,< abnScalebgC >] ] ;
[BARCOLOR < aBarColor >] ;
[LBDOWN < bLbDown >] ;
[RBDOWN < bRbDown >] ;
[MAXVALUE < nMaxValue >] ;
[MINVALUE < nMinValue >] ;
[SCROLLBUTTONS] ;
[SCROLLRANGE < nScrollRange >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[EVAL < bEval >] ;
[PREEVAL < bPreEval >] ;
[RELATIVE < oRel >] ;
[OBJECT < oObject >] ;
[ID < cId >] ;
[TITLE < title >] ;
[VISIBLE] ;
[GROUP < cGroup >] ;
[LINEMARKERS < aLineMarkers >]
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.
TYPE < nType > is the type of bargraph to create. < nType > is
a
numeric value starting with DCGRAPH_TYPE_* as defined in DCGRAPH.CH.
Type Description
-------------------------- ------------------------------------
DCGRAPH_TYPE_VERTICAL Vertical bars
DCGRAPH_TYPE_HORIZONTAL Horizontal bars
DATA < aData > is an array containing the numeric information and
text information for graphing. Each element of the array is a
sub-array of up to 4 elements as defined in the below table.
Element Type Description
------- ------- -----------------------------------------------
[1] N,A Data to graph. May be a numeric value for graphs
with only 1 bar or an array of numeric values for
graphs with 2 or more bars in each group.
[2] C Text prompt for the bar group.
[3] C,B Text ToolTip. This is a tooltip to display when
the mouse is moved over the text that defines
each bar group.
[4] C,A,B Bar ToolTip. This is a tooltip to display when the
mouse is moved over the bar. If element 1 is an
array, then this element must also be an array of
equal length. If this element is a NIL, then the
tooltip will be the numeric value of the bar.
[5] N,A,B Bar Color. This is the color of the bar. If element 1
is an array, then this element must also be an array
of equal length. If this element is a NIL, then the
default will be establish by the BARCOLOR clause.
[6] A Marker Line. This is a 2-element array containing:
[1] the numeric location of the marker on the bar and
[2] the numeric color of the marker. This will paint
a marker line on the bar. If element 1 is an array
this this element must also be an array of equal
length containing sub-arrays of 2 elements.
SIZE < nWidth >,< nHeight > is the width and height of the
graph. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
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 variable to use as a container for the
DC_BarGraph() object after it is created by the GUI reader.
BGCOLOR < abnBgColor > is the color of the background for the bar
area of the graph. < abnBgColor > may be numeric constants
which begin with either the prefix GRA_CLR_ or the prefix
XBPSYSCLR_ as defined in GRA.CH or XBP.CH. It may also be a
3-element array containing numeric values equivalent to RBG
colors. It may also be a code block that returns a numeric
value or a 3-element array.
TEXTFONT < cTextFont > is a character string defining an optional
font for the text defining each bar group. The font string must
conform to the Xbase++ standard, ie. "10.Arial Bold". It may also
be a font object or a code block that returns a character string
or an XbpFont() font object.
SCALEFONT < cScaleFont > is a character string defining an optional
font for the scale text. The font string must conform to the
Xbase++ standard, ie. "10.Arial Bold". It may also be a font
object or a code block that returns a character string or an
XbpFont() font object.
TEXTCOLOR < abnTextfgC >, < abnTextBgC > are foreground and
background
colors for the text defining each bar group. 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
or they may be 3-element arrays containing numeric RGB values or
they may be codeblocks that return a numeric value or an RGB array.
SCALECOLOR < abnScalefgC >, < abnScaleBgC > are foreground and
background
colors for the scale text. 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 or they may be
3-element arrays containing numeric RGB values or they may be
codeblocks that return a numeric value or an RGB array.
BARCOLOR < aBarColor > is an array of bar colors. This array must
be the same length as element 1 of < aData >. Each element of this
array may be a numeric color or a sub-array of 3 numeric RGB values.
LBDOWN < bLbDown > is a code block to evaluate when the left mouse is
clicked in the bar area of the graph. The code block receives two
values: 1. the numeric value of the bar group and 2. the numeric
value of the sub group.
RBDOWN < bRbDown > is a code block to evaluate when the right mouse is
clicked in the bar area of the graph. The code block receives two
values: 1. the numeric value of the bar group and 2. the numeric
value of the sub group.
MAXVALUE < nMaxValue > is the highest positive value to be graphed.
If the data exceeds this value, the bar will be truncated in the
display. If this clause is not used, then the maximum value will
default to the highest value in the < aData > array.
MINVALUE < nMinValue > is the lowest negative value to be graphed.
If the data exceeds this value, the bar will be truncated in the
display. If this clause is not used, then the minimum value will
default to the lowest value in the < aData > array.
SCROLLBUTTONS will paint a set of buttons on the graph to be used
for scrolling the graph data within the window. This clause
should be used when the scrolling range is less than the length
of the data array.
SCROLLRANGE < nScrollRange > is the number of bar groups to display
in the window. This should always be less than the length of the
data array.
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 < nSrow >, < nSCol > coordinates are
relative to the starting coordinates of < oRel > rather than
the parent object.
OBJECT < oObject > is the variable to use as a container for the
object after it is created by the GUI reader.
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.
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().
LINEMARKERS < aLineMarkers > is an array of sub-arrays defining
lines to be drawn across the graph at specified values.
Each sub-array contains 2 elements:
Element Type Description
------- ---- --------------------------------------------
[1] N Value on graph to draw line.
[2] N,A Color of line (GRA_CLR_*) or 3-element array
containing RGB colors.
Description:
The command @..DCBARGRAPH creates a new Bar Graph 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_BarGraph() object from
other DC_Xbp*() objects and activates the edit mode for all
definitions 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.
@..DCBARGRAPH objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON, @..DCTABPAGE, @..DCTABLE or @..DCHTML*.
Notes:
The bargraph object created by @ DCBARGRAPH is an object of the
DC_BarGraph() class which is made up of child elements of the
DC_XbpStatic() and DC_XbpPushButton() classes.
Examples:
#include "dcgraph.ch"
FUNCTION SalesGraph()
LOCAL i, aCaption, aBarColor, aData, oGraph, GetList[0], bLbDown, GetOptions,
;
oStaticText, oStaticGraph, aGraphData[0], nYear := 2000
aData := { ;
{ {10,-12,40}, ;
{22,16,20}, ;
{25,35,11}, ;
{20,25,88}, ;
{33,50,-99}, ;
{45,22,16}, ;
{57,90,77}, ;
{31,-44,55}, ;
{21,60,32}, ;
{51,11,28}, ;
{66,30,-19}, ;
{62,49,73} }, ;
{ {39,-52,50}, ;
{52,28,30}, ;
{75,25,31}, ;
{10,15,-28}, ;
{63,20,29}, ;
{35,-72,56}, ;
{27,-30,37}, ;
{51,14,-65}, ;
{21,40,32}, ;
{61,21,-18}, ;
{46,40,29}, ;
{32,59,23} }, ;
{ {20,-2,30}, ;
{32,6,10}, ;
{15,25,1}, ;
{10,15,78}, ;
{23,40,-89}, ;
{35,12,6}, ;
{47,80,67}, ;
{21,-34,45}, ;
{11,50,22}, ;
{41,1,18}, ;
{56,20,-9}, ;
{52,39,63} } }
nYear := 2000
_GetGraphData( aGraphData, @nYear, aData )
bLbDown := {|a,b|DC_DebugQOut({aGraphData[a,1,b]})}
aCaption := { 'Sales','Expenses','Profit' }
aBarColor := { GRA_CLR_BLUE, GRA_CLR_DARKPINK, GRA_CLR_GREEN }
@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT ;
SIZE 100,4 OBJECT oStaticText ;
COLOR GRA_CLR_BLACK, GRA_CLR_WHITE
@ .5,40 DCSAY {||'Year ' + Alltrim(Str(nYear))} SAYSIZE 20,2 FONT '18.Arial
Bold' ;
COLOR GRA_CLR_BLACK, GRA_CLR_WHITE GROUP 'GRAPH'
FOR i := 1 TO Len(aCaption)
@ 2.5,i*20 DCSAY aCaption[i] COLOR aBarColor[i] SAYSIZE 0 ;
FONT '14.Arial Bold' PARENT oStaticText
NEXT
@ 4,0 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT ;
SIZE 100,20 OBJECT oStaticGraph ;
COLOR GRA_CLR_BLACK, GRA_CLR_WHITE
@ 0,0 DCBARGRAPH ;
SIZE 100,20 ;
DATA aGraphData ;
RBDOWN bLbDown ;
LBDOWN bLbDown ;
TEXTFONT '12.Arial Bold' ;
SCALEFONT '8.Arial Bold' ;
TEXTCOLOR GRA_CLR_BLACK ;
SCALECOLOR GRA_CLR_BLACK ;
BARCOLOR aBarColor ;
TYPE DCGRAPH_TYPE_VERTICAL ;
SCROLLRANGE 6 ;
SCROLLBUTTONS ;
FONT '18.Arial Bold' ;
BGCOLOR GRA_CLR_YELLOW ;
PARENT oStaticGraph ;
OBJECT oGraph
@ 25,0 DCPUSHBUTTON CAPTION 'Prev Year' SIZE 11,1.2 ;
ACTION {||nYear--,_GetGraphData(aGraphData,@nYear,aData), ;
oGraph:refresh(), DC_GetRefresh(GetList,,,,'GRAPH')} ;
WHEN {||nYear} TOOLTIP 'Graph Previous Year' ;
GROUP 'GRAPH'
@ 25,13 DCPUSHBUTTON CAPTION 'Next Year' SIZE 11,1.2 ;
ACTION {||nYear++,_GetGraphData(aGraphData,@nYear,aData), ;
oGraph:refresh(), DC_GetRefresh(GetList,,,,'GRAPH')} ;
WHEN {||nYear} TOOLTIP 'Graph Next Year' ;
GROUP 'GRAPH'
DCGETOPTIONS ;
AUTORESIZE ;
TOOLTIPCOLOR GRA_CLR_BLACK, GRA_CLR_CYAN ;
TOOLTIPFONT '12.Courier'
DCREAD GUI FIT OPTIONS GetOptions TITLE 'Graph of Sales (2000-2002)'
RETURN nil
* -------------
STATIC FUNCTION _GetGraphData( aGraphData, nYear, aData )
LOCAL i, nPointer := nYear-1999, aMonths
aMonths := {'Jan','Feb','Mar','Apr','May','Jun','Jul', ;
'Aug','Sep','Oct','Nov','Dec'}
ASize(aGraphData,0)
FOR i := 1 TO 12
AAdd(aGraphData, { aData[nPointer,i], aMonths[i] } )
NEXT
RETURN nil
Source/Library:
_DCGRAPH.PRG, DCGRAPH.CH, DCLIPX.DLL
See Also:
dc_bargraph()
@ DCBROWSE
Create a BROWSE object for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCBROWSE < oBrowse > ;
[DATA < aoData > [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 > | < aEditEvent > ;
[ MODE < nbEditMode >] ;
[ 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 < nbThumbLock >] ;
* [NOVSCROLL] ;
* [NOHSCROLL] ;
* [NOSOFTTRACK] ;
* [NOSIZECOLS] ;
[GROUP < cGroup >] ;
* [HEADLINES < nHeaderLines > [DELIMITER < cHeadDelim >]] ;
* [FOOTLINES < nFooterLines > [DELIMITER < cFootDelim >]] ;
* [FIT [MAX < nMaxFitWidth >]] ;
* [OPTIMIZE] ;
[TITLE < cTitle >] ;
* [AUTOREFRESH < nTimer > [REFRESHBLOCK < bRefresh >] ;
[WHEN < bRefreshWhen >]] ;
... MORE Clauses ( See @ DCBROWSE (2) )
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 < aoData > defines the browse as an array browse or an object
browse. < aoData > is a variable containing a pointer to the
array to or object to browse. ELEMENT < nElement > is an optional
clause defining the selected element of if < aoData > is an array.
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.
If < aoData > is an object, then it must conform to one of the
following classes:
SQLStatement - SQLExpress
SQLDataSet - SQLExpress
dsACEServer - ACE Server
dbfServer - DBFSERVER
spSql - SPSQL Server
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 < nbEditMode > is
the navigation mode within the cells. < nbEditMode > is a numeric
value from the below table. If < nbEditMode > is a codeblock then
it must return a numeric value.
< 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.
< aEditEvent > is a 2-element array. The first element is the
same as that described above for < nEditEvent >. The second element
is a code block to evaluate when a key is pressed in the browse.
The value of the key pressed is passed to the code block. The
code block must return a numeric value equivalent to the key to
enter into the cell, or an array of numeric values to enter into
the cell. If a proper value is returned then cell editing will
start.
< 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. Note: Frozen columns cannot be resized.
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. Note: Frozen columns cannot be resized.
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 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. < 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 < nbThumbLock > 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 < nbThumbLock > is a numeric value and the database
contains more than < nbThumbLock > records 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. If
< nbThumbLock > is a numeric 0 then the thumb will be locked all the
time. If < nbThumbLock > is a codeblock, then the codeblock must
return a logical .T. to lock the thumb or .F. to unlock the thumb.
The codeblock is evaluated with DC_GetRefresh() or oBrowse:refreshAll().
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. The MAX < nMaxFitWidth > sub clause is used to set
the maximum width of the browse.
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. REFRESHBLOCK < bRefresh > is an
optional
code block to evaluate rather than using the default :refresh()
method. WHEN < bRefreshWhen > is an option codeblock to evaluate
to cause the refresh to occur only when the codeblock returns a
.TRUE. value.
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.
@..DCBROWSE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON, @..DCTABPAGE, @..DCTABLE or @..DCHTML*.
The command is broken into 2 sections to prevent problems
with the Microsoft Help Compiler. See @ .. DCSAY .. GET (2)
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:
@ DCBROWSE (2)
DCBROWSECOL
dc_getbrowarray()
dc_browserow()
@ DCBROWSE (2)
Create a BROWSE object for displaying with GUI reader
Syntax:
< < continued from @ DCBROWSE > >
[SORTSCOLOR < anSortedColorFG > [,< anSortedColorBG >] ];
[SORTUCOLOR < anUnSortedColorFG > [,< anUnSortedColorBG >]
] ;
[SORTNONCOLOR < anNonSortedColorFG >
[,< anNonSortedColorBG >] ];
[DESCENDING] ;
[NODESCENDTOGGLE] ;
[NORESTORE] ;
[FILTER < bFilter >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[RESIZECOLUMNS] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[TAGENABLE] ;
[TAGELEMENT < nTagElement >] ;
[TAGCOLOR < nTagColorFG >, < nTagColorBG >] ;
[TAGMODE < nTagMode >] ;
[SUBCLASS < cSubClass >] ;
[USEVISUALSTYLE] ;
[SCROLLBARTOOLTIP < bScrollBarTooltip >] ;
[OWNERDRAW < bOwnerDraw >] ;
[SCROLLBARHEIGHT < nScrollBarHeight >] ;
[NAVMODE < nNavMode >] ;
[RECORDOBJECT < oRecord >]
Arguments:
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.
SORTNONCOLOR < anNonSortedColorFG > [,< anNonSortedColorBG >]
is used to
set the color of the column headings that are not sortable columns.
DESCENDING is used to set the controlling sort order to descending.
NODESCENDTOGGLE is used to disable the toggling of the sort
order from ascending to descending on each successive click in
the heading column when using the SORT clause of DCBROWSECOL.
NOTE: The function DC_BrowseSort() is used to set the defaults
for the SORT* clauses.
NORESTORE will ignore the setting of DC_AutoRestoreBrowse() and
will not save/restore browses to the registry.
FILTER < bFilter > is used when browsing arrays only. The
< bFilter >
code block is passed a pointer to the current array row. The
code block must return a logical .TRUE. to include the element
in the browse, .FALSE. otherwise.
Example: @ .. DCBROWSE .. FILTER {|a|'.DBF'$Upper(a[1])}
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
RESIZECOLUMNS causes columns to be resized proportionally as the
browse width is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
TAGENABLE enables tag mode. This allows rows to be tagged or
untagged by using the Left Mouse and the Ctrl or Shift key,
similar to Windows Explorer. When browsing an array, the tag
is applied as a .TRUE. to a sub-element of the browse. The
logical element that holds the tag should be initialized to .FALSE.
for all rows. This element is defined by the TAGLEMENT
< nTagElement >
clause. When browsing a database, the tag is applied by using
the DC_RecTagToggle() function, thereby adding the record number
or removing the record number from an array named DC_RecTagArray().
TAGCOLOR < nTagColorFG >, < nTagColorBG > are foreground and
background
colors to apply to rows of the browse that have been tagged.
TAGMODE < nTagMode > determines the behavior when the mouse has
been clicked in a row and neither the Ctrl or the Shift key are
pressed. If < nTagMode > is DCGUI_TAGMODE_CLEAR, then all tags
of all rows will be cleared. If < nTagMode > is DCGUI_TAGMODE_SET,
then all tags of all rows will first be cleared, then the tag of
the clicked-on row will be set. See .\SAMPLES\TAGGING for an
example. TAGELEMENT may also be a character string when browsing
an array of objects. This would be the name of a logical iVar.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpBrowse().
This class should inherit from DC_XbpBrowse().
See the example in \exp19\samples\subclass.
USEVISUALSTYLE will enable Visual Styles selected by the Windows
operating system.
SCROLLBARTOOLTIP < bScrollBarToolTip > is a code block to evaluate
when the mouse is moved over the vertical scrollbar.
Example:
SCROLLBARTOOLTIP ;
{||'This is record ' + Alltrim(Str(COLLECT- >(DC_KeyNo()))) + ;
';of ' + Alltrim(Str(COLLECT- >(DC_KeyCount()))) + ' total records'}
OWNERDRAW < bOwnerDraw > is a code block to evaluate when the browse
cells are drawn by the owner rather than the default method. Two
parameters are passed to < bOwnerDraw >: oPS and aInfo. OWNERDRAW
provides the ownerdraw capability to the browse system. See the
example in .\samples\browse\ownerdraw.prg.
SCROLLBARHEIGHT < nScrollBarHeight > set the width and height of the
browse scrollbars in pixels. The default is 17.
NAVMODE < nNavMode > is an option that controls the way the browse
handles navigation. The default is XBPBRW_NAVIGATION_1XCOMPATIBLE.
The other option is XBPBRW_NAVIGATION_SYSTEM. This option is
available only in Xbase++ 2.0 or later. See the Alaska documentation
for XbpBrowse:navigationMode.
RECORDOBJECT < oRecord > is an optional record object created by
DC_DbRecord():new(). The is used in conjunction with DCBROWSECOL
DATA codeblocks that contain pointers to the record iVars. The
navigation code blocks of the browse force a oRecord:scatter() of
the record into the object before each row is painted. See the
sample program .\samples\dbrecord\browse.prg (Tab 3).
Description:
<þ<þ continued from @ DCBROWSE þ>þ>
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.
@..DCBROWSE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET, @..DCCHECKBOX,
@..DCRADIO, @..DCBUTTON, @..DCTABPAGE, @..DCTABLE or @..DCHTML*.
Source/Library:
DCDIALOG.CH
See Also:
DCBROWSECOL
dc_getbrowarray()
dc_browserow()
dc_browsecolor()
@ 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 >] ;
[ACTION < bAction >] ;
[RESIZE < bResize > [SCALEFONT] ] ;
[OPTIONS < nOptions >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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
ACTION < bAction > is a code block to evaluate when the checkbox is
selected.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
OPTIONS < nOptions > is a set of options to use to determine the
visual properties of the Checkbox. The options are numerical
definitions starting with BS_* and are defined in DCDIALOG.CH.
Note the most common option is BS_PUSHLIKE.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpCheckBox().
This class should inherit from DC_XbpCheckBox().
See the example in \exp19\samples\subclass.
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] ;
[IMMEDIATE] ;
[ITEMMARKED < bItemMarked >] ;
[ITEMSELECTED < bItemSelected >] ;
[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 > ;
[RESIZE < bResize > [SCALEFONT] ] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
IMMEDIATE will cause the data in the list box to be set into the
variable immediately when the item in the list box is marked,
otherwise the data will be set when the item is selected.
ITEMMARKED < bItemMarked > is a code block to evaluate each time an
item in the listbox is marked by moving the mouse over the item.
ITEMSELECTED < bItemSelected > is a code block to evaluate when the
mouse is clicked on an item in the listbox or the ENTER key is
pressed.
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.
NOTE: Due to anomolies in the event model of the XbpComboBox
class, < bLink > may be evaluated erratically, therefore it
it recommended that the ITEMSELECTED or ITEMMARKED clause
be used.
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpComboBox().
This class should inherit from DC_XbpComboBox().
See the example in \exp19\samples\subclass.
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 >] ;
[RESIZE < aResize >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >]
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
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] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[RESTYPE < cResType >] ;
[RESFILE < cResFile >] ;
[NORESTORE] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[SCROLLBARS < nScrollBars >]
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTON CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
NORESTORE will cause the dialog size and location to not be
saved and restored in the event that the DC_AutoRestoreWindow()
function is used.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpDialog().
This class should inherit from DC_XbpDialog().
See the example in \exp19\samples\subclass.
SCROLLBARS < nScrollBars > will cause scrollbars to automatically
appear in the drawingArea of the dialog window if a child object
is displayed outside the drawing area.
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 >] ;
[SAYINDEXFONT < cSayIndexFont >]
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)}
[8] C Picture clause.
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.
SAYINDEXFONT < cSayIndexFont > is the font of the Index Name prompt
to the right of the search window.
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 >] ;
[POPWHEN < bPopWhen >] ;
[POPHIDE < bPopHide >] ;
[HELPCODE < cHelp >] ;
* [PICTURE < bcPicture >] ;
[GETFONT < bocFont >] ;
* [UNREADABLE] ;
[PASSWORD [PASSCHAR < cPassChar >] [SHOWLASTCHAR] ;
* [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 >] ;
[WIDTH < nComboWidth >] ;
[DATA < acbComboData >] ;
[FIELD < bField >] ;
[ELEMENT < nElement >] ;
[RETURN < bReturn >] ;
[CAPTION < oncComboCaption >] ;
[FONT < ocComboButtonFont >] ;
[LISTFONT < ocComboListFont >] ;
[LISTPRESENTATION < aListPres >] ;
[HOTKEY < nComboHotKey >] ] ;
[KEYDROP] ;
[NAME < cVarName >] ;
* [CALCULATOR] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[ALIGN < nAlign >]
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.
< nGetWidth > may be assigned the value DCGUI_PARENTWIDTH -
< nOffset >.
This will set the width of the object relative to the width of its
parent.
< nGetHeight > may be assigned the value DCGUI_PARENTHEIGHT -
< nOffset >.
This will set the height of the object relative to the height of its
parent.
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 < bcPicture > is a character string specifying formatting
options for the value of < VarName > during display and editing.
If < bcPicture > is a code block, then the code block must return
a character string. The code block is evaluated by the DC_GetRefresh()
function.
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 two
parameters are passed to the codeblock :
1. The value in the current GET
2. A pointer to the GET object
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.
POPWHEN < bPopWhen > is a code block to evaluate to determine
whether the popup button is enabled or disabled. If the codeblock
returns a .T., then the button is enabled, otherwise it is
disabled.
POPHIDE < bPopHide > is a code block to evaluate to determine
whether the popup button is hidden. If the codeblock returns
a .T. then the button is hidden.
The UNREADABLE clause will cause text to be displayed as asterisks
(*) for inputting sensitive data such as passwords.
PASSWORD will cause asterisks to be displayed in place of the
value entered. This only affects the display, not the value
entered or returned. PASSCHAR is an optional clause to define
the character to be used as a replacement for the asterisk.
SHOWLASTCHAR is an optional clause that will show the last
character entered.
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.
NOEXITVALID < bValid > is a replacement for the VALID clause.
This will insure that the < bValid > codeblock is only validated
upon lost focus, and NOT validated with the EXITVALIDATE 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.
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. WIDTH < nComboWidth > is the width of the
picklist area in text columns or in pixels if the PIXEL clause is
used. If the WIDTH clause is not used, then 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. CAPTION < oncComboCaption > is the caption to place on the
popup button that invokes the listbox. This may be a character
string, a numeric resource, or an XbpBitMap() object.
FONT < ocComboButtonFont > is the font to use for the pushbutton
(if the caption is a character string). LISTFONT < ocComboListFont >
is the font to use for the listbox. LISTPRESENTATION
< aComboListPres >
is a presentation array defining the presentation parameters for
the listbox. HOTKEY < nComboHotKey > is the hot key to use to invoke
the listbox. KEYDROP will cause the combobox to drop down on
pressing the first key in the GET.
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.)
CALCULATOR causes inputting into a numeric GET to function
exactly like the CalcSle() example of Xbase++. The CalcSLE class
displays calculator-type entry fields for numeric values. The
display of entered data is right aligned, the number of decimal
places is unknown and the largest number to be entered is limited
by the width of the entry field.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpGet().
This class should inherit from DC_XbpGet().
See the example in \exp19\samples\subclass.
ALIGN < nAlign > specifies how the characters are aligned within
the GET object. By default, they are left justified.
Constants defined in the XBP.CH file should be used for < nAlign >
The following table lists the values available for the < nAlign >
option:
Constants for < nAlign > :
Constant Description
XBPSLE_LEFT Text is displayed left justified
XBPSLE_RIGHT Text is displayed right justified
XBPSLE_CENTER Text is displayed centered
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 >] ;
[FONT < bocFont >] ;
[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] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
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().
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpStatic().
This class should inherit from DC_XbpStatic().
See the example in \exp19\samples\subclass.
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
@ DCHTMLVIEWER
Create a Web Browser object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCHTMLVIEWER < oObject > ;
[SIZE < nWidth >, < nHeight >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[PREEVAL < bPreEval >] ;
[POSTEVAL < bPostEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[RESIZE < aResize >] ;
[NAVIGATE < url >] ;
[SETHTML < html >] ;
[BEFORENAVIGATE < bBeforeNav >] ;
[DOCCOMPLETE < bDocComplete >] ;
[NAVCOMPLETE < bNavComplete >] ;
[STATUSTEXTCHANGE < bStatChange >] ;
[PROGRESSCHANGE < cProgChange >] ;
[TITLECHANGE < bTitleChange >] ;
[SUBCLASS < cSubClass >]
;
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.
OBJECT < oObject > 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.
SIZE < nWidth >, < nHeight > defines the size of the object.
If no size is given, then the object will be automatically
sized to fit the caption. 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.
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 Static 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.
POSTEVAL < bPostEval > 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.
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
NAVIGATE < url > is a character string with the URL or document to
navigate to. This parameter may be specified as an URL,
full-qualified path or an Universal Naming Convention (UNC)
location and resource name.
SETHTML < html > is an HTML-formatted string to the internal buffer
of an XbpHTMLViewer object.
BEFORENAVIGATE < bBeforeNav > is a callback that is generated when the
XbpHTMLViewer object is about to navigate to a new HTML page or
document. The method :beforeNavigate() returns a logical value
that specifies whether navigation is allowed to commence. To
prevent navigation from occuring, the application must return
the value .F. (FALSE).
DOCCOMPLETE < bDocComplete > is a callback that is generated when
the XbpHTMLObject has finished loading a document.
NAVCOMPLETE < bNavComplete > is a callback that is generated when
the XbpHTMLObject has finished navigating to a link or document.
Note: The xbeHTML_BeforeNavigate notification is a synchronous
event. It is sent directly to the application via the XbpHTMLViewer
object's :handleEvent() method. The xbeHTML_BeforeNavigate event
code is not normally returned by the function AppEvent().
STATUSTEXTCHANGE < bStatChange > is a callback that is generated
whenever the status of the XbpHTMLViewer object changes. When a
document is loaded, for example, the object uses the
xbeHTML_StatusTextChange notification to send continous status
information, which the application may use for display in its
status bar.
PROGRESSCHANGE < cProgChange > is a callback that informs the
application about a change in progress of the current operation.
When a document is loaded, the object uses the
xbeHTML_ProgressChange notification to inform the application
about the progress made.
TITLECHANGE < bTitleChange > is a callback that is generated when
the title of the document displayed changes or becomes first
available.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpHtmlViewer().
This class should inherit from DC_XbpHtmlViewer().
See the example in \exp19\samples\subclass.
Description:
The command @..DCHTMLVIEWER creates a WebBrowser 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.
@..DCHTMLVIEWER objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The object created by @ DCHTMLVIEWER is an object of the
XbpHTMLViewer() class, therefore it can be manipulated with
any iVar or method supported by XbpHTMLViewer().
Examples:
See the example in SAMPLES\ACTIVEX\WEBBROW.PRG.
Source/Library:
DCDIALOG.CH
See Also:
@ DCACTIVEXCONTROL
@ 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 >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >]
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.)
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpListBox().
This class should inherit from DC_XbpListBox().
See the example in \exp19\samples\subclass.
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] ;
[RESIZE < aResize > [SCALEFONT] ]
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
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 >] ;
* [RESIZE < aResize > [SCALEFONT] ] ;
* [GOBOTTOM] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.)
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
GOBOTTOM will cause the cursor to scroll to the bottom of the
text in the mle object.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpMle().
This class should inherit from DC_XbpMle().
See the example in \exp19\samples\subclass.
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()
@ DCMXPUSHBUTTON
Create an MXPUSHBUTTON for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCMXPUSHBUTTON ;
[TYPE < nType >]
;
[SIZE < nWidth > [,< nHeight >]]
;
[CAPTION,CAPTION1 < ncoCaption1 >
;
[CAPOS,CA1POS < nCapRow >, < nCapCol >]
;
[CASIZE,CA1SIZE < nCapWidth >,
< nCapHeight >] ;
[CATYPE,CA1TYPE < nCapType >]
;
[CAFONT,CA1FONT < cCapFont >]
;
[CAPARAMS,CA1PARAMS < aCapParams >]
;
[CARESTYPE,CA1RESTYPE < cCapResType >]
;
[CARESFILE,CA1RESFILE < cCapResFile >] ]
;
[BITMAP,CAPTION2 < ncoCaption2 >
;
[BMPOS,CA2POS < nBmRow >, < nBmCol >]
;
[BMSIZE,CA2SIZE < nBmWidth >, < nBmHeight >]
;
[BMFONT,CA2FONT < cBmFont >]
;
[BMTYPE,CA2TYPE < nBmType >]
;
[BMPARAMS,CA2PARAMS < aBmParams >]
;
[BMRESTYPE,CA2RESTYPE < cBmResType >]
;
[BMRESFILE,CA2RESFILE < cBmResFile >] ]
;
[ICON,CAPTION3 < ncoCaption3 >
;
[ICPOS,CA3POS < nIcRow >, < nIcCol >]
;
[ICSIZE,CA3SIZE < nIcWidth >, < nIcHeight >]
;
[ICTYPE,CA3TYPE < nIcType >]
;
[ICFONT,CA3FONT < cIcFont >]
;
[ICPARAMS,CA3PARAMS < aIcParams >]
;
[ICRESTYPE,CA3RESTYPE < cIcResType >]
;
[ICRESFILE,CA3RESFILE < cIcResFile >] ]
;
[ACTION < bAction >]
;
[AUTOSIZE] ;
[POINTERFOCUS] ;
[PRESELECT] ;
[WHEN < bWhen >]
;
[MENU < oMenu >]
;
[PARENT < oParent >]
;
[PARENTID < cPID >]
;
[COLOR < ncFgC > [,< ncBgC >]]
;
[MESSAGE < cMsg > [INTO < oMsg >]]
;
[HELPCODE < cHelpCode >]
;
[FONT < cFont >]
;
[PRESENTATION < aPres >]
;
[PIXEL] ;
[OBJECT < oObject >]
;
[TOOLTIP < cToolTip >]
;
[CURSOR < nCursor >]
;
[CARGO < xCargo >]
;
[EVAL < bEval >]
;
[PREEVAL < bPreEval >]
;
[POSTEVAL < bPostEval >]
;
[HIDE < bHide >]
;
[EDITPROTECT < bProtect >]
;
[TITLE < cTitle > ]
;
[RELATIVE < oRel > ]
;
[ID < cId >]
;
[ACCELKEY < nAccel >]
;
[GOTFOCUS < bGotFocus >]
;
[LOSTFOCUS < bLostFocus >]
;
[TABSTOP]] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >]
;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >]
;
[SOUND < abSound >]
;
[CLASS < bcClass >]
;
[RESIZE < aReSize >]
;
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.
TYPE < nType > is the type of the MxPushButton.
MX_NONE, MX_3D, MX_RAISED, MX_FLAT, MX_FLYOVER defined in MX.CH.
Default is MX_NONE. (Standard PushButton)
Note: MX_3D and MX_RAISED are the same as MX_NONE
MX_FLAT does not respond to mouse movement
MX_FLYOVER is only raised when the mouse is positoned over the
Pushbutton
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
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.
CAPTION, CAPTION1 < cnoCaption1 > is caption #1 of the
PushButton object. 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.
CAPOS,CA1POS < nCapRow >,< nCapCol > are the row and column
coordinates
within the pushbutton of caption #1. If the PIXEL option is
set to .TRUE. then the numbers are in pixels otherwise they are
in standard text-based numbers.
CASIZE,CA1SIZE < nCapWidth >, < nCapHeight > are the width and
height
of caption #1. If the PIXEL option is set to .TRUE. then
the numbers are in pixels otherwise they are in standard text-based
numbers.
CATYPE,CA1TYPE < nCapType > is the type of caption for caption #1.
Standard types are XBPSTATIC_TYPE_TEXT, XBPSTATIC_TYPE_ICON,
or XBPSTATIC_TYPE_BITMAP. If this clause is not used then the
type is text and the caption must also be text.
CAFONT,CA1FONT < cCapFont > is the font for caption #1 if
the caption is type text. If this parameter is not used, then
the font defaults to 8.Arial.
;
CAPARAMS,CA1PARAMS < aCapParams > is an array of presentation
parameters for caption #1. This must match an object of
the type XbpStatic.
;
CARESTYPE,CA1RESTYPE < cCapResType > provides support for bitmap
resources of type BMP, PNG, GIF and JPEG that have been linked
into a .RES file to be used for caption #1.
Example: CARESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
CARESFILE,CA1RESFILE < cCapResFile > is the name of the .DLL that
contains the resource stated in the CARESTYPE < cCapResType > clause.
If this parameter is not used, then the resource must be in the
.EXE.
BITMAP, CAPTION2 < cnoCaption2 > is caption #2 of the
PushButton object. 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.
BMPOS,CA2POS < nBmRow >,< nBmCol > are the row and column
coordinates
within the pushbutton of caption #2. If the PIXEL option is
set to .TRUE. then the numbers are in pixels otherwise they are
in standard text-based numbers.
BMSIZE,CA2SIZE < nBmWidth >, < nBmHeight > are the width and
height
of the caption #2. If the PIXEL option is set to .TRUE. then
the numbers are in pixels otherwise they are in standard text-based
numbers.
BMTYPE,CA2TYPE < nBmType > is the type of caption for caption #2.
Standard types are XBPSTATIC_TYPE_TEXT, XBPSTATIC_TYPE_ICON,
or XBPSTATIC_TYPE_BITMAP. If this clause is not used then the
type is bitmap and the caption must also be a bitmap.
BMFONT,CA2FONT < cBmFont > is the font for the caption #2 if
the caption is type text. If this parameter is not used, then
the font defaults to 8.Arial.
;
BMPARAMS,CA2PARAMS < aBmParams > is an array of presentation
parameters for caption #2. This must match an object of
the type XbpStatic.
;
BMRESTYPE,CA2RESTYPE < cBmResType > provides support for bitmap
resources of type BMP, PNG, GIF and JPEG that have been linked
into a .RES file to be used for caption #2.
Example: BMRESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
BMRESFILE,CA2RESFILE < cBmResFile > is the name of the .DLL that
contains the resource stated in the BMRESTYPE < cBmResType > clause.
If this parameter is not used, then the resource must be in the
.EXE.
ICON, CAPTION3 < cnoCaption3 > is caption #3 of the
PushButton object. 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.
ICPOS,CA3POS < nIcRow >,< nIcCol > are the row and column
coordinates
within the pushbutton of caption #3. If the PIXEL option is
set to .TRUE. then the numbers are in pixels otherwise they are
in standard text-based numbers.
ICSIZE,CA3SIZE < nIcWidth >, < nIcHeight > are the width and
height
of the caption #3. If the PIXEL option is set to .TRUE. then
the numbers are in pixels otherwise they are in standard text-based
numbers.
ICTYPE,CA3TYPE < nIcType > is the type of caption for caption #3.
Standard types are XBPSTATIC_TYPE_TEXT, XBPSTATIC_TYPE_ICON,
or XBPSTATIC_TYPE_BITMAP. If this clause is not used then the
type is icon and the caption must also be an icon.
ICFONT,CA3FONT < cIcFont > is the font for the caption #3 if
the caption is type text. If this parameter is not used, then
the font defaults to 8.Arial.
;
ICPARAMS,CA3PARAMS < aIcParams > is an array of presentation
parameters for caption #3. This must match an object of
the type XbpStatic.
;
ICRESTYPE,CA3RESTYPE < cIcResType > provides support for bitmap
resources of type BMP, PNG, GIF and JPEG that have been linked
into a .RES file to be used for caption #3.
Example: ICRESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
ICRESFILE,CA3RESFILE < cIcResFile > is the name of the .DLL that
contains the resource stated in the ICRESTYPE < cIcResType > clause.
If this parameter is not used, then the resource must be in the
.EXE.
ACTION < bAction > is a codeblock that is to be evaluated
when the pushbutton is activated.
AUTOSIZE automatically fits the size of the pushbutton to the
caption.
POINTERFOCUS Indicates whether the pushbutton receives input focus
when the mouse is clicked on it.
PRESELECT determines whether the pushbutton initally has the 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.
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. The COLOR clause is supported
only when using the STATIC clause.
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 pushbutton object and activate its associated code block
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
Description:
The command @..DCMXPUSHBUTTON 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.
@..DCMXPUSHBUTTON objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCMULTILINE, @..DCCHECKBOX or @..DCTABPAGE.
@..DCMXPUSHBUTTON objects are derived from Joe Carrick's
MxPushButton class. Each object may contain up to 3 captions
of type text, bitmap or icon.
Notes:
The object created by @ DCMXPUSHBUTTON is an object of the
MxPushButton() class, therefore it can be manipulated with
any iVar or method supported by MxPushButton() class.
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.
The function DC_BitmapTransparentColor() may be used to set the
default transparent color for pushbuttons that have bitmaps as
captions.
Examples:
Run XDEMO.EXE - Sample Group 6 - MxPushButton
Source/Library:
DCMXBUTT.CH
See Also:
@ DCTOOLBAR
@ DCPUSHBUTTON
DCMXADDBUTTON
@ 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 >] ;
[RESIZE < aResize >]
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().
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
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] ;
[SUBCLASS < cSubClass >]
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.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpPickList().
This class should inherit from DC_XbpPickList().
See the example in \exp19\samples\subclass.
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 >] ;
[RESTYPE < cResType >] ;
[RESFILE < cResFile >]
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.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTON CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
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.
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
@ 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 >] ;
[LINECOLOR < anLineColorFG > [,< anLineColorBG >] ;
[AREACOLOR < anAreaColorFG > [,< anAreaColorBG >] ;
[GRAY < nGrayPct >]
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.
LINECOLOR < anLineColorFG >, < anLineColorBG > is the
foreground and
background color of the lines that make up the box. Arguments
may be numeric GRA* values as defined in GRA.CH or an array of
three (3) numeric variables representing the Red, Green and Blue
components of a RGB color (0-255).
AREACOLOR < anAreaColorFG >, < anAreaColorBG > is the
foreground and
background color of the area within the box. Arguments may be
numeric GRA* values as defined in GRA.CH or an array of three (3)
numeric variables representing the Red, Green and Blue components
of a RGB color (0-255).
GRAY < nGrayPct > will gray the area within the box. For a lighter
gray use a smaller number. For a darker gray use a larger number.
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 LINEATTR 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
@ DCPRINT LINE
Send Line to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol >, < nErow >, < nEcol >
DCPRINT LINE ;
[ATTRIBUTE < aAttr >] ;
[NOSCALE] [PIXEL] ;
[WHEN < bWhen >] ;
[COLOR < anColorFG > [,< anColorBG >] ;
[LINEWIDTH < nLineWidth >]
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.
COLOR < anColorFG >, < anColorBG > is the foreground and
background
color. Arguments may be numeric GRA* values as defined in GRA.CH
or an array of three (3) numeric variables representing the
Red, Green and Blue components of a RGB color (0-255).
LINEWIDTH < nLineWidth > is the line width in pixels or units.
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
@ DCPRINT MARKER
Send Marker to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol > DCPRINT MARKER ;
[ATTRIBUTE < aAttr >] ;
[NOSCALE] [PIXEL] ;
[WHEN < bWhen >] ;
[COLOR < anColorFG > [,< anColorBG >]
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.
COLOR < anColorFG >, < anColorBG > is the foreground and
background
color. Arguments may be numeric GRA* values as defined in GRA.CH
or an array of three (3) numeric variables representing the
Red, Green and Blue components of a RGB color (0-255).
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
@ DCPRINT RTF
Send RTF text to printer using @..SAY style printing
Syntax:
@ < nSrow >, < nScol > [, < nErow >, < nEcol >
] DCPRINT RTF < cRtf > ;
[PRINTER < oPrinter >] ;
[PIXEL] ;
[WHEN < bWhen >]
Arguments:
< nSrow >, < nScol >, < nErow >, < nEcol > are
the page coordinates
to print the text. 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.
< cRtf > is a variable containing the RTF text to print.
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.
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 RTF prints a RTF text on the page using
@..SAY style coordinates.
Source/Library:
DCPRINT.CH
See Also:
@ DCRTF
@ 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 >] ;
[COLOR < anColorFG > [,< anColorBG >]
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.
COLOR < anColorFG >, < anColorBG > is the foreground and
background
color. Arguments may be numeric GRA* values as defined in GRA.CH
or an array of three (3) numeric variables representing the
Red, Green and Blue components of a RGB color (0-255).
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:
@ 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] ;
[PERCENTCOLOR < nPercentColor >] ;
[FONT < ocFont >] ;
[RADIUS < nRadius >] ;
[OUTLINE] ;
[DYNAMIC] ;
[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 >] ;
[RESIZE < aResize >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
PERCENTCOLOR < nColor > sets the foreground color of the percent
text. The default is GRA_CLR_BLACK.
FONT < cFont > sets the font of the percent text.
RADIUS < nRadius > sets the radius of the corners of the progress
bar. The default is 0 (square corners).
The OUTLINE clause will paint a black outline around the progress
bar.
The DYNAMIC clause will cause the display of the percentage to
move dynamically, centered within the colored area of the progress
bar.
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpProgressBar().
This class should inherit from DC_XbpProgressBar().
See the example in \exp19\samples\subclass.
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 >]] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[RESTYPE < cResType >] ;
[RESFILE < cResFile >] ;
[ALIGNCAPTION < nAlign >] ;
[SOUND < cSound >] ;
[SCALEBITMAP] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
* 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. The COLOR clause is supported
only when using the STATIC clause.
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 pushbutton object and activate its associated code block
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTON CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
ALIGNCAPTION < nAlign > is a set of options to use to align the text
on the PushButton. The options are numerical definitions
starting with BS_* and are defined in DCDIALOG.CH.
Note the most common option is BS_MULTILINE.
SOUND < cSound > is the name of a .WAV file to play when the button
is clicked.
SCALEBITMAP will shrink or enlarge a bitmap caption to fit
exactly within the button size. Note: bitmaps should be 24-bit
(hi-color) for this to work correctly.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpPushButton().
This class should inherit from DC_XbpPushButton().
See the example in \exp19\samples\subclass.
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
@ DCPUSHBUTTONXP
dc_fancybuttonmode()
dc_regionarray()
@ DCPUSHBUTTONXP
Create a XP-Style PUSHBUTTON for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCPUSHBUTTONXP ;
[CAPTION < xCaption > [OFFSET < nCapOffset >]] ;
[BITMAP < xBitMap > [ALIGN < nBMAlign >] [OFFSET
< nBMOffset >] [SCALE < nBmpScale >]] ;
[CAPTIONARRAY < aCaptions >] ;
[SIZE < nWidth >, < nHeight >] ;
[ACTION < bAction >] ;
[MENUACTION < bMenuAction >] ;
[TILEBITMAP < xTile >] ;
[COLOR < bncFgC > [,< ncBgC >]] ;
[MOUSECOLOR < ncFGCMouse > [,< ncBgCMouse >]] ;
[MOUSESOUND < abMouseSound >] ;
[MOUSESCALE < nMouseScale >] ;
[MOUSEFONT < cMouseFont >] ;
[DISABLEDCOLOR < nDisabledBGColor >
[,< nDisabledFGColor >]] ;
[GRAYBITMAP] ;
[CLICKCOLOR < ncFgCClick > [,< ncBgCClick > >] ;
[GRADIENT < nGradStep > [REVERSE] [STYLE < nGradStyle >]
[LEVEL < nGradLevel >]] ;
[FOCUSRECT < nFocusRectStyle > [COLOR < nFocusRectColor >]]
;
[OUTLINE] ;
[BORDERCOLOR < nBorderColor >] ;
[RADIUS < nRadius >] ;
[SELECTENABLE [SELECTED] [SELECTCOLOR < nFGCSelect
[,< nBGCSelect >]] ;
[WHEN < bWhen >] ;
[HIDE < bHide > ;
[PARENT < oParent >] ;
[PARENTID < cParentID >] ;
[HELPCODE < cHelpCode >] ;
[FONT < bocFont >] ;
[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] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[RESTYPE < cResType >] ;
[RESFILE < cResFile >] ;
[SOUND < cSound >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[CONFIG < oConfig >] ;
[SHADOW < nShadowType >] ;
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 < xCaption > 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.
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 or a bitmap object.
BITMAP < xBitMap > may be a bitmap resource, a bitmap object, or
a code block. ALIGN < nBMAlign > is a numeric value, from XBP.CH
starting with XBALIGN_* that will determine how the bitmap will be
aligned on the button. Example: XBALIGN_LEFT+XBALIGN_CENTER.
OFFSET < nBMOffset > is the amount of offset, in pixels, of the bitmap
from the edge of the button to which it is aligned. SCALE
< nBmpScale >
is the scale factor of the bitmap. The default is 1.
CAPTIONARRAY < aCaptions > is an array of captions. This argument is
used in lieu of the CAPTION and BITMAP clauses above. Each subarray
in the array has the following structure:
Element Type Description
------- ------ --------------------------------------------------
[1] C/O Caption string or Bitmap object
[2] N Foreground color
[3] N Start Row, in pixels from top
[4] N Start Column, in pixels from top
[5] N End Row, in pixels from top (bitmap only)
[6] N End Column, in pixels from top (bitmap only)
[7] N Alignment. XBALIGN_* from XBP.CH.
[8] C Font compound name or Font object (caption only)
TILEBITMAP < xTile > is a bitmap resource or bitmap object to use
as a tiled background for the button.
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.
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. The COLOR clause is supported
only when using the STATIC clause.
MOUSECOLOR < ncFGCMouse >, < ncBgCMouse > are foreground and
background colors that will control the color of the button when
the mouse is moved over the button.
MOUSESOUND < abMouseSound > is a character string or code block that
returns the name of a .WAV file that will be used to play a sound
when the mouse is moved over the button.
MOUSEFONT < ocMouseFont > is a font compound name or font object
that defines the font to use for the caption text when the mouse
is moved over the button.
CLICKCOLOR < ncFGCClick >, < ncBgCClick > are foreground and
background colors that will control the color of the button when
the mouse is clicked on the button.
OUTLINE will cause the button to be outlined.
BORDERCOLOR < nBorderColor > defines the color of the outline.
DISABLEDCOLOR < nDisabledFGColor > and < nDisabledBGColor > are
used
to set the Foreground (text) and Background color of the button
when the button is disabled. GRAYBITMAP will also cause the
bitmap to be grayed out when disabled.
SELECTENABLE will enable a mode that allows a set of pushbuttons
(with the same parent) to behave like radio buttons. This will
set the ::selected flag when the button is pushed and thereby
color the button with the < nFGCSelect > and < nBGCSelect >
colors.
All other buttons with the same parent will be unselected.
SELECTED will set this button as the default selected button.
GRADIENT < nGradStep > is a positive number that determines the scale
of gradient to use, starting with the color of the background color.
REVERSE will reverse the gradient when the mouse is moved over the
button. LEVEL < nLevel > is a value to use to change the gradient
level. Run \exp19\samples\buttonxp\buttpicker.exe to try different
gradient levels. STYLE < nGradStyle > is the style of the gradient
based on the below table.
Style Description
------ ---------------------------
1 Vertical (top to bottom)
2 Vertical (bottom to top)
3 Horizontal (left to right)
4 Horizontal (right to left)
5 Concentric (inner to outer)
6 Concentric (outer to inner)
FOCUSRECT < nFocusRectStyle > is the style of rectangle to paint on
the button when it receives focus. See the below table.
< nFocusRectColor > is the color of the focus rectangle.
Style Description
------ ---------------------------
0 None
1 Dotted Interior
2 Normal Outline
3 Heavy Outline
ACTION < bAction > is a codeblock that is to be evaluated
when the pushbutton is activated.
MENUACTION < bMenuAction > is a codeblock that is to be evaluated
when the menu button (down arrow) is clicked. This clause will
cause a menu button, separated by a vertical line, to be painted
on the right side of the pushbutton.
RADIUS < nRadius > is how much to round the corners of the rectangle.
This is a positive integers which determines the distance (radius of
curvature) from a corner to the middle of the rectangle.
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.
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.
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 pushbutton object and activate its associated code block
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.
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTONXP CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
SOUND < cSound > is the name of a .WAV file to play when the button
is clicked.
SCALEBITMAP will shrink or enlarge a bitmap caption to fit
exactly within the button size. Note: bitmaps should be 24-bit
(hi-color) for this to work correctly.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
CONFIG < oConfig > is a configuration object that was previously
created with the DC_XbpPushButtonXPConfig():new() method.
Configuration parameters are defaulted to the values included
in the < oConfig > iVars.
SHADOW < nShadowType > is a value from 0 to 9. 0 indicates no
shadow. 1 thru 9 indicates a shadow of various styles.
Run \exp19\samples\buttonxp\buttpicker to try different styles.
Description:
The command @..DCPUSHBUTTONXP creates a new XP-Style 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.
@..DCPUSHBUTTONXP objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCMULTILINE, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
This command or class is only available in Xbase++ 1.9 (build 331
or later) because it uses the ownerdraw capability of the
XbpPushButton() class.
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 DCPUSHBUTTONXP buttons, see the sample program
in \exp19\samples\buttonxp.
The function DC_BitmapTransparentColor() may be used to set the
default transparent color for pushbuttons that have bitmaps as
captions.
DCPUSHBUTTONXP objects are created from the DC_XbpPushButtonXP()
class which is derived from the XbpPushButton() class.
Designing DCPUSHBUTTONXP objects to look exactly the way you
would want can be a time-consuming task, therefore it is
recommended that you use a special utility program for this
purpose. See \exp19\samples\buttonxp\buttpicker.exe.
Source/Library:
DCDIALOG.CH
See Also:
@ DCTOOLBAR
@ DCPUSHBUTTON
DCADDBUTTONXP
DC_XbpPushButtonXPConfig()
@ 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 >] ;
[RESIZE < aResize >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpQuickBrowse().
This class should inherit from DC_XbpQuickBrowse().
See the example in \exp19\samples\subclass.
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 >] ;
[RADIOGROUP < aRadioGroup >] ;
[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 >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[OPTIONS < nOptions >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
RADIOGROUP < aRadioGroup > is an optional array that must be
initialized as an empty array. This option eliminates the need
to have unique parents for each radio group. See the sample in
.\samples\radiogroup.
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.)
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
OPTIONS < nOptions > is a set of options to use to determine the
visual properties of the Radio Button. The options are numerical
definitions starting with BS_* and are defined in DCDIALOG.CH.
Note the most common option is BS_PUSHLIKE.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpPushButton().
This class should inherit from DC_XbpActiveXControl().
See the example in \exp19\samples\subclass.
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:
@ DCPRINT SAY
@ DCRMCHART
A command interface to RMChart graphing
Description:
@ DCRMCHART is a simpler command-based interface to the RMChart
ActiveX Control.
See the sample in .\samples\rmchart\dcchart.prg. New easy to
use commands : dcRmchart, dcAddBargroup, dcAddLineGroup,
dcAddDataAxis, dcChartregion gives you the power to create complex
charts. The include file dcgraph.ch contains the commands you can
use.
More documentation will be provided in a future release.
Source/Library:
_dcgraph.prg, dclipx.dll
@ DCRTF
Create a RTF editor object for displaying with GUI reader
Syntax:
@ < nRow > [,< nCol >] DCRTF
;
[VAR < uVar >]
;
[OBJECT < oObject >]
;
[SIZE < nWidth > [,< nHeight >]]
;
[PARENT < oParent >]
;
[PARENTID < cPID >]
;
[MESSAGE < cMsg > [INTO < oMsg >]]
;
[WHEN < bWhen >]
;
[HIDE < bHide >]
;
[HELPCODE < cHelpCode >]
;
[PRESENTATION < aPres >]
;
[TITLE < cTitle >]
;
[TOOLTIP < cToolTip >]
;
[CURSOR < nCursor >]
;
[CARGO < xCargo >]
;
[EVAL < bEval >]
;
[PREEVAL < bPreEval >]
;
[POSTEVAL < bPostEval >]
;
[PIXEL] ;
[RELATIVE < oRel >]
;
[ID < cId >]
;
[ACCELKEY < nAccel >]
;
[GOTFOCUS < bGotFocus >]
;
[LOSTFOCUS < bLostFocus >]
;
[TABSTOP] ;
[NOTABSTOP] ;
[TABGROUP < nTabGroup >]
;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >]
;
[CLASS < bcClass >]
;
[RESIZE < aReSize > [SCALEFONT]]
;
[APPEARANCE < nAppearance >]
;
[MAXLENGTH < nMaxLen >]
;
[RIGHTMARGIN < nRightMargin >]
;
[SCROLLBARS < nScrollBars >]
;
[POPUPMENU < oPopupMenu >]
;
[USEPOPUPMENU] ;
[BULLETINDENT < nBulletIndent >]
;
[HIDESELECTION] ;
[LOCKED] ;
[FILE < cFileName >]
;
[SELCHANGE < bSelChange >]
;
[CHANGE < bChange >] ;
;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
OBJECT < oObject > 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.
SIZE < nWidth >, < nHeight > defines the size of the object.
If no size is given, then the object will be automatically
sized to fit the caption. 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.
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 Static 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.
POSTEVAL < bPostEval > 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.
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
APPEARANCE < nAppearance > determines the appearance ofthe control.
The following options are defined in XBP.CH.
XBP_APPEARANCE_FLAT Flat style
XBP_APPEARANCE_3D *) Three-dimensional style, object display a 3D border
*) Default value
MAXLENGTH < nMaxLength > is a numerical value that specifies the
maximum
number of characters the XbpRtf object can hold. If the value 0 is
assigned to < nMaxLength > (default), the number of characters that can
be entered into the edit control is not restricted and is limited only
by available memory.
RIGHTMARGIN < nRightMargin > is a numeric value that specifies the
right
margin. Text entered into the XbpRtf object is wrapped at or centered
with respect to the margin specified in < nRightMargin > . The value
is interpreted as an offset from the XbpRtf object's right edge.
SCROLLBARS < nScrollBars > is a numeric value used to determine the
scrollbars on the object.
Constant Description
XBP_SCROLLBAR_NONE No scroll bar is displayed
XBP_SCROLLBAR_HORIZ Horizontal scroll bar is displayed if text
buffer is wider than can be displayed
XBP_SCROLLBAR_VERT Vertical scroll bar is displayed if text buffer
has more lines than fit into display area
The contants XBP_SCROLLBAR_HORIZ and XBP_SCROLLBAR_VERT can be combined
to have the XbpRtf object display both a horizontal and a vertical scroll
bar, if required. To do that, the contants must be added.
POPUPMENU < oPopupMenu > contains an object derived from the XbpMenu
class.
The menu object is used to display a popup menu if the user presses the
right mouse button over the edit control. The menu is opened also if the
SHIFT+F10 key combination is entered. If < oPopupMenu > contains the
value
NIL, a default menu is used that contains menu items for copying, pasting
and deleting text.
The display of the object's popup menu can be switched off by assigning
the value .F. (FALSE) to the instance variable :usePopupMenu.
BULLETINDENT < nBulletIndent > defines the indentation used for
paragraphs
preceeded by a bullet. To preceeded a paragraph with a bullet, the
:selBullet instance variable must be set to .T. (TRUE).
HIDESELECTION The specifies whether selected text should remain
highlighted when the XbpRtf object loses the input focus. Per default,
selected text is displayed highlighted only when the edit control has
input focus. To change that behviour, an Xbase++ application can assign
the value .F. (FALSE) to the :hideSelection instance variable.
LOCKED or the :locked instance variable specifies whether the XbpRtf
object is currently locked. If .T. (TRUE) is assigned to this instance
variable, text in the edit control cannot be edited.
Note: The value contained in :locked superceeds that in the :selReadOnly
instance variable. If :locked is TRUE, the text cannot be edited,
irrespective of the value assigned to :selReadOnly .
FILE < cFileName > is the name of the file to load into the RTF
control.
SELCHANGE < bSelChange > is a callback codeblock {| uNIL1, uNIL2, self
| ... }
to evaluate when the contents of the XbpRtf object's text buffer changes.
This usually indicates that the user has moved the cursor in the text buffer.
CHANGE < bChange > is a callback codeblock {| uNIL1, uNIL2, self | ...
}
to evaluate when the selection in the text buffer is changed.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpRtf().
This class should inherit from DC_XbpRtf().
See the example in \exp19\samples\subclass.
Description:
The command @..DCRTF creates a RTF Editor 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.
@..DCRTF objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The object created by @ DCRTF is an object of the
XbpRTF() class, therefore it can be manipulated with
any iVar or method supported by XbpRTF().
Examples:
See the example in SAMPLES\RTF
Source/Library:
DCDIALOG.CH
@ 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 >] ;
[NOEXITVALID < bValid >] ;
* [UNREADABLE] ;
* [CONFIRM] ;
* [NOCONFIRM] ;
[POPUP < bPopUp > ;
[POPCAPTION < ncCaption] ;
[POPFONT < cPopFont >] ;
[POPWIDTH < nPopWidth >] ;
[POPHEIGHT < nPopHeight >] ;
[POPSTYLE < nPopStyle >] ;
[POPKEY < anPopKey >] ;
[POPTABSTOP] ;
[POPGLOBAL] ] ;
[POPTOOLTIP < bcPopToolTip >] ;
[POPWHEN < bPopWhen >] ;
[POPHIDE < bPopHide >] ;
* [PROPER ;
[PROPOPTIONS < aPropOptions >]] ;
[PASSWORD [PASSCHAR < cPassChar >] [SHOWLASTCHAR] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
* [EDITPROTECT < bProtect >] ;
* [SAYOPTIONS < nSayOpt > | SAYRIGHT | SAYLEFT | SAYCENTER] ;
[ALIGNRIGHT] ;
[HELPCODE < cHelp >] ;
* [PICTURE < bcPicture >] ;
* [PIXEL] ;
* [SAYPRESENTATION < aSayPres >] ;
* [GETPRESENTATION < aGetPres >] ;
[SAYTOOLTIP < bcSayToolTip >] ;
[GETTOOLTIP < bcGetToolTip >] ;
[SAYOBJECT < oSayObject >] ;
[GETOBJECT < oGetObject >] ;
* [SAYCURSOR < naSayCursor >] ;
* [GETCURSOR < naGetCursor >] ;
[SAYCARGO < xSayCargo >] ;
[GETCARGO < xGetCargo >] ;
[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 >] ;
< more clauses... See @ DCSAY GET (2)
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 < bcPicture > is a character string specifying formatting
options for the value of < VarName > during display and editing.
If < bcPicture > is a code block, then the code block must return
a character string. The code block is evaluated by the DC_GetRefresh()
function.
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 .F. (false), 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.
NOEXITVALID < bValid > is a replacement for the VALID clause.
This will insure that the < bValid > codeblock is only validated
upon lost focus, and NOT validated with the EXITVALIDATE 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.
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 tw0
parameters are passed to the codeblock :
1. The value in the current GET
2. A pointer to the GET object
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.
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 < nPopStyle > is the style of the popup button:
POPSTYLE < nPopStyle > 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.
POPWHEN < bPopWhen > is a code block to evaluate to determine
whether the popup button is enabled or disabled. If the codeblock
returns a .T., then the button is enabled, otherwise it is
disabled.
POPHIDE < bPopHide > is a code block to evaluate to determine
whether the popup button is hidden. If the codeblock returns
a .T. then the button is hidden.
PASSWORD will cause asterisks to be displayed in place of the
value entered. This only affects the display, not the value
entered or returned. PASSCHAR is an optional clause to define
the character to be used as a replacement for the asterisk.
SHOWLASTCHAR is an optional clause which will show the actual
last character entered.
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)
SAYPRESENTATION < aSayPres > is a two-dimensional array. If
specified, this contains presentation parameters for the SAY
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.
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.
SAYOPTIONS < nSayOpt > is a set of options that can be used to
align the text within the rectangular area of the SAY object.
Constants defined in the XBP.CH file are used for these options.
If combinations of alignment options are required, the sum of
the appropriate constants must be included in < nSayOpt >.
The below constants are defined in XBP.CH.
XBPSTATIC_TEXT_LEFT Text is left aligned
XBPSTATIC_TEXT_CENTER Text is horizontally centered
XBPSTATIC_TEXT_RIGHT Text is right aligned
XBPSTATIC_TEXT_TOP Text is displayed at top
XBPSTATIC_TEXT_VCENTER Text is vertically centered
XBPSTATIC_TEXT_BOTTOM Text is displayed at bottom
XBPSTATIC_TEXT_WORDBREAK Text is wrapped (multi-line)
An alternate method of aligning text is by using the following
defines in place of SAYOPTIONS < nSayOpt >:
SAYRIGHT
SAYLEFT
SAYRIGHTBOTTOM
SAYLEFTBOTTOM
SAYCENTERBOTTOM
SAYRIGHTCENTER
SAYLEFTCENTER
SAYRIGHTTOP
SAYLEFTTOP
SAYCENTER
SAYHCENTER
SAYBOTTOM
SAYBOTTOMLEFT
SAYBOTTOMRIGHT
SAYTOP
SAYTOPCENTER
SAYVCENTER
SAYHVCENTER
SAYWORDBREAK
ALIGNRIGHT causes the end of the SAY object to align with the
column given rather than the start of the SAY object.
SAYTOOLTIP < bcSayTool > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the Say 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.
GETTOOLTIP < bcGetTool > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the Get 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.
SAYOBJECT < oSayObject > is the name of the variable to store a
pointer to the SAY object after it is created.
GETOBJECT < oGetObject > is the name of the variable to store a
pointer to the GET object after it is created.
SAYCURSOR < nSayCursor > is an optional mouse pointer to use for
the SAY portion of the SAY..GET. 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.
GETCURSOR < naGetCursor > and SAYCURSOR < naSayCursor > 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.
< naGetCursor > / < naSayCursor > 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. < naGetCursor > /
< naSayCursor >
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.
SAYCOLOR < bncSayFGc >, < ncSayBGc > are foreground and
background
colors for the SAY text. 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 < bncSayFGc > is a code block is must return a 2-element array
containing a foreground and background color.
GETCOLOR < bncGetFGc >, < ncGetBGc > are foreground and
background
colors for the GET. 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
< bncGetFGc > is a code block is must return a 2-element array
containing a foreground and background color.
SAYID < cSayId > is a unique identifier for the SAY portion of this
object. This ID is used with functions like DC_GETOBJECT() to
determine the status of a getlist object.
GETID < cGetId > is a unique identifier for the GET portion of this
object. This ID is used with functions like DC_GETOBJECT() to
determine the status of a getlist object.
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 the
GET object receives input focus. < bGotFocus > :=
{|uNIL1,uNIL2,self|...}
LOSTFOCUS < bLostFocus > is a code block that is evaluated when the
GET 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.
Description:
The command @..DCSAY...GET creates a new Get object and
adds the object 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 activates the
the edit mode for all Get objects found in the GetList array.
The command DCREAD HTML writes the HTML source code to render
the objects in a Web Browser.
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. This GetList is then passed to the
function DC_ReadGui() which creates the objects and starts
an event handler, or the GetList can be be passed to the
function DC_ReadHtml() which creates the objects and writes
HTML source.
The command is broken into 2 sections to prevent problems
with the Microsoft Help Compiler. See @ .. DCSAY .. GET (2)
Notes:
Clauses marked by an asterisk ( * ) are not supported by
DCREAD HTML or DC_ReadHtml().
------------------
GUI applications:
The SAY object created by @ DCSAY..GET is an object of the
DC_XbpStatic() class unless the GRASTRING clause is used. The
GRASTRING clause causes the say to be painted by the GraStringAt()
function and does not create an object. DC_XbpStatic()
inherits from XbpStatic()
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 SAY object created by @ DCSAY..GET is an object of the
DC_HtmlSay() class.
The GET object created by @ DCSAY..GET is an object of the
DC_HtmlGet() class.
Examples:
/* Example 1 (Simple Gets) */
#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) */
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
This example shows @ DCSAY..GETs which do direct edits into a
database. The GET variable is a code-block that automatically
handles locking/unlocking and macros. In this example, all
screen dialog is data-driven. */
LOCAL GetList := {}, aData, i, bBlock, bValid, bWhen
CLOSE ALL
USE COLLECT NEW EXCL
aData := { { 1, 1, 'Description', 'COLLECT->descrip', '@!', ;
'!Empty(COLLECT->descrip)', '.T.' }, ;
{ 3, 1, 'Original Price', 'COLLECT->orig_price', '9999.99', ;
'.T.','.T.'}, ;
{ 5, 1, 'Date Acquired', 'COLLECT->date_acqu', '', ;
'.T.', '.T.' } }
FOR i := 1 TO Len(aData)
bBlock := _XTest3(aData[i,4],1)
bValid := _XTest3(aData[i,6],2)
bWhen := _XTest3(aData[i,7],2)
@ aData[i,1], aData[i,2] DCSAY aData[i,3] GET bBlock ;
PICTURE aData[i,5] ;
VALID bValid ;
WHEN bWhen ;
SAYRIGHT ;
SAYSIZE 15
NEXT
DCREAD GUI FIT ADDBUTTONS
RETURN nil
/* -------------------- */
STATIC FUNCTION _XTest3( xValue, nMode )
IF nMode = 1 // Field Anchor
RETURN {|x|IIF(x==nil,&xValue,IIF(dbRLock(),&xValue:=x,nil)), ;
IIF(!(x==nil),dbUnlock(),nil),&xValue }
ENDIF
RETURN {||&xValue} // VALID or WHEN Anchor
/* Example 4 - This example shows @ DCSAY..GET ... COMBO. */
PROCEDURE XTest_5()
LOCAL GetList := {}, cCode, aCodes, aCodeDesc
aCodes := { 'A','B','C'}
aCodeDesc := { 'Selection A', ;
'Selection B', ;
'Selection C' }
cCode := aCodes[1]
@ 1,1 DCSAY 'Enter Code' GET cCode GETSIZE 15 ;
COMBO HEIGHT 6 DATA aCodeDesc RETURN {|n|aCodes[n]}
DCREAD GUI FIT ADDBUTTONS TITLE 'Combo Test'
RETURN
Source/Library:
DCDIALOG.CH
See Also:
@ DCSAY GET (2)
dc_getpopupcaption()
@ DCGET
dc_getcombomode()
@ DCSAY GET (2)
Create a SAY..GET object for displaying with the text/GUI reader
Syntax:
< < continued from @ DCSAY GET > >
* [COMBO ;
[HEIGHT < nComboHeight >] ;
[WIDTH < nComboWidth >] ;
[DATA < acbComboData >] ;
[FIELD < bField >] ;
[ELEMENT < nElement >] ;
[RETURN < bReturn >] ;
[CAPTION < oncComboCaption >] ;
[FONT < ocComboButtonFont >] ;
[LISTFONT < ocComboListFont >] ;
[LISTPRESENTATION < aListPres >] ;
[HOTKEY < nComboHotKey >] ] ;
[KEYDROP] ;
* [GRASTRING] ;
[NAME < cVarName >] ;
* [HYPERLINK < bHyperLink >] ;
* [CALCULATOR] ;
[SAYRESIZE < aSayResize > [SCALEFONT] ] ;
[GETRESIZE < aGetResize > [SCALEFONT] ] ;
[SAYDRAG < bSayDrag > [DIALOG < bSayDD >] ;
[SAYDROP < bSayDrop > [CURSOR < nSayDropCursor >]
[GETDRAG < bGetDrag > [DIALOG < bGetDD >] ;
[GETDROP < bGetDrop > [CURSOR < nGetDropCursor >] ;
[SAYSUBCLASS < cSaySubClass >] ;
[GETSUBCLASS < cGetSubClass >] ;
[FORMATTED] ;
[GETALIGN < nGetAlign >] ;
[SAYPREEVAL < bSayPreEval >] ;
[GETPREEVAL < bGetPreEval >] ;
[SAYEVAL < bSayEval,... >] ;
[GETEVAL < bGetEval,... >] ;
Arguments:
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. WIDTH < nComboWidth > is the width of the
picklist area in text columns or in pixels if the PIXEL clause is
used. If the WIDTH clause is not used, then 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. CAPTION < oncComboCaption > is the caption to place on the
popup button that invokes the listbox. This may be a character
string, a numeric resource, or an XbpBitMap() object.
FONT < ocComboButtonFont > is the font to use for the pushbutton
(if the caption is a character string). LISTFONT < ocComboListFont >
is the font to use for the listbox. LISTPRESENTATION
< aComboListPres >
is a presentation array defining the presentation parameters for
the listbox. HOTKEY < nComboHotKey > is the hot key to use to invoke
the listbox. KEYDROP will cause the combobox to drop down on
pressing the first key in the GET.
GRASTRING will use the GraStringAt() function to paint the SAY
portion rather than an XbpStatic() object. This uses less
memory resources. Note: because an object does not exist, the
say text cannot be manipulated at run time.
CAUTION: Do not use GRASTRING clause 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.
SAYPREEVAL < bSayPreEval > is a code block to be evaluated by the
GUI reader before the SAY object is created. The object is
passed to the code block.
SAYEVAL < bSayEval > is a code block to evaluate after the SAY
object is created. The XbpStatic object will be passed to the
code block.
GETPREEVAL < bGetPreEval > is a code block to be evaluated by the
GUI reader before the GET object is created. The object is
passed to the code block.
GETEVAL < bGetEval > is a code block to evaluate after the GET
object is created. The XbpGet object will be passed to the
code block.
SAYTITLE < cSayTitle > is a title to assign to the SAY object. ;
The title is not displayed on the screen but is simply a
description of the say object which is saved in the GetList.
GETTITLE < cGetTitle > is a title to assign to the GET 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.)
HYPERLINK < bHyperLink > will underline the say text and perform
an action when the say text is clicked with the mouse.
Ex: @ 1,1 DCSAY 'http://www.donnay-software.com' ;
COLOR GRA_CLR_BLUE ;
SAYSIZE 0 ;
HYPERLINK ;
{|p,c|p := 'url.dll,FileProtocolHandler ' + ;
'http://www.donnay-software.com', ;
c := 'Rundll32.exe', ;
RunShell(p,c,.t.,.t.)}
CALCULATOR causes inputting into a numeric GET to function
exactly like the CalcSle() example of Xbase++. The CalcSLE class
displays calculator-type entry fields for numeric values. The
display of entered data is right aligned, the number of decimal
places is unknown and the largest number to be entered is limited
by the width of the entry field.
SAYRESIZE < aSayResize > is an optional array of two (2) elements
used for resizing and repositioning the SAY text when the parent
is resized.
GETRESIZE < aGetResize > is an optional array of two (2) elements
used for resizing and repositioning the GET when the parent
is resized.
NOTE: SAYRESIZE and GETRESIZE are to be used in conjunction with
the RESIZE clause of DCGETOPTIONS. See the RESIZE clause of
DCGETOPTIONS for examples. The optional SCALEFONT clause will
automatically scale the font size up or down when the object
is resized.
SAYDRAG < bSayDrag > and GETDRAG < bGetDrag > is a codeblock to
evaluate
when the left mouse button is clicked in the object and the drag is
started. The return value of the code block will be stored in memory
to be later retrieved by the Drop operation. A pointer to the clicked
on object is passed to the code block.
DIALOG < bSayDD > and < bGetDD > is a codeblock that will
evaluate when
the drag is started. This is used to call a function that will create
a dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: GETDRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
SAYDROP < bSayDrop > and GETDROP < bGetDrop > is a codeblock to
evaluate
when the left mouse button is released in the object and the drag is
ended. A pointer to the object and the value stored in memory at the
start of the Drag are passed to the code block.
CURSOR < nSayDropCursor > and < nGetDropCurors > is the mouse
cursor that
will show when it is moved over this object during a drag operation.
Ex: GETDROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SAYSUBCLASS < cSaySubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpStatic().
This class should inherit from DC_XbpStatic().
See the example in \exp19\samples\subclass.
GETSUBCLASS < cGetSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpGet().
This class should inherit from DC_XbpGet().
See the example in \exp19\samples\subclass.
FORMATTED is used to allow for displaying of formatted text with
bold, italic, underline, tabbed or indented characters. See the
sample program in .\samples\static\formatted.prg
GETALIGN < nGetAlign > specifies how the characters are aligned within
the GET object. By default, they are left justified.
Constants defined in the XBP.CH file should be used for < nGetAlign >
The following table lists the values available for the < nGetAlign >
option:
Constants for < nAlign > :
Constant Description
XBPSLE_LEFT Text is displayed left justified
XBPSLE_RIGHT Text is displayed right justified
XBPSLE_CENTER Text is displayed centered
SAYPREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the SAY object is created. The object is passed to
the code block.
SAYEVAL < bEval > is a code block to be evaluated by the GUI reader
after the SAY object is created. The object is passed to the code
block.
GETPREEVAL < bPreEval > is a code block to be evaluated by the GUI
reader before the GET object is created. The object is passed to
the code block.
GETEVAL < bEval > is a code block to be evaluated by the GUI reader
after the GET object is created. The object is passed to the code
block.
Description:
<þ<þ continued from @ DCSAY GET þ>þ>
The command @..DCSAY...GET creates a new Get object and
adds the object 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 activates the
the edit mode for all Get objects found in the GetList array.
The command DCREAD HTML writes the HTML source code to render
the objects in a Web Browser.
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. This GetList is then passed to the
function DC_ReadGui() which creates the objects and starts
an event handler, or the GetList can be be passed to the
function DC_ReadHtml() which creates the objects and writes
HTML source.
Notes:
Clauses marked by an asterisk ( * ) are not supported by
DCREAD HTML or DC_ReadHtml().
------------------
GUI applications:
The SAY object created by @ DCSAY..GET is an object of the
DC_XbpStatic() class unless the GRASTRING clause is used. The
GRASTRING clause causes the say to be painted by the GraStringAt()
function and does not create an object. DC_XbpStatic()
inherits from XbpStatic()
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 SAY object created by @ DCSAY..GET is an object of the
DC_HtmlSay() class.
The GET object created by @ DCSAY..GET is an object of the
DC_HtmlGet() class.
Examples:
/* Example 1 (Simple Gets) */
#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) */
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
This example shows @ DCSAY..GETs which do direct edits into a
database. The GET variable is a code-block that automatically
handles locking/unlocking and macros. In this example, all
screen dialog is data-driven. */
LOCAL GetList := {}, aData, i, bBlock, bValid, bWhen
CLOSE ALL
USE COLLECT NEW EXCL
aData := { { 1, 1, 'Description', 'COLLECT->descrip', '@!', ;
'!Empty(COLLECT->descrip)', '.T.' }, ;
{ 3, 1, 'Original Price', 'COLLECT->orig_price', '9999.99', ;
'.T.','.T.'}, ;
{ 5, 1, 'Date Acquired', 'COLLECT->date_acqu', '', ;
'.T.', '.T.' } }
FOR i := 1 TO Len(aData)
bBlock := _XTest3(aData[i,4],1)
bValid := _XTest3(aData[i,6],2)
bWhen := _XTest3(aData[i,7],2)
@ aData[i,1], aData[i,2] DCSAY aData[i,3] GET bBlock ;
PICTURE aData[i,5] ;
VALID bValid ;
WHEN bWhen ;
SAYRIGHT ;
SAYSIZE 15
NEXT
DCREAD GUI FIT ADDBUTTONS
RETURN nil
/* -------------------- */
STATIC FUNCTION _XTest3( xValue, nMode )
IF nMode = 1 // Field Anchor
RETURN {|x|IIF(x==nil,&xValue,IIF(dbRLock(),&xValue:=x,nil)), ;
IIF(!(x==nil),dbUnlock(),nil),&xValue }
ENDIF
RETURN {||&xValue} // VALID or WHEN Anchor
/* Example 4 - This example shows @ DCSAY..GET ... COMBO. */
PROCEDURE XTest_5()
LOCAL GetList := {}, cCode, aCodes, aCodeDesc
aCodes := { 'A','B','C'}
aCodeDesc := { 'Selection A', ;
'Selection B', ;
'Selection C' }
cCode := aCodes[1]
@ 1,1 DCSAY 'Enter Code' GET cCode GETSIZE 15 ;
COMBO HEIGHT 6 DATA aCodeDesc RETURN {|n|aCodes[n]}
DCREAD GUI FIT ADDBUTTONS TITLE 'Combo Test'
RETURN
Source/Library:
DCDIALOG.CH
See Also:
@ DCSAY GET
dc_getpopupcaption()
@ DCGET
dc_getcombomode()
@ DCSCROLLBAR
Create a SCROLL BAR object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCSCROLLBAR ;
[DATA < uVar >] ;
[SIZE < nWidth > [,< nHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[PRESENTATION < aPres >] ;
[TYPE < nType >] ;
[SCROLL < bScroll >] ;
[OBJECT < oBar >] ;
[RANGE < nBott >,< nTop >] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < naCursor >] ;
[CARGO < xCargo >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[AUTOTRACK] ;
[PIXEL] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[RESIZE < aResize >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >]
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.
DATA < uVar > is the input/output variable. It must not be a macro
unless < uVar > is a codeblock 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.
TYPE < nType > is the type of Scrollbar. It determines whether
a horizontal or vertical scroll bar is created. Either the
constant XBPSCROLL_HORIZONTAL or the constant XBPSCROLL_VERTICAL
must be used for this option. These constants are defined in
the XBP.CH file.
OBJECT < oObject > is the name of a local variable to assign
to this ScrollBar object.
SCROLL < bScroll is a code block that is evaluated when the
mouse is clicked in the scroll-bar area. The code-block
should be in the following form:
{| aScroll, uNIL, self | ... }
< aScroll > := { nScrollBoxPos, nCommand }
< aScroll > is an array containing two elements. The first
element contains the new position of the scroll box and the
second element contains a numeric code identifying the action
that was executed. Constants are defined for the actions
that may appear in the second element. These constants are
defined in the XBP.CH file and are listed in the following
table:
XBPSB_PREVPOS Went back one position
XBPSB_NEXTPOS Went forward one position
XBPSB_PREVPAGE Went back one page
XBPSB_NEXTPAGE Went forward one page
XBPSB_SLIDERTRACK Scroll box clicked with a mouse button
XBPSB_ENDTRACK Continuous scrolling using the scroll box
has ended
XBPSB_ENDSCROLL Continuous scrolling using the scroll button
has ended
RANGE < nMin >, < nMax > defines the minimum and maximum values
of
the scroll bar. The range is limited by the operating system
to values between -32768 and 32768.
SIZE < nWidth >,< nHeight > is the width and height of the
ScrollBar 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.
AUTOTRACK causes the current position of the scroll box to be
automatically updated. The default action is to require the
scrollbar to be updated by using the method :setData(). In
this case, the first message parameter passed to the SCROLL
code block must be used to determine the current position.
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.
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.
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.
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.
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpScrollBar().
This class should inherit from DC_XbpScrollBar().
See the example in \exp19\samples\subclass.
Description:
The command @..DCSCROLLBAR creates a new Scroll-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.
@..DCSCROLLBAR 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 @ DCSCROLLBAR is an object of the
XbpScrollBar() class, therefore it can be manipulated with
any iVar or method supported by XbpScrollBar().
Examples:
/*
This example uses three scrollbars to change the RED, GREEN
and BLUE colors and display the result in a box.
*/
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL nRed := 50, nGreen := 100, nBlue := 150, GetList := {}, oColorBox
@ 2, 44 DCSAY 'R' SAYSIZE 2
@ 3, 43 DCSCROLLBAR DATA nRed SIZE 3,7 ;
TYPE XBPSCROLL_VERTICAL RANGE 0,255 ;
SCROLL { |a,x,o| nRed := a[1], ;
o:SetData(), RGB(nRed,nGreen,nBlue,oColorBox) }
@ 2, 48 DCSAY 'G' SAYSIZE 2
@ 3, 47 DCSCROLLBAR DATA nGreen SIZE 3,7 ;
TYPE XBPSCROLL_VERTICAL RANGE 0,255 ;
SCROLL { |a,x,o| nGreen := a[1], ;
o:SetData(), RGB(nRed,nGreen,nBlue,oColorBox) }
@ 2, 52 DCSAY 'B' SAYSIZE 2
@ 3, 51 DCSCROLLBAR DATA nBlue SIZE 3,7 ;
TYPE XBPSCROLL_VERTICAL RANGE 0,255 ;
SCROLL { |a,x,o| nBlue := a[1], ;
o:SetData(), RGB(nRed,nGreen,nBlue,oColorBox) }
@ 11, 40 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 20,2 ;
GROUP oColorBox ;
EVAL {|o|o:paint := {||RGB(nRed,nGreen,nBlue,oColorBox)} }
DCREAD GUI ;
TITLE 'Scroll-bar Demo' ;
FIT ;
ADDBUTTONS
RETURN
/* ---------------- */
STATIC PROCEDURE RGB( nRed, nGreen, nBlue, oColorBox )
LOCAL aAttr := Array(GRA_AA_COUNT) // area attributes
LOCAL nMax, aOldAttr, aOldRGB, oPS
oPS := oColorBox:LockPS()
nMax := oPS:maxColorIndex() // max colors
// Set new RGB color and draw box
aAttr[ GRA_AA_COLOR ] := nMax
aOldAttr := oPS:setAttrArea( aAttr )
aOldRGB := oPS:setColorIndex( nMax, {nRed,nGreen,nBlue} )
GraBox( oPS, {0,0}, {200,200}, GRA_FILL )
oPS:setAttrArea( aOldAttr )
oPS:setColorIndex( nMax, aOldRGB )
oColorBox:unlockPS( oPS )
RETURN
Source/Library:
DCDIALOG.CH
@ DCSLE
Create a SINGLE LINE edit for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCSLE < 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 >] ;
* [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 >] ;
[NAME < cVarName >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[BUFFERLENGTH < nBufferLen >] ;
[ALIGN < nAlign >] ;
[CUEBANNER < cCueBanner >]
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.
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.
NAME < cVarName > is the variable name to assign to the GET
object (for HTML based applications.)
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpSle().
This class should inherit from DC_XbpSle().
See the example in \exp19\samples\subclass.
BUFFERLENGTH < nBufferLen > sets the maximum length of the buffer
that is created when characters are entered into the control.
The default is 32.
ALIGN < nAlign > specifies how the characters are aligned within
the XbpSLE object. By default, they are left justified.
Constants defined in the XBP.CH file should be used for < nAlign >
The following table lists the values available for the < nAlign >
option:
Constants for < nAlign > :
Constant Description
XBPSLE_LEFT Text is displayed left justified
XBPSLE_RIGHT Text is displayed right justified
XBPSLE_CENTER Text is displayed centered
CUEBANNER < cCueBanner > is the cue banner to display when the
object text is empty.
Description:
The command @..DCSLE creates a new single-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.
@..DCSLE 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 sle object created by @ DCDIALOG is an object of the
DC_XbpSLE() class which inherits from the XbpSle() class,
therefore it can be manipulated with any iVar or method
supported by XbpSLE().
------------------
HTML applications:
The multiline object created by @ DCDIALOG is an object of the
DC_HtmlSLE() class.
Source/Library:
DCDIALOG.CH
See Also:
@ DCGET
@ DCMULTILINE
@ DCSPINBUTTON
Create a SPIN BUTTON get for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCSPINBUTTON < nVar > ;
[SIZE < nWidth > [,< nHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[VALID < bValid >] ;
[HELPCODE < cHelp >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[EDITPROTECT < bProtect >] ;
[PRESENTATION < aPres >] ;
[FONT < bocFont >] ;
[MASTER < oMaster >] ;
[OBJECT < oObject >] ;
[CALLBACK < bCallBack >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[DATALINK < bLink >] ;
[LIMITS < nBott >,< nTop >] ;
[PIXEL] ;
[FASTSPIN] ;
[PADZERO] ;
[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 >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[ENDSPIN < bEndSpin >] ;
[DOWNSPIN < bDownSpin >] ;
[UPSPIN < bUpSpin >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[INCREMENT < nIncrement >]
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.
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.
MASTER < oMaster > is a variable containing another spin button
object that will be used as the master for this spin button.
In this case, the spinbutton is displayed without the two
pushbutton arrows. Instead the value of the spinbutton is
changed when one of the arrows on the master spinbutton is
clicked.
OBJECT < oObject > is the name of a local variable to assign
to this spinbutton object.
CALLBACK < bCallBack > is a code block that is evaluated
when the end-spin is encountered or when a keyboard entry is
made into the spinbutton text area.
LIMITS < nBott >,< nTop > defines the valid range for numeric
values of the spinbutton. If the current value of the
spinbutton is outside the newly defined range when this
object is created, the value is set to the minimum or maximum
valid value depending on whether the invalid value is less
than the minimum or greater than the maximum valid value.
In the default mode, changes to the value are somewhat slower
when the mouse button is clicked on one of the arrows and the
button remains pressed. In the FASTSPIN mode, the spinbutton
is in the "fast" operation. mode. The value is incremented
or decremented at twice the normal speed. If the spinbutton is
defined as the master for another spinbutton, the FASTSPIN
option is ignored.
By default, the numeric value in the entry field is displayed
without leading zeros. Use PADZERO to cause the display to
contain leading zeros.
< nVar > is the input/output variable. This should be
initialized to a numeric value. It must not be a macro unless
< nVar > is a codeblock that contains a macro. The < nVar > is
automatically anchored via a Get-Set codeblock created by
DC_GetAnchorCB() unless < lVar > is a custom Get-Set code block.
SIZE < nWidth >,< nHeight > is the width and height of the
spin button. 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.
FONT < bocFont > 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 spinbutton 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.
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.
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
ENDSPIN < bEndSpin > is a code block to evaluate when the left
mouse button is released after pressing the up or down pushbutton
of the SpinButton object.
DOWNSPIN < bDownSpin > is a code block to evaluate after the numeric
value in the entry field of the Spinbutton object is decremented.
This occurs either after the user presses the Down Arrow key or
clicks the down pushbutton with the mouse.
UPSPIN < bUpSpin > is a code block to evaluate after the numeric
value in the entry field of the XbpSpinbutton object is incremented.
This occurs when the user presses the Up arrow key or presses
the up pushbutton of the spinbutton with the mouse.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpSpinButton().
This class should inherit from DC_XbpSpinButton().
See the example in \exp19\samples\subclass.
INCREMENT < nIncrement > is a numeric value that sets the amount of
increment or decrement for each navigation.
Description:
The command @..DCSPINBUTTON creates a new SpinButton 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.
@..DCSPINBUTTON objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
Notes:
The object created by @ DCSPINBUTTON is an object of the
XbpSpinButton() class, therefore it can be manipulated with
any iVar or method supported by XbpSpinButton().
Examples:
#include "dcdialog.ch"
#include "gra.ch"
#define nRed aLocals[1]
#define nGreen aLocals[2]
#define nBlue aLocals[3]
#define oRedSpin aLocals[4]
#define oGreenSpin aLocals[5]
#define oBlueSpin aLocals[6]
#define oColorBox aLocals[7]
#define oPS aLocals[8]
PROCEDURE Xtest()
LOCAL aLocals[8], GetList := {}
nRed := 50 ; nGreen := 100 ; nBlue := 150
@ 2, 57 DCSPINBUTTON nRed SIZE 7 LIMITS 0,255 ;
OBJECT oRedSpin ;
CALLBACK {|a,b,o|o:GetData(),RGB(aLocals)}
@ 0, 8 DCSAY 'Red' SAYSIZE 5 RELATIVE oRedSpin
@ 4, 57 DCSPINBUTTON nGreen SIZE 7 LIMITS 0,255 ;
OBJECT oGreenSpin ;
CALLBACK {|a,b,o|o:GetData(),RGB(aLocals)}
@ 0, 8 DCSAY 'Green' SAYSIZE 5 RELATIVE oGreenSpin
@ 6, 57 DCSPINBUTTON nBlue SIZE 7 LIMITS 0,255 ;
OBJECT oBlueSpin ;
CALLBACK {|a,b,o|o:GetData(),RGB(aLocals)}
@ 0, 8 DCSAY 'Blue' SAYSIZE 5 RELATIVE oBlueSpin
@ 8, 56 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 10,2 ;
GROUP oColorBox EVAL {|o|o:paint := {||RGB(aLocals)} }
DCREAD GUI ;
TITLE 'Spin-Button Demo' ;
FIT ;
ADDBUTTONS
RETURN
/* ------------------- */
STATIC PROCEDURE RGB( aLocals )
LOCAL aAttr := Array(GRA_AA_COUNT)
LOCAL nMax, aOldAttr, aOldRGB
oPS := oColorBox:LockPS()
nMax := oPS:maxColorIndex() // max colors
// Set new RGB color and draw box
aAttr[ GRA_AA_COLOR ] := nMax
aOldAttr := oPS:setAttrArea( aAttr )
aOldRGB := oPS:setColorIndex( nMax, {nRed,nGreen,nBlue} )
GraBox( oPS, {0,0}, {100,100}, GRA_FILL )
oPS:setAttrArea( aOldAttr )
oPS:setColorIndex( nMax, aOldRGB )
oColorBox:unlockPS( oPS )
RETURN
Source/Library:
DCDIALOG.CH
@ DCSPLITBAR
Create a SPLITBAR object for displaying with GUI reader
Syntax:
@ < nRow >, < nCol > DCSPLITBAR < oSplitBar >
;
[SIZE < nWidth >,< nHeight >]
;
[PARENT < oParent >]
;
[PARENTID < cPID >]
;
[PRESENTATION < aPres >]
;
[COLOR < ncBgC >]
;
[MOVECOLOR < nMoveColor >]
;
[CARGO < xCargo >]
;
[ORIENTATION < nOrientation >]
;
[TITLE < cTitle >]
;
[EVAL < bEval >]
;
[PREEVAL < bPreEval >]
;
[POSTEVAL < bPostEval >]
;
[CURSOR < nCursor >]
;
[ID < cId >]
[PIXEL] ; ;
[GROUP < cGroup >]
;
[CLASS < bcClass >] ;
[PREDECESSOR < oPredecessor >]
;
[SUCCESSOR < oSuccessor >]
;
[MINSIZE < nMinSize >]
;
[MAXSIZE < nMaxSize >]
[RESIZE < aReSize >]
;
[SUBCLASS < cSubClass >]
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.
< oSplitBar > is the name of a local variable to assign
to this SplitBar object.
SIZE < nWidth >,< nHeight > is the width and height of the
ScrollBar 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.
COLOR < ncBgC > is the color of the SplitBar.
ORIENTATION < nOrientation > is the orientation (Horizontal or
Vertical) of the SplitBar. Values may be DCGUI_SPLITBAR_VERTICAL
or DCGUI_SPLITBAR_HORIZONTAL.
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.
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.
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.
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
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
PREDECESSOR < oPredecessor > is the predecessor object that will
be resized when the SplitBar is moved. If the SplitBar orientation
is Vertical then this is the left-most object. If the SplitBar
orientation is Horizontal then this is the bottom-most object.
SUCCESSOR < oSuccessor > is the successor object that will
be resized when the SplitBar is moved. If the SplitBar orientation
is Vertical then this is the right-most object. If the SplitBar
orientation is Horizontal then this is the top-most object.
MINSIZE nMinSize is the minimum size, in pixels, of the predecessor
object.
MAXSIZE nMaxSize is the maximum size, in pixels, of the predecessor
object.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpSplitBar().
This class should inherit from DC_XbpSplitBar().
See the example in \exp19\samples\subclass.
Description:
The command @..DCSPLITBAR creates a new SplitBar 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.
@..DCSPLITBAR objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCSTATIC, @..DCBUTTON, @..DCCHECKBOX or @..DCTABPAGE.
@ DCSPLITBAR is used to create a vertical or horizontal bar to
be used for proportionally resizing adjacent screen objects.
Notes:
The object created by @ DCSPLITBAR is an object of the
XbpStatic() class, therefore it can be manipulated with
any iVar or method supported by XbpStatic().
Examples:
Look at the sample program in the .\SAMPLES\SPLITBAR directory.
Source/Library:
DCDIALOG.CH
@ DCSTATIC
Create a STATIC object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > DCSTATIC ;
TYPE < nType > ;
[SIZE < nWidth >, < nHeight >] ;
[OBJECT < oObject >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[OPTIONS < nOptions >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[CAPTION < ncboCaption >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[FONT < bocFont >] ;
[TOOLTIP < bcToolTip >] ;
[CURSOR < naCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[VSCROLL < oParentV > RANGE < nVStart >, < nVEnd >
;
[OBJECT < oObjectV > ] ] ;
[HSCROLL < oParentH > RANGE < nHStart >, < nHEnd >
;
[OBJECT < oObjectH > ] ] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[RESTYPE < cResType >] ;
[RESFILE < cResFile >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[FORMATTED]
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.
< nType > defines the "type" of the static object. Static
objects can be anything supported by the XbpStatic()
class - Text, Icons, BitMaps, Boxes, etc. < nType > must be
a constant starting with XBPSTATIC_TYPE_. These constants
are defined in XBP.CH.
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 no size is given, then the object will be automatically
sized to fit the caption. 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 < ncbCaption > is the caption to place on the object.
The caption is the part of a DCSTATIC object that is displayed
within the area of the object. The caption can be a character
string, a bitmap/icon resource (raster image), a bitmap object,
or a code-block which returns a character string, numeric
resource or bitmap object. If it is a character string, the
string is assigned. If the caption is a bitmap or icon, the
numeric resource ID of the bitmap or icon is assigned. 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. If an
object is used, it must be an object of the XbpBitMap() class.
An object may be used only with Xbase++ 1.7 or later. If
< ncboCaption > is a code-block, the caption is refreshed with the
DC_GetRefresh() function.
When the DCSTATIC object is used to display lines, borders or
boxes, the caption is not generally displayed. The single
exception is when a DCSTATIC object of the
XBPSTATIC_TYPE_GROUPBOX type is used to display a box with a
title (caption) at the upper left.
Predefined system icons:
If the type of the XbpStatic object is XBPSTATIC_TYPE_SYSICON,
the constant assigned to the caption identifies a predefined
system icon. These do not need to be defined in a resource
file and can not be linked to the EXE file using the resource
compiler. The constants are defined in the XBP.CH file.
OBJECT < oObject > 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 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.
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 Static 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.
OPTIONS < nOptions > is a set of options that can be used to
align the text within the rectangular area of the Static object.
Constants defined in the XBP.CH file are used for these options.
If combinations of alignment options are required, the sum of
the appropriate constants must be included in < nOptions >.
XBPSTATIC_TEXT_LEFT Text is left aligned
XBPSTATIC_TEXT_CENTER Text is horizontally centered
XBPSTATIC_TEXT_RIGHT Text is right aligned
XBPSTATIC_TEXT_TOP Text is displayed at top
XBPSTATIC_TEXT_VCENTER Text is vertically centered
XBPSTATIC_TEXT_BOTTOM Text is displayed at bottom
XBPSTATIC_TEXT_WORDBREAK Text is wrapped (multi-line)
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.
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.
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
VSCROLL is used to attach a vertical scroll bar to the right side
of parent object < oParentV > and scroll the static window within
the range of < nVStart > and, < nVEnd >. For best results the
static
window created by this DCSTATIC command should be a child of
< oParentV >. The optional clause OBJECT < oObjectV > is used
to
store a pointer to the scrollbar object. See the example.
HSCROLL is used to attach a horizontal scroll bar to the bottom
of parent object < oParentH > and scroll the static window within
the range of < nHStart > and, < nHEnd >. For best results the
static
window created by this DCSTATIC command should be a child of
< oParentH >. The optional clause OBJECT < oObjectH > is used
to
store a pointer to the scrollbar object. See the example.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTON CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpStatic().
This class should inherit from DC_XbpStatic().
See the example in \exp19\samples\subclass.
FORMATTED is used to allow for displaying of formatted text with
bold, italic, underline, tabbed or indented characters. See the
sample program in .\samples\static\formatted.prg
Description:
The command @..DCSTATIC creates a new Static 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.
@..DCSTATIC objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The object created by @ DCSTATIC is an object of the
XbpStatic() class, therefore it can be manipulated with
any iVar or method supported by XbpStatic().
Examples:
#include "dcdialog.ch"
* -- Example 1 -- *
PROCEDURE Xtest()
LOCAL GetList := {}, oStatic1
@ 0,0 DCSTATIC XBPSTATIC_TYPE_RECESSEDBOX SIZE 20,4 ;
OBJECT oStatic1
@ 6,0 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 20,4
@ 2,1 DCSTATIC XBPSTATIC_TYPE_TEXT SIZE 15,1 ;
CAPTION 'This is text' PARENT oStatic1
DCREAD GUI ;
TITLE 'Static Demo' ;
FIT ;
ADDBUTTONS
RETURN
*-- Example 2 --*
FUNCTION ScrollTest()
LOCAL GetList := {}, oStatic1, oStatic2, oStatic3, i, aGets[20]
@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 40,10 ;
OBJECT oStatic1
@ .5,1 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT SIZE 38,9 ;
OBJECT oStatic2
@ 1,1 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT SIZE 70,25 ;
OBJECT oStatic3 ;
PARENT oStatic2 ;
FONT '12.Alaska Crt' ;
VSCROLL oStatic1 RANGE 0,500 ;
HSCROLL oStatic1 RANGE 0,500
FOR i := 1 TO 20
aGets[i] := i
@ i-1,1 DCSAY Str(i,2) + ;
' This................is.................Get ' + ;
Str(i,2) GET aGets[i] PICT '99999' ;
SAYSIZE 0 PARENT oStatic3
NEXT
DCREAD GUI FIT ADDBUTTONS TITLE 'Scrolling a Static Window'
RETURN nil
Source/Library:
DCDIALOG.CH
@ DCTABPAGE
Create a TAB PAGE object for displaying with GUI reader
Syntax:
@ < nSRow >,< nSCol > DCTABPAGE < oGroup > ;
[SIZE < nWidth >, < nHeight >] ;
[TYPE < nType >] ;
[TABHEIGHT < nTabH >] ;
[TABWIDTH < nTabW >] ;
[PREOFFSET < nPre >] ;
[POSTOFFSET < nPost >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[GROUP < nGroup >] ;
[CAPTION < cText >] ;
[CARGO < xCargo >] ;
[MESSAGE < bcMsg >] ;
[HELPCODE < cHelpCode >] ;
[COLOR < ncColor > [,< ncDisabled >] ] ;
[COLOR < bColor >] ;
[WHEN < bWhen >] ;
[FONT < bocFont >] ;
[HIDE < bHide >] ;
[VALID < bValid >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[MESSAGE < cMsg > [INTO < oMsgBox >]] ;
[CURSOR < naCursor >] ;
[RELATIVE < oRel >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[GROUP < cGroup >] ;
[STATICAREA < oStaticArea >] ;
[ANGLE < nAngle >] ;
[RESIZE < aResize > [SCALEFONT] ] ;
[RESTYPE < cResType >] ;
[RESFILE < cResFile >] ;
[MINIMIZEDCOLOR < anMinColorFG >, < anMinColorBG >] ;
[MAXIMIZEDCOLOR < anMaxColorFG >, < anMaxColorBG >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[IMAGE < ocnImage >] ;
[SELECTEDIMAGE < ocnSelectedImg >] ;
;
[DISABLEDIMAGE < ocnDisabledImg >] ;
[IMAGEALIGN < nImageAlign >] ;
[TEXTALIGN < nTextAlign >] ;
[CAPTIONLAYOUT < nCaptionLayout >] ;
[MERGECHILDREN] ;
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 Dialogue 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.
CAPTION < cCaption > is the caption to place on the tab. The caption
may be a string, resource, bitmap object or the name of an image
that exists on a mapped drive or UNC.
Examples: @ .. DCTABPAGE .. CAPTION '\exp18\bitmaps\pencil.bmp'
@ .. DCTABPAGE .. CAPTION 'Pencil'
@ .. DCTABPAGE .. CAPTION BITMAP_PENCIL_S
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. This option also allows for the automatic
sizing of the TabPage, Tab Widths, and Tab locations.
SIZE < nWidth >, < nHeight > defines the size of the tabpage.
If no size is given, then the tabpage 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.
It is recommended that the SIZE parameters be used only on the
first tabpage in a set and that all other tabpages be established
as "relative" to the previous tabpage. Assigning a tabpage as
RELATIVE to a previous tabpage will cause the TabPage size to be
the same size as the previous tabpage.
TYPE < nType > is one of the #define constants XBPTABPAGE_TAB_TOP
or XBPTABPAGE_TAB_BOTTOM. TYPE will determine whether to
display the tab at the top or bottom of the page. The default
is top.
< oGroup > 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 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 tab page 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.
TABHEIGHT < nTabH > is the height of the tab (in pixels). The
default height is calculated automatically as 1.5 times the
height of the title bar of the window. This is usually 33
pixels. If < nTabH > is set to zero, no tab is displayed.
TABWIDTH < nTabW > is the width of the tab. The numeric value is
in text-based columns unless the PIXEL clause is used. This
optional clause is intended to be used in lieu of the PREOFFSET
and POSTOFFSET clauses because it is simpler. It should also
be used only on the first TabPage of a group of relative
tabpages. All relative TabPages will inherit this width.
PREOFFSET < nPre > and POSTOFFSET < nPost > are numeric values
used to determine the starting and ending position of each tab.
The numeric values are percentage values from 0 to 100 for the
for the percentage of the offset. See the XbpTabPage()
documentation for more information. If a value is not given then
a PREOFFSET of 0 and a POSTOFFSET of 85 are default. It is
recommended that PREOFFSET/POSTOFFSET be used only on the first
tabpage in a set and that all other tabpages be established as
"relative" to the previous tabpage. Assigning a tabpage as
RELATIVE to a previous tabpage will cause the Tab Size and
location to be automatically assigned.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the TabPage 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.
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().
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.
VALID < bValid > is a code block to evaluate when the tabpage
is minimized and another tabpage is selected. This code block
must return a logical value. If the value returned is .TRUE.
then the tabpage will be minimized otherwise another tabpage
cannot be selected.
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 < ncColor >, < ncDisabled > are enabled and disabled
colors.
The tabpage will be set to the enable color if the WHEN clause
evaluates .TRUE. and to the disabled color if the WHEN clause
evaluates .FALSE. 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. If < bncColor > is a code block is
must return a 2-element array containing an enabled and
disabled color.
COLOR < bColor > may be a code block that returns a foreground
and background color in an array of 2 numeric elements. This
allows colors to be changed dynamically.
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 tabpage will be disabled and grayed.
If the value returned is .TRUE. then the tabpage 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 tabpage will be hidden from view. If
the value returned is .FALSE. then the tabpage 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 tabpage 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
STATICAREA < oStaticArea > will create an XbpStatic object covering
the entire area of the TabPage. This is a text-type static which
will appear to be invisible. This clause should be used when
placing @..DCSAY..GET or DCGET objects on a Tab page and the
HILITE < nColor > clause of DCGETOPTIONS is used to hilite the
currently selected GET. The gets should use < oStaticArea > as the
parent rather than < oTabPage > to prevent the TabPage from looking
strange after highlighting gets - this is an Xbase++ anomoly.
ANGLE < nAngle > is used to put a beveled edge on the sides of
the tab. This is a numeric value from 0 - 90.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
The optional SCALEFONT clause will automatically scale the
font size up or down when the object is resized.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTON CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
MINIMIZEDCOLOR < anMinColorFG >, < anMinColorBG > is the
foreground and
background color when the tabpage is minimized. Each argument may
be a numeric GRA* color or an array of 3 RGB values.
MAXIMIZEDCOLOR < anMaxColorFG >, < anMaxColorBG > is the
foreground and
background color when the tabpage is maximized.Each argument may
be a numeric GRA* color or an array of 3 RGB values.
Note: the above colors will override the colors defined by
DC_TabPageColor().
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpTabPage().
This class should inherit from DC_XbpTabPage().
See the example in \exp19\samples\subclass.
IMAGE < ocnImage > is an image to display on the tab. This may be
the name of an image file or icon, a numeric index or an XbpIcon
or XbpBitmap object.
SELECTEDIMAGE < ocnSelectedImg > is the image to display only when
the tabpage is selected.
DISABLEDIMAGE < ocnDisabledImg > is the image to display only when
the tabpage is disabled.
IMAGEALIGN < nImageAlign > is a numeric value that defines how the
image should be aligned on the tab. The value can be any value
starting with XBP_ALIGN* that is defined in XBP.CH.
TEXTALIGN < nTextAlign > is a numeric value that defines how the
text should be aligned on the tab. The value can be any value
starting with XBP_ALIGN* that is defined in XBP.CH.
CAPTIONLAYOUT < nCaptionLayout > is a numeric value that defines
how the image and text should be aligned with relation to each
other. The value can be any value starting with XBP_LAYOUT_* that
is defined in DCDIALOG.CH.
The MERGECHILDREN option is used to improve performance when creating
dialogs that have tabpages with many child objects. Tabpages that
use this options will not create the child objects until the tabpage
receives focus the first time. See the sample TabMerge.Prg program
in the \exp19\samples\tabpage folder.
Description:
The command @..DCTABPAGE creates a new Tab Page 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.
@..DCTABPAGE objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Exported Instance Variables:
Methods:
Notes:
The TabPage object created by @ DCTABPAGE is an object of the
XbpTabPage() class, therefore it can be manipulated with
any iVar or method supported by XbpTabPage().
Navigation between Tab-Pages is accomplished via the following
keys:
Key Action
------------------------ ------------------------------------
Control-Tab Select Next Tab-Page
Control-Shift-Tab Select Previous Tab-Page
Examples:
#include 'dcdialog.ch'
PROCEDURE Xtest()
LOCAL oTabPage1, oTabPage2, oTabPage3, cDesc := Space(30),;
aType := {'Star-Trek','Hollywood','Sports','Other'},;
cType := Space(15), dDateOrig := Date(), dDateAcqu := Date(),;
nOrigPrice := 0, nApprValue := 0, cMemo := '', ;
GetList := {}
/* ---- Tab Page #1 ---- */
@ 0,0 DCTABPAGE oTabPage1 CAPTION 'Collection' ;
SIZE 72,15 PREOFFSET 0 POSTOFFSET 85
@ 3,2 DCSAY "Description" GET cDesc SAYRIGHT PARENT oTabPage1
@ 5,10 DCSAY "Type" PARENT oTabPage1 SAYSIZE 8
@ 6,10 DCCOMBOBOX cType LIST aType SIZE 12,6 PARENT oTabPage1
/* ---- Tab Page #2 ---- */
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Financial' ;
RELATIVE oTabPage1
@ 4,2 DCSAY " Original Date" GET dDateOrig PICT '99/99/9999' ;
PARENT oTabPage2 SAYRIGHT
@ 6,2 DCSAY " Acquired Date" GET dDateAcqu PICT '99/99/9999' ;
PARENT oTabPage2 SAYRIGHT
@ 8,2 DCSAY " Acquired Price" GET nOrigPrice PICT '9999.99' ;
PARENT oTabPage2 SAYRIGHT
@ 10,2 DCSAY "Appraised Value" GET nApprValue PICT '9999.99' ;
PARENT oTabPage2 SAYRIGHT
/* ---- Tab Page #3 ---- */
@ 0,0 DCTABPAGE oTabPage3 CAPTION 'Memo' ;
RELATIVE oTabPage2
@ 5,2 DCMULTILINE cMemo PARENT oTabPage3 SIZE 65,8 ;
FONT "10.Courier.Bold"
DCREAD GUI ;
TITLE 'Tab-Page Demo' ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
@ DCTOOLBAR
Create a TOOLBAR object for displaying with GUI reader
Syntax:
[@ < nSRow >, < nSCol >] DCTOOLBAR < oToolBar > ;
[TYPE < nType >] ;
[FANCY] ;
[VERTICAL] ;
[HORIZONTAL] ;
[SIZE < nWidth > [,< nHeight >]] ;
[BUTTONSIZE < nBWidth >, [< nBHeight >]] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[PRESENTATION < aPres >] ;
[COLOR < ncFgC > [,< ncBgC >] ] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[CARGO < xCargo >] ;
[PIXEL] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[CURSOR < naCursor >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[RESIZE < aResize >] ;
[FIT] ;
[ALIGN < nAlign >] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >] ;
[SUBCLASS < cSubClass >] ;
[BUTTONCONFIG < oButtonConfig >]
Arguments:
< nSRow >, < nSCol > are the optional 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 Dialogue 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.
< oToolBar > is the name of the variable to assign as a storage
place for this object.
TYPE < nType > is the type of toolbar. ToolBars 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_RAISEDBOX.
FANCY will cause all buttons to be displayed in a special mode
in which the button will be displayed only as a caption on the
toolbar 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 button captions that are
bitmap objects, however it can be used with captions that are
bitmap resources.
VERTICAL or HORIZONTAL is required only if the orientation of
the buttons on the toolbar cannot be automatically determined
by the width/height ratio of the toolbar. For example, by
default a toolbar with a width greater than the height would
automatically stack buttons from left to right.
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.
SIZE < nWidth >, < nHeight > optionally define the size of the
toolbar. If no size is given, then the toolbar 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.
BUTTONSIZE < nBWidth >, < nBHeight > optionally define the size
of
the buttons which will be added to the toolbar via the DCADDBUTTON
command in the event that the SIZE clause of the DCADDBUTTON
command is not used.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Toolbar 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.
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 toolbar will be hidden from view. If
the value returned is .FALSE. then the toolbar will be displayed.
The object is passed as a parameter 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_GETOBJECT() to determine the status
of a get object.
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.
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
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.
RESIZE < aResize > is an optional array of two (2) elements
used for resizing and repositioning the object when the parent
is resized.
NOTE: RESIZE is to be used in conjunction with the RESIZE clause
of DCGETOPTIONS. See the RESIZE clause of DCGETOPTIONS for
examples.
FIT causes the toolbar to be resized to the sum of the width of
all the child buttons.
ALIGN < nAlign > is a special alignment option. If the
ALIGN DCGUI_ALIGN_RIGHT clause is used, then the column coordinate
defines the right-most position of the toolbar. If the ALIGN
DCGUI_ALIGN_CENTER clause is used, then the column coordinate
defines the center of the toolbar. See the sample program in
.\SAMPLES\TOOLBAR.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpToolBar().
This class should inherit from DC_XbpToolBar().
See the example in \exp19\samples\subclass.
BUTTONCONFIG < oButtonConfig > is use to apply a
DC_XbpPushButtonConfig()
object as the default for all successive DCADDBUTTON commands.
This may be used to configure legacy toolbars to use the
DC_XbpPushButtonXP() class.
Description:
The command @ DCTOOLBAR creates a new ToolBar 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.
Even though a toolbar can be created with a DCSTATIC object
and DCPUSHBUTTON objects, the DCTOOLBAR command is much
simpler to use for toolbars because it can optionally anchor
the toolbar to the top, left, bottom, or right border of
the main dialogue box or the parent. DCTOOLBAR is used with
DCADDBUTTON to add pushbuttons to the toolbar.
DCTOOLBAR objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Notes:
The toolbar object created by @ DCTOOLBAR 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 "dcbitmap.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oToolBar
DCTOOLBAR oToolBar ALIGN TOOLBAR_TOP
DCADDBUTTON PARENT oToolBar CAPTION 'Exit' ;
SIZE 9 ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK)}
DCADDBUTTON PARENT oToolBar CAPTION 'Open' ;
SIZE 9 ;
ACTION {||OpenFile()}
DCADDBUTTON PARENT oToolBar CAPTION 'Close' ;
SIZE 9 ;
ACTION {||CloseFile()}
DCREAD GUI FIT ADDBUTTONS
RETURN
/* ---------------------- */
STATIC PROCEDURE OpenFile()
DC_MsgBox('File is now open')
RETURN
/* ---------------------- */
STATIC PROCEDURE CloseFile()
DC_MsgBox('File has been closed')
RETURN
Source/Library:
DCDIALOG.CH
See Also:
DCADDBUTTON
dc_fancybuttonmode()
@ DCTREEARRAY
Browse a multi-dimensional array using Tree-View
Syntax:
@ < nRow >, < nCol > DCTREEARRAY < aArray > ;
[ VAR < xVar > ] ;
[ PARENT < oParent > ] ;
[ COLOR < fgC > [, < bgC > ] ] ;
[ FONT < bocFont > ] ;
[ DATALINK < bLink > ] ;
[ SIZE < nWidth > [, < nHeight >] ] ;
[ TITLE < title > ] ;
[ HIDE < bHide > ] ;
[ WHEN < bWhen > ] ;
[ PREEVAL < bPreEval > ] ;
[ EVAL < bEval > ] ;
[ RELATIVE < oRel > ] ;
[ OPTIONS < aOptions > ] ;
[ OBJECT < oObject > ] ;
[ ID < cId > ] ;
[ HASBUTTONS ] ;
[ HASLINES ] ;
[ GOTFOCUS < bGotFocus > ] ;
[ LOSTFOCUS < bLostFocus > ] ;
[ TABSTOP ] ;
[ NOTABSTOP ] ;
[ VISIBLE ] ;
[ INVISIBLE ] ;
[ TABGROUP < nTabGroup > ] ;
[ 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.
< aArray > is the multi-dimensional array to browse.
VAR < xVar > is the name of a local variable to store the value
of the array item that is selected by the user.
DATALINK < bLink > is a code block that is evaluated each time
a new item is selected in the tree browse.
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.
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().
SIZE < nWidth > [,< nHeight >]] is the size to allocate to the
Tree View window. 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.
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.
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.
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_GETOBJECT() 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.
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
OPTIONS < aRef > is an optional reference array that is used to
format the data in the browse. If < aRef > is a NIL then the tree
view will display the exact contents of the array. < aRef > is an
array of 5-element sub-arrays, 1 for each level of the array
being browsed. The sub-arrays are defined as follows:
Element Type Description
------- ---- ----------------------------------------------------
[1] B Optional code block used to format the displayed
data. The array item and it's ordinal position
within the array are passed as parameters.
examples: {|a,n|a[1]}
{|a,n|filedata(a,n)}
[2] N The resource ID of a bitmap or icon image to
visualize the normal state of the array item
(not marked and not expanded).
[3] N The resource ID of a bitmap or icon image to
visualize the marked state of the array item.
[4] N The resource ID of a bitmap or icon image to
visualize the expanded state of the array item.
[5] A An optional array of numeric values containing
the array elements to include in the expanded
view.
HASBUTTONS displays a Plus or Minus sign at each node of the
tree. This indicates whether the next level of the tree can be
expanded or suppressed.
HASLINES displays lines between the nodes of the tree and their
leaves. This results in a more readable display.
Description:
The command @..DCTREEARRAY creates a new Tree Array 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.
@..DCTREEARRAY is used to browse a multi-dimensional array using
a Tree-View style dialog.
Notes:
The object created by @ DCTREEARRAY is an object of the
XbpTreeView() class, therefore it can be manipulated with
any iVar or method supported by XbpTreeView().
Examples:
#INCLUDE "dcicon.ch"
#INCLUDE "dctree.ch"
FUNCTION Xtest()
LOCAL aDirectory, aDirOptions, Getlist := {}, oDirtree1, oDirtree2
aDirectory := Directory( '*.*' )
IF Len(aDirectory) > 50
ASize(aDirectory,50)
ENDIF
aDirOptions := { { {|a,n|a[1]}, ;
ICON_CLOSEDFOLDER, ;
ICON_CLOSEDFOLDER, ;
ICON_OPENFOLDER }, ;
{ {|a,n|FileData(a,n)}, ;
ICON_CLOSEDFOLDER, ;
ICON_CLOSEDFOLDER, ;
ICON_OPENFOLDER, ;
{ 2,3,4,7,8 } } }
@ 2, 5 DCTREEARRAY aDirectory SIZE 40,13 ;
OBJECT oDirTree1 OPTIONS aDirOptions
@ 2,45 DCTREEARRAY aDirectory SIZE 40,13 ;
OBJECT oDirTree2
DCREAD GUI FIT BUTTONS DCGUI_BUTTON_EXIT ;
TITLE 'Directory Browsers'
RETURN nil
/* ------------------- */
STATIC FUNCTION FileData ( xData, nElement )
LOCAL cData := DC_XtoC( xData ), cPrefix
DO CASE
CASE nElement = 2
cPrefix := 'File Size: '
CASE nElement = 3
cPrefix := 'File Date: '
CASE nElement = 4
cPrefix := 'File Time: '
CASE nElement = 7
cPrefix := 'Creation Date: '
CASE nElement = 8
cPrefix := 'Creation Time: '
OTHERWISE
cPrefix := ''
ENDCASE
RETURN cPrefix + cData
Source/Library:
DCTREE.CH
See Also:
dc_guiabrowse()
@ DCTREEROOT
Create a Root object for a Tree View
Syntax:
@ < nRow >, < nCol > DCTREEROOT ;
[ PARENT < oParent > ] ;
[ COLOR < fgC > [, < bgC > ] ] ;
[ FONT < bocFont > ] ;
[ SIZE < nWidth > [, < nHeight >] ] ;
[ HIDE < bHide > ] ;
[ WHEN < bWhen > ] ;
[ PREEVAL < bPreEval > ] ;
[ EVAL < bEval > ] ;
[ RELATIVE < oRel > ] ;
[ OBJECT < oObject > ] ;
[ ID < cId > ] ;
[ TOOLTIP < cToolTip > ] ;
[ TITLE < title > ] ;
[ ACCELKEY < anAccel > ] ;
[ HASBUTTONS ] ;
[ HASLINES ] ;
[ ALWAYSSHOWSELECTION ] ;
[ GOTFOCUS < bGotFocus > ] ;
[ LOSTFOCUS < bLostFocus > ] ;
[ TABSTOP ] ;
[ NOTABSTOP ] ;
[ VISIBLE ] ;
[ INVISIBLE ] ;
[ TABGROUP < nTabGroup > ] ;
[ GROUP < cGroup > ] ;
[ ITEMCOLLAPSED < bItemCollapsed > ] ;
[ ITEMEXPANDED < bItemExpanded > ] ;
[ ITEMMARKED < bItemMarked > ] ;
[ ITEMSELECTED < bItemSelected > ] ;
[ DRAG < bDrag > [DIALOG < bDD > ] ;
[ DROP < bDrop > [CURSOR < nDropCursor > ] ;
[ SUBCLASS < cSubClass > ]
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.
SIZE < nWidth >,< nHeight > is the width and height of the
TreeView
window. If the PIXEL option is set to .TRUE. in DCGETOPTIONS,
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 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.
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.
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.
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
HASBUTTONS causes the TreeView to display a Plus or Minus sign
at each node of the tree. This indicates whether the next level
of the tree can be expanded or suppressed.
HASLINES causes the TreeView to display lines between the nodes
of the tree and their leaves. This results in a more readable
display.
ALWAYSSHOWSELECTION displays the selected item always highlighted,
even if the tree view has no input focus.
ITEMCOLLAPSED < bItemCollapsed > is a code block that is evaluated
after the sub-items of a DCTREEITEM object are suppressed in
the display. This is achieved by clicking the Minus sign with
the left mouse button, or when the Minus key or left arrow key
is pressed.
ITEMEXPANDED < bItemExpanded > is a code block that is evaluated
after the sub-items of a DCTREEITEM object became visible in
the display. This is achieved by clicking the Plus sign with the
left mouse button, or when the Plus key or right arrow key is
pressed.
ITEMMARKED < bItemMarked > is a code block that is evaluated after
an item is marked within the tree view. This occurs while
navigating with the cursor keys or when an item is clicked.
ITEMSELECTED < bItemSelected > is a code block that is evaluated
after an item is selected. This occurs when an item is double
clicked or by pressing the Return key.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpTreeView().
This class should inherit from DC_XbpTreeView().
See the example in \exp19\samples\subclass.
Description:
The command DCTREEROOT creates a new TreeView root 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.
DCTREEROOT is used with the DCTREEITEM command to create
a TreeView system for viewing any kind of data.
Notes:
The object created by @ DCTREEROOT is an object of the
XbpTreeView() class, therefore it can be manipulated with
any iVar or method supported by XbpTreeView().
Examples:
#include "dctree.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oTree, oSubTree1, oSubTree2, cSelected
@ 1,1 DCTREEROOT SIZE 30,10 OBJECT oTree CAPTION 'Tree Root' ;
HASLINES ;
HASBUTTONS ;
ITEMSELECTED {|o| cSelected := o:caption, ;
DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}
DCTREEITEM CAPTION 'SubTree 1' PARENT oTree OBJECT oSubTree1
DCTREEITEM CAPTION 'Sub-SubTree 1/1' PARENT oSubTree1
DCTREEITEM CAPTION 'Sub-SubTree 1/2' PARENT oSubTree1
DCTREEITEM CAPTION 'Sub-SubTree 1/3' PARENT oSubTree1
DCTREEITEM CAPTION 'SubTree 2' PARENT oTree OBJECT oSubTree2
DCTREEITEM CAPTION 'Sub-SubTree 2/1' PARENT oSubTree2
DCTREEITEM CAPTION 'Sub-SubTree 2/2' PARENT oSubTree2
DCTREEITEM CAPTION 'Sub-SubTree 2/3' PARENT oSubTree2
DCREAD GUI FIT ADDBUTTONS
DC_MsgBox({'You Selected:',cSelected})
RETURN nil
Source/Library:
DCTREE.CH
See Also:
DCTREEITEM
@ SAYWIN
Write a SAY text string in a Text or GUI dialog
Syntax:
@ < nRow >,< nCol > SAYWIN < cText > ;
[COLOR < cColor >] ;
[PARENT < oParent >] ;
[FONT < cFont >] ;
[OK]
Arguments:
PARENT < aParent > is an array of screen information that was
originally returned by DCEXPLODE. If no parameter is
passed, then the static array posted by the last usage of
DCEXPLODE will be used for the screen information. If no
call to DCEXPLODE is made since the last call to DCIMPLODE,
then the text is written to the CRT window and treated as
a normal @..SAY.
< nRow > is the row position within the window. If the
FIXED option was used with DCEXPLODE when the window
was created, then this must be a coordinate which is
relative to 0,0 of the screen, otherwise it must be relative
to 0,0 of the window.
< nCol > is the column position within the window. If the
FIXED option was used with DCEXPLODE when the window
was created, then this must be a coordinate which is
relative to 0,0 of the screen, otherwise it must be relative
to 0,0 of the window.
< cText > is the text to display.
The OK clause will display an "OK" button on the bottom
of the Window and pause program execution until the user
hits ENTER or clicks the mouse on the OK button.
FONT < cFont > will override the optional font that was used
with DCEXPLODE for this Say object only, otherwise the
default font will be used. This parameter is used in GUI
mode only.
COLOR < cColor > is a valid Clipper color string. If this option
is not used, then the background color of the window will
be used.
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 < oMsgBox >: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.
Description:
The command @..SAYWIN is a Dual-Mode command which allows for
writing text to a Text Window, a GUI window or the standard
CRT window. This command is included in EXPRESS.CH to
replace the standard @..SAY command with @..SAYWIN commands
and make it easier to migrate existing Clipper applications with
@..SAYs by changing them to @..SAYWIN commands.
The command functions identical to the standard @..SAY command
unless the DCEXPLODE command is used first. DCEXPLODE creates
a window on the screen which defines either a Text-area or
a GUI dialogue for all successive @..SAYWINs. @..SAYWIN
commands will cause the text to be routed either to the text
window area or the GUI dialogue window until a DCIMPLODE command
is used to destroy the window.
CAUTION:
@..SAY commands are translated by EXPRESS.CH to use the Getlist
system and the DC_ReadGets() Dual-Mode reader. Including
EXPRESS.CH in your application code will treat @..SAY commands
as though they are part of a Dialog Getlist.
Examples:
Source/Library:
EXPRESS.CH
DCADDBUTTON
Add BUTTON to TOOLBAR object for displaying with GUI reader
Syntax:
DCADDBUTTON ;
[CAPTION < bcnoCaption >] ;
[SIZE < nWidth > [,< nHeight >] ] ;
[TYPE < nType >] ;
[OBJECT < oButton >] ;
[ACTION < bAction >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[HELPCODE < cHelpCode >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[FONT < bocFont >] ;
[PRESENTATION < aPres >] ;
[PIXEL] ;
[TOOLTIP < bcToolTip >] ;
[OBJECT < oObject >] ;
[CURSOR < nCursor >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
[ACCELKEY < anAccel >] ;
[GOTFOCUS < bGotFocus >] ;
[LOSTFOCUS < bLostFocus >] ;
[TABSTOP] ;
[NOTABSTOP];
[TABGROUP < nTabGroup >] ;
[VISIBLE] ;
[INVISIBLE] ;
[CARGO < xCargo >] [CARGO "CANCEL"] ;
[GROUP < cGroup >] ;
[STATIC] * ;
[FOCUSCOLOR < nTextColor > [,< nFrameColor >]] * ;
[BITMAP < xBMUp > [,< xBMDown > [,< xBMNeutral >
[,< xBMFlash >]]]] * ;
[FLASH < nFlashIterations > [,< nFlashDelay >]] ;
[REGION < aRegion >] *
[RESTYPE < cResType >] ;
[RESFILE < cResFile >];
[ALIGNCAPTION < nAlign >] ;
[SOUND < cSound >] ;
[SCALEBITMAP] ;
[DRAG < bDrag > [DIALOG < bDD >] ;
[DROP < bDrop > [CURSOR < nDropCursor >]
* Supported by eXPress++ 1.7 or later
Arguments:
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.
OBJECT < oButton > is an optional variable name to assign to this
button for storage of the XbpPushbutton() object after the
dialogue screen is painted. This provides a LOCAL variable
as a pointer to the button object.
ACTION < bAction > is a code block that gets evaluated when
the button is activated.
PARENT < oParent > is the name of the variable that was
assigned to the parent ToolBar for this Button. A ToolBar object
is created by the @ DCTOOLBAR 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.
SIZE < nWidth >, < nHeight > optionally defines the size of the
button. If no size is given, then the button will be
automatically sized to fit the parent toolbar based on option
clauses used via the DCTOOLBAR command. If the BUTTONSIZE
clause of the DCTOOLBAR command is used, then the button will be
sized accordingly, otherwise the wdith will be equal to the
height. 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.
TYPE < nType > is used for displaying a SEPARATOR rather than an
action button. < nType > may be any numerical value starting with
XBPSTATIC_TYPE_* defined in XBP.CH.
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.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed when the mouse is placed
over the button. The help code is used by the Help system to
for specific context-help.
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.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Button 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.
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. The COLOR clause is supported
only when using the STATIC clause.
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().
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 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.
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.
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.
RESTYPE < cResType > provides support for bitmap resources of type
BMP, PNG, GIF and JPEG that have been linked into a .RES file to
be used as the caption.
Example:
@ .. DCPUSHBUTTON CAPTION 2000 RESTYPE GIF
// myres.arc
USERDEF GIF
2000 = FILE ".\GIFChart.GIF"
RESFILE < cResFile > is the name of the .DLL that contains the
resource stated in the RESTYPE < cResType > clause. If this parameter
is not used, then the resource must be in the .EXE.
ALIGNCAPTION < nAlign > is a set of options to use to align the text
on the PushButton. The options are numerical definitions
starting with BS_* and are defined in DCDIALOG.CH.
Note the most common option is BS_MULTILINE.
SOUND < cSound > is the name of a .WAV file to play when the button
is clicked.
SCALEBITMAP will shrink or enlarge a bitmap caption to fit
exactly within the button size. Note: bitmaps should be 24-bit
(hi-color) for this to work correctly.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR CURSOR POINTER_DATADROP_ASSIGN
Description:
The command DCADDBUTTON creates a new PushButton object and
adds the object to the array named GETLIST which is later
processed by the DC_READGETS() function or by the DCREAD
command. DCADDBUTTON is used with DCTOOLBAR to add a
PushButton to the toolbar. Each button is automatically
placed in the next open place on the previously declared
ToolBar. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD 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.
The GetList is passed to the function DC_READGETS() which
looks at the DC_GUI() flag and determines whether to process
this list as a standard text-based get screen or as a
GUI-based dialogue.
Notes:
If the STATIC clause is not used, the object created by
DCADDBUTTON 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
DCADDBUTTON 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).
Examples:
#include "dcdialog.ch"
#include "dcbitmap.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oToolBar
DCTOOLBAR oToolBar ALIGN TOOLBAR_TOP
DCADDBUTTON PARENT oToolBar CAPTION 'Exit' ;
SIZE 9 ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK)}
DCADDBUTTON PARENT oToolBar CAPTION 'Open' ;
SIZE 9 ;
ACTION {||OpenFile()}
DCADDBUTTON PARENT oToolBar CAPTION 'Close' ;
SIZE 9 ;
ACTION {||CloseFile()}
DCREAD GUI FIT ADDBUTTONS
RETURN
/* ---------------------- */
STATIC PROCEDURE OpenFile()
DC_MsgBox('File is now open')
RETURN
/* ---------------------- */
STATIC PROCEDURE CloseFile()
DC_MsgBox('File has been closed')
RETURN
Source/Library:
DCDIALOG.CH
See Also:
@ DCPUSHBUTTON
@ DCTOOLBAR
dc_regionarray()
DCADDBUTTONXP
Add XP-Style BUTTON to TOOLBAR object
Syntax:
DCADDBUTTONXP < parameters... >
See @ DCPUSHBUTTONXP for the command parameters.
Description:
The command DCADDBUTTONXP creates a new XP-Style PushButton object
and adds the object to the array named GETLIST which is later
processed by the DC_READGETS() function or by the DCREAD
command. DCADDBUTTONXP is used with DCTOOLBAR to add a
PushButton to the toolbar. Each button is automatically
placed in the next open place on the previously declared
ToolBar. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD 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.
The GetList is passed to the function DC_READGETS() which
looks at the DC_GUI() flag and determines whether to process
this list as a standard text-based get screen or as a
GUI-based dialogue.
Notes:
This command or class is only available in Xbase++ 1.9 (build 331
or later) because it uses the ownerdraw capability of the
XbpPushButton() class.
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 DCADDBUTTONXP buttons, see the sample program
in \exp19\samples\buttonxp.
The function DC_BitmapTransparentColor() may be used to set the
default transparent color for pushbuttons that have bitmaps as
captions.
DCADDBUTTONXP objects are created from the DC_XbpPushButtonXP()
class which is derived from the XbpPushButton() class.
Designing DCADDBUTTONXP objects to look exactly the way you
would want can be a time-consuming task, therefore it is
recommended that you use a special utility program for this
purpose. See \exp19\samples\buttonxp\buttpicker.exe.
Source/Library:
DCDIALOG.CH
See Also:
@ DCTOOLBAR
@ DCPUSHBUTTON
@ DCPUSHBUTTONXP
DC_XbpPushButtonXPConfig()
DCAPPBROWSE
Create an APPLICATION BROWSE object for displaying with GUI reade
Syntax:
DCAPPBROWSE INTO < oBrowse > ;
[ PARENT < oParent > ] ;
[ FIELDS < fields,... > ] ;
[ COLOR < fgC > [, < bgC > ] ] ;
[ HILITE < fgHC > [, < bcHC > ] ] ;
[ FONT < (font) > ] ;
[ POSITION < nRow > [, < nCol >] ] ;
[ SIZE < nWidth > [, < nHeight >] [< per:PERCENT >] ]
;
[ TITLE < title > ] ;
[ ALIGN < cAlign:LEFT,CENTER,RIGHT > ] ] ;
[ FONT < (hFont) >] ;
[ STYLE < style > ] ;
[ ALIAS < (alias) > ] ;
[ FOR < bFor > ] ;
[ EVAL < bEval > ] ;
[ RELATIVE < oRel > ] ;
[ GROUP < cGroup > ] ;
[ ID < cId > ] ;
[ VISIBLE ] ;
[ INVISIBLE ]
Arguments:
INTO < oBrowse > is the name of the memory variable that gets the
AppBrowse object assigned which is created by the DCAPPBROWSE
command. If the INTO clause is used it must appear as the first
option of the DCAPPBROWSE command. If it is not used the object
is assigned to the variable appObject.
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.
FIELDS < fields,... > specifies a comma-separated list of field
names to be edited in the AppEdit window. The field names can be
specified as literals or as character expressions in parentheses.
If particular fonts or colors should be used for single fields
the DCAPPFIELD command must be used for field specification.
This is also the case when calculation fields are to be
displayed.
If neither the FIELDS option nor command DCAPPFIELD is used, all
fields of the current work area are displayed as columns in the
AppBrowse window.
POSITION < pos1 > [, < pos2 >] positions an AppBrowse window.
If not
specified the AppBrowse window is displayed at the point {0,0}
(bottom left corner of the parent).
There are three possibilities to position an AppBrowse object.
Depending on the data types used for < pos1 > and/or < pos2 >
the
AppBrowse window can be positioned absolute or relative in its
parent window. In addidion, text orientde (row, column) or
graphic coordinates (x,y) may be used:
Coordinates to position an AppBrowse window
< pos1 > Value < pos2 > Value Description
Array {nX,nY} n.a. NIL < pos1 > is an array containing
grafic coordinates for the
AppBrowse window
Numeric nRow Numeric nCol < pos1 > is a numeric value
used as row coordinate,
and < pos2 > specifies the
column coordinate according
to a text mode window
Key word TOP Key word TOP The AppBrowse window is displayed
Key word LEFT Key word LEFT at the top, left, bottom, right
Key word BOTTOM Key word BOTTOM and/or centered within its parent,
Key word RIGHT Key word RIGHT according to the keywords used
Key word CENTER Key word CENTER for positioning
The key word SIZE defines the size of an AppBrowse window. As with
POSITION, the size can be specified using graphic or text oriented
coordinates. Additionaly, percentage values may be used. The next
table shows different possibilities:
Coordinates used for size definition of an AppBrowse window
< size1 > Value < size2 > Value Description
Array {nXsize,nYsize} n.a. NIL A two element array defines
the size in pixel.
Numeric nHeight Numeric nWidth Two numeric values specify
the number of rows and columns
according to a text mode window
If a numeric value is used for < size1 > and/or < size2 > in
conjunction
with the key word PERCENT, the values are interpreted as percentage
of the parent window's height and/or width.
TITLE < cTitle > is a character expression which is displayed in the
title bar of an AppBrowse window. It defaults to the alias name of
the current work area.
COLOR < nForeGround > [, < nBackGround > ] specifies foreground
and
background color for the :drawingArea of the AppBrowse window.
#define constants from XBP.CH or GRA.CH must be used
(XBPSYSCLR_* or GRA_CLR_*).
FONT < cFontCompoundName > optionally specifies a character string
defining the compound name of the font to be selected for the
Browse columns (see also the :setFontCompoundName() method of
Xbase Parts).
STYLE 3D | PLAIN | FANCY | < nStyle > defines the style, or the
appearance, of an AppEdit window. Default styles are selected
specifying either option 3D, PLAIN, or FANCY. Optionally, styles
can be defined by adding constants listed in the next table, and
using the result for < nStyle > :
Constants for style definition of an AppBrowse window
Constant Description
APPSTYLE_FANCY Is equal to STYLE FANCY
APPSTYLE_3D Is equal to STYLE 3D
APPSTYLE_PLAIN Is equal to STYLE PLAIN
APPSTYLE_NOBORDER The border of the dialog window is suppressed
APPSTYLE_NOTITLEBAR The title of the dialog window is suppressed
APPSTYLE_NOFRAMECONTROLS Control elements in the title bar are suppressed
(maximize, minimize button and system menu)
APPSTYLE_RAISED Frames appear in raised style
APPSTYLE_HORIZONTAL Fields are positioned horizontally row by row
ALIAS < cAlias > specifies the alias name for the work area to be
used for database navigation by the AppBrowse object. It defaults
to the current work area.
FOR < lForCondition > is an optional logical expression defining a
condition, or a code block with a logical return value. Only
records for which < lForCondition > returns the value .T. (true)
can be edited. This allows to edit a subset of database records.
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 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
Description:
DCAPPBROWSE is an adaption of the Xbase Application Parts command
APPBROWSE to the DCDIALOG Getlist system. APPBROWSE is a very
powerful command that allows to program standardized browse dialogs
for databases in a comfortable way. It creates an object of the
AppBrowse class and adds Xbase Parts, which access database fields
(note: an AppBrowse object is a container for Xbase Parts).
Although the command has many options it is easy to use. The
minimum requirements to display an edit dialog are two lines of
code:
USE Customer NEW
DCAPPBROWSE
DCREAD GUI ADDBUTTONS FIT
These two lines open a database (USE) and add an AppBrowse object
(DCAPPBROWSE) to the GetList for later display by the DCREAD GUI
command. The AppBrowse window contains columns for all fields of
the database.
Options for display
Key word Description
PARENT Defines the parent
POSITION Positions the AppBrowse window within the parent
SIZE Defines the size of the AppBrowse window
TITLE Character string to be displayed in the title bar
COLOR Defines colors for table columns
FONT Defines font for table columns
HILITE Defines colors for the column selection bar
STYLE Defines display style
See the APPBROWSE command in the Xbase++ documentation for more
information.
Examples:
#include "dcapp.ch"
#include "xbp.ch"
#include "gra.ch"
#include "appevent.ch"
PROCEDURE XTest()
LOCAL oTabPage1, oTabPage2, oStatic1, oStatic2, GetList := {},;
GetOptions, oAppEdit, oAppBrowse, oToolBar
USE COLLECT NEW SHARED
/* ---- Tab Page #1 ---- */
@ 0,0 DCTABPAGE oTabPage1 CAPTION 'Edit' ;
SIZE 80,20.5 PREOFFSET 0 POSTOFFSET 85 ;
COLOR GRA_CLR_BLUE
@ 1.5,1 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,18.5 ;
GROUP oStatic1 PARENT oTabPage1
DCAPPEDIT INTO oAppEdit STYLE PLAIN POSITION 0,0 PARENT oStatic1
/* ---- Tab Page #2 ---- */
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Browse' ;
RELATIVE oTabPage1 ;
COLOR GRA_CLR_RED
@ 1.5,1 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,18.5 ;
GROUP oStatic2 PARENT oTabPage2
DCAPPBROWSE INTO oAppBrowse STYLE FANCY POSITION 0,0 PARENT oStatic2
/* ---- Tool Bar ---- */
DCTOOLBAR oToolBar ALIGN TOOLBAR_RIGHT SIZE 7.1
DCADDBUTTON CAPTION '&Exit' ;
PARENT oToolBar ;
SIZE 7,1 ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK)}
DCGETOPTIONS WINDOW HEIGHT 440 ;
WINDOW WIDTH 620
DCREAD GUI ;
OPTIONS GetOptions ;
TITLE "Application Edit/Browse Demo"
CLOSE collect
RETURN
Source/Library:
DCAPP.CH
See Also:
DCREAD GUI
dc_readgui()
DCAPPEDIT
Create an APPLICATION EDIT object for displaying with GUI reader
Syntax:
DCAPPEDIT INTO < oEdit > ;
[ PARENT < oParent > ] ;
[ FIELDS < fields,... > ] ;
[ COLOR < fgC > [, < bgC > ] ] ;
[ FONT < (font) > ] ;
[ POSITION < nRow > [, < nCol >] ] ;
[ SIZE < nWidth > [, < nHeight >] [< per:PERCENT >] ]
;
[ TITLE < title > ] ;
[ CAPTION [ FONT < (cFont) >] ;
[ ALIGN < cAlign:LEFT,CENTER,RIGHT > ] ] ;
[ HEADING < (head) > ] ;
[ STYLE < style > ] ;
[ NOACTION < suppress > ] ;
[ ALIAS < (alias) > ] ;
[ SEEK < bSeek > ] ;
[ FOR < bFor > ] ;
[ WHILE < bWhile > ] ;
[ TRIGGER < bDelete > [ON] DELETE ] ;
[ TRIGGER < bInsert > [ON] INSERT ] ;
[ TRIGGER < bUpdate > [ON] UPDATE ] ;
[ BITMAP < bitmap > ;
[ < fit:FIT > ] ;
[ EVAL < bEval > ] ;
[ RELATIVE < oRel > ] ;
[ GROUP < cGroup > ] ;
[ ID < cId > ] ;
[ VISIBLE ] ;
[ INVISIBLE ]
Arguments:
INTO < oEdit > is the name of the memory variable that gets the
AppEdit object assigned which is created by the DCAPPEDIT command.
If the INTO clause is used it must appear as the first option of
the DCAPPEDIT command. If it is not used the object is assigned
to the variable appObject.
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.
FIELDS < fields,... > specifies a comma-separated list of field
names to be edited in the AppEdit window. The field names can be
specified as literals or as character expressions in parentheses.
If particular fonts or colors should be used for single fields
the DCAPPFIELD command must be used for field specification.
This is also the case when calculation fields are to be
displayed.
If neither the FIELDS option nor command DCAPPFIELD is used, all
fields of the current work area are displayed in the AppEdit
window.
POSITION < pos1 > [, < pos2 >] positions an AppEdit window. If
not
specified the AppEdit window is displayed at the point {0,0}
(bottom left corner of the parent).
There are three possibilities to position an AppEdit object.
Depending on the data types used for < pos1 > and/or < pos2 >
the
AppEdit window can be positioned absolute or relative in its
parent window. In addidion, text orientde (row, column) or
graphic coordinates (x,y) may be used:
Coordinates to position an AppEdit window
< pos1 > Value < pos2 > Value Description
Array {nX,nY} n.a. NIL < pos1 > is an array containing
grafic coordinates for the
AppEdit window
Numeric nRow Numeric nCol < pos1 > is a numeric value
used as row coordinate,
and < pos2 > specifies the
column coordinate according
to a text mode window
Key word TOP Key word TOP The AppEdit window is displayed
Key word LEFT Key word LEFT at the top, left, bottom, right
Key word BOTTOM Key word BOTTOM and/or centered within its parent,
Key word RIGHT Key word RIGHT according to the keywords used
Key word CENTER Key word CENTER for positioning
The key word SIZE defines the size of an AppEdit window. As with
POSITION, the size can be specified using graphic or text oriented
coordinates. Additionaly, percentage values may be used. The next
table shows different possibilities:
Coordinates used for size definition of an AppEdit window
< size1 > Value < size2 > Value Description
Array {nXsize,nYsize} n.a. NIL A two element array defines
the size in pixel.
Numeric nHeight Numeric nWidth Two numeric values specify
the number of rows and columns
according to a text mode window
If a numeric value is used for < size1 > and/or < size2 > in
conjunction
with the key word PERCENT, the values are interpreted as percentage
of the parent window's height and/or width.
TITLE < cTitle > is a character expression which is displayed in the
title bar of an AppEdit window. It defaults to the alias name of
the current work area.
COLOR < nForeGround > [, < nBackGround > ] specifies foreground
and
background color for the :drawingArea of the AppEdit window.
#define constants from XBP.CH or GRA.CH must be used
(XBPSYSCLR_* or GRA_CLR_*).
FONT < cFontCompoundName > optionally specifies a character string
defining the compound name of the font to be selected for the
:drawingArea of the AppEdit window (see also the
:setFontCompoundName() method of Xbase Parts).
HEADING < headingOptions > initiates the definition of a heading
to be displayed in the AppEdit Window. The minimum requirement
for < headingOptions > is a character string to be used as heading.
Optionally, the COLOR clause can be used to define a foreground
and shadow color, a font can be selected with FONT, and the
heading can be aligned with ALIGN LEFT|CENTER|RIGHT. The complete
HEADING otpions are:
HEADING < cHeadingText > ;
[ COLOR < nForeGround > [, < nShadow >] ] ;
[ ALIGN LEFT | CENTER | RIGHT ] ;
[ FONT < cFontCompoundName > ]
CAPTION < captionOptions > defines color, font and alignment for
the captions of edit controls. The complete CAPTION options are:
CAPTION ;
[ COLOR < nForeGround > [, < nShadow >] ] ;
[ ALIGN LEFT | CENTER | RIGHT ] ;
[ FONT < cFontCompoundName > ]
NOACTION < nSuppress > allows to suppress single or all default
controls of an AppEdit window. Values for < nSuppress > are
#define constants that must be added. The following table lists
all possible constants:
Constants to suppress default controls
Constant Description
APPACTION_NOGOTOP Pushbutton "First" is suppressed
APPACTION_NOPREVIOUS Pushbutton "Previous" is suppressed
APPACTION_NONEXT Pushbutton "Next" is suppressed
APPACTION_NOGOBOTTOM Pushbutton "Last" is suppressed
APPACTION_NOINSERT Pushbutton "New" is suppressed
APPACTION_NODELETE Pushbutton "Delete" is suppressed
APPACTION_NOCANCEL Pushbutton "Cancel" is suppressed
APPACTION_NOEDIT Pushbutton "Edit" is suppressed
APPACTION_NOSEEK Pushbutton "Seek" is suppressed
APPACTION_NONAVIGATION Pushbuttons for navigation are suppressed
APPACTION_NOMODIFY Pushbuttons for editing are suppressed
APPACTION_NONE No pushbuttons are displayed
APPACTION_NOFIELDS Fields are not automatically created
BITMAP < nBitmapID > [ FIT ] specifies the resource ID of a
bitmap which is to be displayed in the background of an AppEdit
window. Without the option FIT, the bitmap is displayed
repeatedly until it has filled the entire display area. If FIT
is used, the bitmap is displayed once, and scaled to the size of
the display area of the AppEdit window.
STYLE 3D | PLAIN | FANCY | < nStyle > defines the style, or the
appearance, of an AppEdit window. Default styles are selected
specifying either option 3D, PLAIN, or FANCY. Optionally, styles
can be defined by adding constants listed in the next table, and
using the result for < nStyle > :
Constants for style definition of an AppEdit window
Constant Description
APPSTYLE_FANCY Is equal to STYLE FANCY
APPSTYLE_3D Is equal to STYLE 3D
APPSTYLE_PLAIN Is equal to STYLE PLAIN
APPSTYLE_NOBORDER The border of the dialog window is suppressed
APPSTYLE_NOTITLEBAR The title of the dialog window is suppressed
APPSTYLE_NOFRAMECONTROLS Control elements in the title bar are suppressed
(maximize, minimize button and system menu)
APPSTYLE_NOHEADING The heading of the AppEdit window is suppressed
APPSTYLE_NOSTATUS The status bar is suppressed
APPSTYLE_ACTIONICONS Pushbuttons are displayed as icons
APPSTYLE_ACTIONTEXT Pushbuttons have text captions
APPSTYLE_ACTIONTOP Pushbuttons are displayed at the top of the AppEdit
window
APPSTYLE_ACTIONLEFT Pushbuttons are displayed on the left in the AppEdit
window
APPSTYLE_ACTIONBOTTOM Pushbuttons are displayed at the bottom of the
AppEdit window
APPSTYLE_ACTIONRIGHT Pushbuttons are displayed on the right in the
AppEdit window
APPSTYLE_RAISED Frames appear in raised style
APPSTYLE_HORIZONTAL Fields are positioned horizontally row by row
ALIAS < cAlias > specifies the alias name for the work area to be
used for database navigation by the AppEdit object. It defaults
to the current work area.
FOR < lForCondition > is an optional logical expression defining a
condition, or a code block with a logical return value. Only
records for which < lForCondition > returns the value .T. (true)
can be edited. This allows to edit a subset of database records.
WHILE < lWhileCondition > is an optional logical expression defining
a condition, or a code block with a logical return value. It is
evaluated after database navigation. The AppEdit window is
automatically closed when < lWhileCondition > yields .F. (false).
SEEK < exprSeek > is a literal numeric expression or a code block
with a numeric return value. It is evaluated after the "Seek"
pushbutton is clicked. This allows to embed user defined search
routines into the AppEdit window. The numeric return value of
< exprSeek > must correspond to an APPOP_* #define constant
(see below).
TRIGGER < deleteFunc > ON DELETE is a character string with the
name of a user defined function. It is called when the "Delete"
pushbutton is clicked. Alternately, a code block can be
specified for < deleteFunc >. The return value of the function, or
code block, must correspond to an APPOP_* #define constant
(see below).
TRIGGER < insertFunc > ON INSERT is a character string with the
name of a user defined function. It is called when the "Save"
pushbutton is clicked while the AppEdit window is in INSERT
mode. This mode is activated by clicking the "New" pushbutton.
Alternately, a code block can be specified for < insertFunc >.
The return value of the function, or code block, must correspond
to an APPOP_* #define constant (see below).
TRIGGER < updateFunc > ON UPDATE is a character string with the
name of a user defined function. It is called when the "Save"
pushbutton is clicked while an existing record is edited.
Alternately, a code block can be specified for < updateFunc >.
The return value of the function, or code block, must correspond
to an APPOP_* #define constant (see below).
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 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
Description:
DCAPPEDIT is an adaption of the Xbase Application Parts command
APPEDIT in the DCDIALOG Getlist system. APPEDIT is a very
powerful command that allows to program standardized edit dialogs
for databases in a comfortable way. It creates an object of the
AppEdit class and adds Xbase Parts, which access database fields
(note: an AppEdit object is a container for Xbase Parts).
Although the command has many options it is easy to use. The
minimum requirements to display an edit dialog are two lines of
code:
USE Customer NEW
DCAPPEDIT
DCREAD GUI ADDBUTTONS FIT
These two lines open a database (USE) and add an AppEdit object
(DCAPPEDIT) to the GetList for later display by the DCREAD GUI
command. The AppEdit window contains edit controls for all
fields of the database. In addition, pushbuttons are included
for database navigation. All other options of the DCAPPEDIT
command are used to configure the edit window in detail or to
specify the fields and pushbuttons to be displayed.
Options for display
Key word Description
PARENT Defines the parent
POSITION Positions the AppBrowse window within the parent
SIZE Defines the size of the AppBrowse window
TITLE Character string to be displayed in the title bar
COLOR Defines colors for table columns
FONT Defines font for table columns
HEADING Defines colors, font and alignment of a heading
CAPTION Defines colors, font and alignment for captions
STYLE Defines display style
NOACTION Suppresses default controls
BITMAP Defines a background bitmap
See the APPEDIT command in the Xbase++ documentation for more
information.
Examples:
#include "dcapp.ch"
#include "xbp.ch"
#include "gra.ch"
#include "appevent.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, GetOptions, oTabPage1, oTabPage2, oTabPage3, ;
oStatic1, oStatic2, oStatic3, oToolBar, oAppEdit1, oAppEdit2, ;
oAppEdit3
USE COLLECT NEW SHARED
/* ---- Tab Page #1 ---- */
@ 0,0 DCTABPAGE oTabPage1 CAPTION 'Plain' ;
SIZE 80,20.5 PREOFFSET 0 POSTOFFSET 85 ;
COLOR GRA_CLR_BLUE
@ 1.5,1 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,18.5 ;
GROUP oStatic1 PARENT oTabPage1
DCAPPEDIT INTO oAppEdit1 STYLE PLAIN POSITION 0,0 PARENT oStatic1
/* ---- Tab Page #2 ---- */
@ 0,0 DCTABPAGE oTabPage2 CAPTION '3D' ;
RELATIVE oTabPage1 ;
COLOR GRA_CLR_RED
@ 1.5,1 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,18.5 ;
GROUP oStatic2 PARENT oTabPage2
DCAPPEDIT INTO oAppEdit2 STYLE 3D POSITION 0,0 PARENT oStatic2
/* ---- Tab Page #3 ---- */
@ 0,0 DCTABPAGE oTabPage3 CAPTION 'Fancy' ;
RELATIVE oTabPage2 ;
COLOR GRA_CLR_YELLOW
@ 1.5,1 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,18.5 ;
GROUP oStatic3 PARENT oTabPage3
DCAPPEDIT INTO oAppEdit3 STYLE FANCY POSITION 0,0 PARENT oStatic3
/* ---- Tool Bar ---- */
DCTOOLBAR oToolBar ALIGN TOOLBAR_RIGHT SIZE 7.1
DCADDBUTTON CAPTION '&Exit' ;
PARENT oToolBar ;
SIZE 7,1 ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK)}
DCGETOPTIONS WINDOW HEIGHT 440 ;
WINDOW WIDTH 620
DCREAD GUI ;
OPTIONS GetOptions ;
TITLE 'Application Edit Demo'
CLOSE collect
RETURN
Source/Library:
DCAPP.CH
See Also:
DCREAD GUI
dc_readgui()
DCAPPFIELD
Create an APPLICATION FIELD object for displaying with GUI reader
Syntax:
DCAPPFIELD < cFieldName > | < memvar > :=
< expression > ;
[ INTO < oApp > ] ;
[ TYPE < cType > ] ;
[ LEN < nLen > ] ;
[ DEC < nDec > ] ;
[ FONT < cFontCompoundName > ] ;
[ COLOR < nForeGround1 > [, < nBackGround1 >] ] ;
[ HILITE < nForeGround2 > [, < nBackGround2 >] ] ;
[ ALIGN LEFT | CENTER | RIGHT ] ;
[ WIDTH < nWidth > ] ;
[ READONLY ] ;
[ HEADING | CAPTION < cHeading > ;
[ FONT < cFontCompoundName > ] ;
[ COLOR < nForeGround > [, < nBackGround >] ] ;
[ ALIGN LEFT | CENTER | RIGHT > ] ;
] ;
[ FOOTING | COMMENT < cFooting > ;
[ FONT < cFontCompoundName > ] ;
[ COLOR < nForeGround > [, < nBackGround >] ] ;
[ ALIGN LEFT | CENTER | RIGHT ] ;
[ GROUP < cGroup > ]
Arguments:
< cFieldName >
< cFieldName > is a literal field name or a character expression in
parentheses. It defines the database field to be displayed next
in an Application Part.
< memvar > := < expression >
If an Application Part is to display not a field but the result
of an expression, an assignment must be specified, instead of a
field name. The assignment must be coded using the inline
assignment operator (:=). An expression is to be assigned to a
memory variable (LOCAL, STATIC, PRIVATE oder PUBLIC). < memvar >
is the name for this variable and the result of < expression > is
assigned to it, each time the record pointer is moved.
INTO < oApp >
< oApp > is the name of the memory variable that references an
Application Part. It defaults to appObject (refer to the INTO
clause of DCAPPEDIT or DCAPPBROWSE).
TYPE < cType >
< cType > is an upper case letter that optionally specifies the
data type of the field < cFieldName > .
LEN < nLen >
< nLen > is a numeric value that optionally specifies the length of
the field < cFieldName > .
DEC < nDec >
< nDec > is a numeric value that optionally specifies the number of
decimal places of the field < cFieldName > .
FONT < cFontCompoundName >
The FONT clause optionally specifies a character string defining
the compound name of the font to be used for displaying a field
(see also the :setFontCompoundName() method of Xbase Parts).
COLOR < nForeGround1 > [, < nBackGround1 >]
The COLOR option specifies foreground and background color for
the display of a single field. #define constants from XBP.CH or
GRA.CH must be used (XBPSYSCLR_* or GRA_CLR_*).
HILITE < nForeGround2 > [, < nBackGround2 >]
The option HILITE defines foreground and background color for
hilighted display of a field. This option is used differently in
different Application Parts. For APPBROWSE it defines the color
of the cell cursor, while APPEDIT uses it as color to mark text
in an entry field.
ALIGN LEFT | CENTER | RIGHT
The option ALIGN defines alignment of displayed data: left,
center or right.
WIDTH < nWidth >
< nWidth > defines the width of a field for display. It is a
numeric value and corresponds to "number of characters". The
width is calculated from the expression Replicate("W",< nWidth >),
because W is the widest character in a proportional font.
READONLY
The option READONLY suppresses the possibility to edit a field.
READONLY is always set when DCAPPFIELD is not used with a field
name, but with an assignment (< memvar > := < expression >).
HEADING | CAPTION < cHeading > [ < Options > ]
< cHeading > is a character string that is displayed as column
heading with DCAPPBROWSE, and as caption of an entry field with
DCAPPEDIT. The key words COLOR, FONT and ALIGN can be used for
< Options > . This allows to define color, font and alignment for
a single column heading or caption.
FOOTING | COMMENT < cFooting > [ < Options > ]
< cFooting > is a character string that is displayed as column
footing with DCAPPBROWSE, and as message in the status line with
APPEDIT. The key words COLOR, FONT and ALIGN can be used for
< Options > . This allows to define color, font and alignment for
a single column heading or message.
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:
DCAPPFIELD is an adaption of the Xbase Application Parts command
APPFIELD in the DCDIALOG Getlist system.
The DCAPPFIELD command is used to configure the display of single
fields in Application Parts in greater detail, compared to the
available options of the DCAPPEDIT or DCAPPBROWSE command. In
addition, DCAPPFIELD allows to define an expression, rather than
a field, whose result is displayed in an Application Part. This
is coded as an assignment, where the inline assignment operator
must be used to assign the result of an expression to a memory
variable.
The DCAPPFIELD command can only be used after a command that
creates an Application part. For example, the command DCAPPEDIT
or DCAPPBROWSE must be executed in a program (added to the
GetList array) before DCAPPFIELD may be used (added to the
GetList array).
Examples:
#include "dcapp.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oStatic, oAppEdit
USE COLLECT NEW SHARED
@ 0,0 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,18.5 ;
GROUP oStatic
DCAPPEDIT INTO oAppEdit STYLE 3D POSITION 0,0 PARENT oStatic
DCAPPFIELD COLLECT->descrip INTO oAppEdit ;
CAPTION 'Description' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->type INTO oAppEdit ;
CAPTION 'Type' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->sub_type INTO oAppEdit ;
CAPTION 'Sub-Type' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->location INTO oAppEdit ;
CAPTION 'Location' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->date_orig INTO oAppEdit ;
CAPTION 'Date of Origin' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->date_acqu INTO oAppEdit ;
CAPTION 'Acquired Date' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->appr_value INTO oAppEdit ;
CAPTION 'Appraised Value' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->for_sale INTO oAppEdit ;
CAPTION 'For Sale?' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->condition INTO oAppEdit ;
CAPTION 'Condition' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->bitmap1 INTO oAppEdit ;
CAPTION 'Bit Map File #1' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->bitmap2 INTO oAppEdit ;
CAPTION 'Bit Map File #2' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->comments INTO oAppEdit ;
CAPTION 'Comments' ;
COLOR GRA_CLR_BLUE
DCAPPFIELD COLLECT->memo INTO oAppEdit ;
CAPTION 'How was this item acquired?' ;
COLOR GRA_CLR_BLUE ;
WIDTH 60
DCREAD GUI ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCAPP.CH
See Also:
DCREAD GUI
dc_readgui()
DCBDEBUG
Send debug information to a browse-style debugging window
Syntax:
DCBDEBUG < xExpr1 > [ ; < xExprN > ] ;
[WINDOW < nWindow >] ;
[COLOR < nbFgColor > [,< nBgColor >] ;
[PAUSE < bPause >] ;
[PAUSE] ;
[ALWAYSONTOP] ;
[WHEN < bWhen >]
Arguments:
< xExpr1 > through < xExprN > is any expression.
WINDOW < nWindow > is the debug window to send the information.
If this clause is not used then the information is sent to debug
window # 1.
COLOR < nbFgColor > and < nBgColor > are the foreground and
background
colors of the information to display in the window. If < nbFgColor >
is a code block, then < nBgColor > is ignored. The code block must
return an array of two numeric elements, ie a foreground color
and a background color.
PAUSE will cause the program execution to stop until the "Continue"
button on the debug window is activated.
PAUSE < bPause > will cause the program execution to stop only if
< bPause > evaluates as .TRUE.
ALWAYSONTOP will force the debug window to always display in
front of all other windows.
WHEN < bWhen > is a codeblock that will cause the debug info to be
displayed only when the codeblock returns .t.
Ex: DCBDEBUG i, oInfo WHEN {||i==16}
Description:
DCBDEBUG or DD is used to send data to a browse-style debugging window
when debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed in a new row in the browse window.
This is a major improvement over DCQDEBUG because it uses an array
browse rather than a memo to show debug information. Improvements:
a. Updating the window is much faster therefore does not slow
down application.
b. Data is in resizeable and moveable columns
c. Each debug line may have its own color.
d. Supports multiple windows.
e. Double-Clicking on debug item in window displays more info
about that item, such as array browsing, object inspecting,
etc.
f. Information doesn't scroll off the window. No limit to amount
of debugging information.
g. Double-clicking the heading of a column will optimize the
width of that column to display all data.
h. Double-clicking the data area of a column will cause the
editor to go to the associated line of code in the source
file.
Notes:
A shortened command: DD
Use this as a replacement for DCBDEBUG.
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCBDEBUG Alias(), RecCount()
DCBDEBUG RecNo() WINDOW 2 COLOR GRA_CLR_RED
Source/Library:
DCDIALOG.CH
See Also:
dc_debugbrowse()
DCQDEBUG
DCLDEBUG
WTF
DCBITMAP
Create a BITMAP object for displaying with the GUI reader
Syntax:
DCBITMAP < ncoRes > ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[TARGETRECT
< nTgtSrow >,< nTgtScol >,< nTgtErow >,< nTgtEcol &
#062] ;
[SOURCERECT
< nSrcSRow >,< nSrcSCol >,< nSrcERow >,< nSrcECol &
#062] ;
[BITS < nB >] ;
[PLANES < nP >] ;
[OBJECT < oObject >] ;
[CARGO < xCargo >] ;
[AUTOSCALE] ;
[CENTER] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >] ;
[SUBCLASS < cSubClass >]
Arguments:
TARGETRECT
< nTgtSRow >,< nTgtSCol >,< nTgtERow >,< nTgtECol &
#062 identifies
the TARGET rectangular area in the presentation space where the
bitmap is displayed. If they are not included, the output area
is the same size as the area of SOURCERECT.
SOURCERECT
< nSrcSRow >,< nSrcSCol >,< nSrcERow >,< nSrcECol &
#062 specifies
a rectangular area of the bitmap that is displayed in the
presentation space. The coordinates must always be specified in
pixels and are device dependent. The default value for SOURCERECT
aSourceRect > is {0, 0, oBitmap:xSize, oBitmap:ySize} which is the
entire bitmap.
< ncoRes > is the value of the bitmap. This may be one of the
following types:
(N)umeric - A resource that is linked to the .EXE
(C)haracter - The name of a .BMP file to load or the name of a
.JPG (JPEG) file to load. It must not be a macro unless < ncoRes >
is a codeblock.
(O)bject - A bitmap object derived from the XbpBitmap() class.
The < ncoRes > is automatically anchored via a Get-Set codeblock
created by DC_GetAnchorCB() unless < ncoRes > is a custom Get-Set
code block.
PARENT < oParent > is the name of the variable that was
assigned to the parent STATIC object for this BitMap Object.
Only use this command if you are placing this Browse onto
another dialogue object. If this clause is not used, then the
BitMap 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.
BITS < nB > contains the number of bits that are used for color
coding in the bitmap. This value is generally 8 for a color
bitmap and 1 for a black and white bitmap.
PLANES < nP > contains the number of bit planes (color levels) that
are used to code pixels in the raster image. Generally the value
is 1. For a true color bitmap, the value is 3, meaning that a
screen dot is formed by 3x8 = 24 bits.
OBJECT < oObject > is local variable name to store a reference
to this object after it is created.
AUTOSCALE will automatically scale the BitMap to fit the
presentation space of the parent object using the same aspect
ratio as the original bitmap. If this option is not used, then
the bitmap with fill the entire area of the presentation space.
CENTER will center the bitmap in the presentation of the parent
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.
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.
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().
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.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpBitMap().
This class should inherit from DC_XbpBitMap().
See the example in \exp19\samples\subclass.
Description:
The command DCBITMAP creates a new BitMap object and
adds the object to the array named GETLIST which is later
processed by the DC_READGETS() function or by the DCREAD
command. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD 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.
The GetList is passed to the function DC_READGETS() which
looks at the DC_GUI() flag and determines whether to process
this list as a standard text-based get screen or as a
GUI-based dialogue.
A DCBITMAP object is drawn into the presentation space of a
parent DCSTATIC object. This command is used to draw
bitmaps like .BMP files, .JPG files and resources that have
been linked in the .EXE.
DCBITMAP objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON or @..DCMULTILINE.
Examples:
#include 'dcdialog.ch'
#include 'appevent.ch'
PROCEDURE Xtest()
LOCAL GetList := {}, oClipPhoto, oBitMap, cBitMap, lPlayBack
@ 4,10 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 50,10 ;
GROUP oClipPhoto
cBitMap := ''
DCBITMAP cBitMap PARENT oClipPhoto AUTOSCALE OBJECT oBitMap
lPlayBack := .f.
@ 4,65 DCPUSHBUTTON CAPTION 'PlayBack' SIZE 9,2 ;
TOOLTIP 'Play Back all BitMaps in IMAGES.DBF' ;
ACTION {||lPlayBack := .t., ;
DisplayImages(oClipPhoto,oBitMap,@lPlayBack) }
@ 7,65 DCPUSHBUTTON CAPTION 'Stop' SIZE 9,2 ;
TOOLTIP 'Stop the Play Back' ;
ACTION {||lPlayBack := .f.}
DCREAD GUI FIT ADDBUTTONS TITLE 'BitMap Demo'
RETURN
/* ------------------- */
STATIC PROCEDURE DisplayImages( oClipPhoto, oBitMap, lPlayBack )
LOCAL nSeconds, lClearBox := .t., nSaveArea := Select(), cBmpDb, ;
nEvent, oXbp, mp1, mp2, cAlaskaDrive
IF !lPlayBack
RETURN
ENDIF
cBmpDb := 'C:\ALASKA\XPPW32\SOURCE\SAMPLES\DATA\BMPDB.DBF'
IF !File(cBmpDb)
cAlaskaDrive := SubStr(GetEnv('XPPRESOURCE'),1,2)
cBmpDb := Strtran(cBmpDb,'C:',cAlaskaDrive)
ENDIF
IF File(cBmpDb)
IF !DC_DbSel('BMPDB')
USE (cBmpDb) NEW VIA foxcdx
ENDIF
nEvent := xbeP_None
DO WHILE lPlayBack .AND. nEvent # xbeP_Close
oBitMap:setBuffer(FIELD->BITMAP,XBPBMP_FORMAT_WIN3X)
DC_BitMapDraw( oClipPhoto, oBitMap, lClearBox )
lClearBox := .f.
IF Eof()
DbGoTop()
ELSE
DbSkip(1)
ENDIF
Sleep(0.1)
nEvent := AppEvent( @mp1, @mp2, @oXbp, .01 )
IF Valtype(oXbp) = 'O'
oXbp:handleEvent( nEvent, mp1, mp2, oXbp )
ENDIF
ENDDO
CLOSE
ENDIF
RETURN
Source/Library:
DCDIALOG.CH
DCBROWSECOL
Create a BROWSE column object for displaying with GUI reader
Syntax:
DCBROWSECOL ;
[DATA < bData >] ;
[FIELD < xField >] ;
[ELEMENT < nElement >] ;
[HEADER < cHeader > [HCOLOR < bncHFgC >
[,< ncHBgC >]]] ;
* [HEADPRES < aHeadPres >] ;
* [WIDTH < nWidth > [PIXEL] ] ;
[PICTURE < bcPicture >] ;
[FOOTER < cFooter >] ;
* [FOOTPRES < aFootPres >] ;
* [TYPE < nType >] ;
[COLOR < bncFgC > [,< ncBgC >] ] ;
[FONT < bocFont >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[TOOLTIP < bcToolTip >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[HELPCODE < cHelpCode >] ;
[OBJECT < oObject >] ;
[CARGO < xCargo >] ;
* [PRESENTATION < aPres >] ;
* [VALID < bValid > [ALWAYS]] ;
[WHEN < bWhen >] ;
[HIDE < bHide >] ;
* [PROTECT < bProtect >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[SORT < bSort > [LEFTBUTTON] [DEFAULT] ] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
* [ACCELKEY < anAccel >] ;
* [GOTFOCUS < bGotFocus >] ;
* [LOSTFOCUS < bLostFocus >] ;
* [VISIBLE] ;
* [INVISIBLE] ;
[GROUP < cGroup >] ;
* [EDITOR < bcEditor > [EXITKEY < nExitKey >]] ;
* [TYPE < anType >] ;
* [REPRESENTATION < aRep >] ;
[ALIGN < nAlign >] ;
* [DATATOOLTIP < bToolEnable > [TIPBLOCK < bTipBlock >] ] ;
* [DRAG < bDrag > [DIALOG < bDD >] ;
* [DROP < bDrop > [CURSOR < nDropCursor >] ;
* [SUBCLASS < cSubClass >] ;
* [OBJECTVAR < bcObjectVarName > [ELEMENT
< nObjectElement >]] ;
* [OWNERDRAW]
Arguments:
DATA < abData > is a or an array of code blocks code block to evaluate.
If browsing an array use a code block like so:
{||DC_GetColArray(< nArrayElement >,< oBrowse >)} ****
If browsing a database use a code block like so:
{||CUSTOMER- >cust_name}
If Multi-Row browsing is desired, use an array of code blocks
like so:
{ {||'Size: ' + Alltrim(Str(DC_GetColArray(2,oBrowse)))}, ;
{||'Date: ' + DtoC(DC_GetColArray(3,oBrowse))}, ;
{||'Time: ' + DC_GetColArray(4,oBrowse)} }
NOTE: Multirow browsing causes the data in each code block to
be displayed on a separate line within the row of the
browse. This requires using presentation parameters
to increase the height of each row. See the sample
MULTIROW.PRG sample in SAMPLES\BROWSE.
- or -
FIELD < cField > is the name of a database field to browse.
Use this clause only with databases instead of the DATA < bData >
clause. The field clause will create a GET/SET style codeblock
which is needed when using the cell-editing feature with the
EDIT clause of the @ DCBROWSE command. The cell editor handles
handles record locking and unlocking.
- or -
ELEMENT < nElement > is the element number of a multi-dimensional
array. Use this clause only with arrays instead of the DATA < bData >
clause.
< oBrowse > is the name of the variable to assign as a storage
place for this object.
WIDTH < nWidth > is the width of the column in characters unless
the PIXEL clause is used thus making the column width in pixels.
Note: If a proportional font is used (ie. Arial) and the PIXEL
clause is not used, the width of the column will not be the
same as the number of characters displayed.
HEADER < bcHeader > is the heading of the column. If the parent
is a DCBROWSE object, this may be a multiple-line header if
the HEADLINES < nLines > clause of the parent @ DCBROWSE command
is used. If < bcHeader > is a code block, it must return a character
string. A code block header is reevaluated every time the ::refresh()
method of the parent DC_XbpBrowse() object is called. It is also
reevaluted by calling DC_GetRefresh(GetList).
HCOLOR < bncHFGc >, < ncHBGc > are foreground and background
colors of
the header. 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. The array may also consist of two sub-arrays
containing RGB colors. ****
HEADPRES < aHeadPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Header 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 header 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. If no PRESENTATION clause is used, then the default
is the PRESENTATION parameters of the parent Browse object. ****
FOOTER < cFooter > is an optional footer for the column. This may be
a multiple-line footer if the FOOTLINES < nLines > clause of the
parent @ DCBROWSE command is used. ****
FOOTPRES < aFootPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Footer 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 header 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. If no PRESENTATION clause is used, then the default
is the PRESENTATION parameters of the parent Browse object. ****
PICTURE < cPicture > is any valid picture clause which will modify
the presentation of the data via the Transform() function. ****
PARENT < oParent > is the name of the variable that was assigned to
the parent browse object previously created by the @ DCBROWSE
command or the @ DCQUICKBROWSE 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.
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 Column 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. If no PRESENTATION clause is used, then the default
is the PRESENTATION parameters of the parent Browse 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.
VALID < bValid > is a code block to be evaluated for validating
the data-entered when cell-editing in the browse. The code
block is only used when cell-editing is enabled with the EDIT
clause of the @ DCBROWSE command and cell editor object does not
have its own VALID clause. The code block must return a
logical value. The edit buffer is passed to the code block,
therefore the codeblock should like like so:
{ |c| !Empty(c) }
If the cell editor object has it's own valid clause then the
VALID clause will be ignored and the editor object is passed to
the editor's code block. The ALWAYS sub-clause will cause the
code block to be evaluated always when cell editing rather than
just when the value changes.
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. < oMsgBox > may also be any object that
supports the :setCaption() method. ****
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.
OBJECT < oObject > is the name of a variable to use as a container
for the XbpColumn 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. 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. ****
WHEN < bWhen > is a code block to be evaluated before setting focus
to this column. The code block must return a logical value. If
the code block returns a .FALSE. the cell cannot be highlighted
or resized. ****
HIDE < bHide > is a code block to be evaluated to hide this column.
The code block must return a logical value. If the code block
returns a .FALSE. the column will be displayed, otherwise it will
be hidden. The code block is evaluated by DC_GetRefresh().
PROTECT < bProtect > is a code block to be evaluated before cell-
editing in the browse. The code block must return a logical value.
If the code block returns a .TRUE. the cell cannot be edited.
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. ****
SORT < bSort > is an optional code block to evaluate for sorting
the browse when the mouse right button is clicked in the header
area of a column. **** Usage of the code block is as follows:
{ | aPos, nColPos, self | ... }
< aPos > is a two-element array containing the mouse coordinates.
< nColPos > is the column number of the browse column.
< self > is
the Column object. LEFTBUTTON is an optional clause that enables
the use of the LEFT mouse button in the header, otherwise only
the RIGHT button is enabled. The left button is disabled by
default to prevent conflict with column sizing.
DEFAULT will establish this column as the default sorted column,
as though the mouse was clicked in the header. This clause
should be used only if the sort order established by the sort
block is equal to the current sort order.
NOTE: The heading colors and bitmaps for the sorted columns may
be established by the SORT* clauses of the @ DCBROWSE
command. The value returned by the code block determines
whether or not the column header is highlighted. If the
value is a .FALSE., then the header is not highlighted.
Any other value will cause the header to be highlighted.
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|...}
****
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
****
EDITOR < bcEditor > may be the character string ID of the object
in the GetList which will be used as the Cell-Editor for this
column or a code-block. Cell-editing is enabled via the EDIT
clause of the DCBROWSE command which created the parent object for
this column. If the EDITOR clause is not used then the cell-editor
is a standard DCGET. Any existing object such as a DCGET,
DCMULTILINE, DCCOMBOBOX, etc. may be used as the cell editor,
however it must have been assigned an ID. All properties of the
cell editor are used as they were defined by it's respective command
with the exception of the width, which is determined by the width of
the cell. If < bcEditor > is a codeblock, the codeblock will be
evaluated when the edit mode is invoked.
CELL EDITING NOTE 1: When using a DC* command to create an object
which will be used only as a cell editor and not displayed in
the dialog, < nRow > and < nCol > coordinates must be entered
as NIL
and no parent clause is required. If the DC* command being used
as the cell editor is a Getlist object that is also painted on a
dialog screen with < nRow > and < nCol > coordinates, the SIZE
must
be in PIXELS.
CELL EDITING NOTE 2: EXITKEY < nExitKey > is the key to use to exit
the editing within the cell and move to the next cell. The
default is xbeK_ENTER. When editing a cell with a DCMULTILINE
object it is recommended that < nExitKey > be a key such as
xbeK_END or xbeK_F10.
CELL EDITING NOTE 3: The variable associated with the EDITOR
object may be any Get/Set code block or a variable initialized
to a NIL value. When it is a NIL, then the Get/Set code block
attached to the browse column will be used. A NIL variable is
recommended for ease of programming.
TYPE < anType > is an array defining the type of each column.
{ < cValtype >, < nDisplayType >, < cPicture > }.
< 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
< bcPicture > optionally defines a picture string for textual data.
Refer to the Transform() function for picture formatting rules.
If this is a code block, then the code block must return a
character string.
REPRESENTATION < aRep > is an array of information about the
presentation of column. #### The array looks like this:
{ < 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.
ALIGN < nAlign > is a numeric value that defines 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
DATATOOLTIP < bToolEnable > is a code block that is evaluated in
the tooltip thread when the mouse is passed over the data area
of a browse column. If < bEnable > returns a .TRUE. the contents
of the cell are displayed in a tooltip. Use this clause when
browse columns are shorter than the data in the cell. Semicolon (;)
characters or CRLF (Chr(13)+Chr(10)) pairs in the cell are
interpreted as a line break. If < bTipBlock > is a code block then
the return value of the code block will be displayed as the
tooltip. The code block may return a text string or a pointer
to an XbpBitMap() object. If browsing a database, then the
record pointer will be set to the same record as the cell
requesting the tip. If browsing an array, then the row element
number of the cell requesting the tip will be passed to the code
block.
DRAG < bDrag > is a codeblock to evaluate when the left mouse button
is clicked in the object and the drag is started. The return
value of the code block will be stored in memory to be later
retrieved by the Drop operation. A pointer to the clicked on
object is passed to the code block.
DIALOG < bDD > is a codeblock that will evaluate when the drag is
started. This is used to call a function that will create a
dialog window which will move with the mouse during the drag.
The dialog window will be destroyed upon the drop operation
or the release of the mouse.
Ex: DRAG {|o|o:getData()} DIALOG {|mp1,mp2,oXbp|DragDialog(mp1,mp2,oXbp)} ;
DROP < bDrop > is a codeblock to evaluate when the left mouse button
is released in the object and the drag is ended. A pointer to
the object and the value stored in memory at the start of the
Drag are passed to the code block.
CURSOR < nDropCursor > is the mouse cursor that will show when it
is moved over this object during a drag operation.
Ex: DROP {|o,x|o:setData(x),o:invalidateRect()} ;
CURSOR POINTER_DATADROP_ASSIGN
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpColumn().
This class should inherit from DC_XbpColumn().
See the example in \exp19\samples\subclass.
OBJECTVAR < bcObjectVarName > is the name of an iVar in an object
that exists in the array being browsed. If < bcObjectVarName > is
a code block, then the object is passed as the first parameter to
the code block. ELEMENT < nObjectVarElement > is required if the
object column is in a multi-dimensional array. If a single-dimensional
array of objects is being browsed, then the ELEMENT clause is not used.
To see how to use the OBJECTVAR clause look at the sample
in .\samples\browse\objects.prg.
OWNERDRAW provides the ownerdraw capability to the browse system.
See the example in .\samples\browse\ownerdraw.prg. Columns that
do not use the ownerdraw clause will be drawn by the default draw
system, otherwise they will be drawn by the custom draw system.
Description:
The command DCBROWSECOL creates a new Browse column 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 DCBROWSECOL object can only be added to a DCBROWSE object
or a DCQUICKBROWSE object (the parent) which must be created
first.
NAME <þcVarNameþ> is the variable name to assign to the GET
object (for HTML based applications.)
Notes:
Clauses marked with an asterisk ( * ) are not supported by
DCREAD HTML.
Text that includes a **** denotes that this feature is supported
only when the parent object is a DCBROWSE (XbpBrowse) object.
Text that includes a #### denotes that this feature is supported
only when the parent object is a DCQUICKBROWSE (XbpQuickBrowse)
object.
GUI applications:
When using a DCBROWSE object (DC_XbpBrowse) as the parent for
DCBROWSECOL, a DC_XbpColumn object is created and added to the
childlist of the DC_XbpBrowse parent.
When using a DCQUICKBROWSE object (DC_XbpQuickBrowse) as the
parent for a DCBROWSECOL, there is no child object created,
instead the DCBROWECOL command creates a psuedo-object of
the DC_QBColumn() class for use with cell-editing. These
column objects are not children of the DC_XbpQuickBrowse class
but instead are added to an array that is stored in the
parent's :cargo slot.
----------------------
HTML applications:
A column object of the DC_HtmlColumn() class is created
and added to the childlist 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 := "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
/*
This is an example of an array editor which
uses custom EDITORs for cell-editing.
*/
FUNCTION XSample_49()
LOCAL oBrowse, oBrowBox, aStructure, aFields, GetList := {}, ;
oToolBar, GetOptions, aOldStruct, lOk, oColumn1, nPointer, ;
aField, xNIL := NIL
USE collect VIA 'DBFNTX'
aStructure := dbstruct()
aOldStruct := AClone(aStructure)
aFields := ARRAY(LEN(aStructure))
aFields := aStructure[1]
FOR nPointer := 1 TO Len(aStructure)
aStructure[nPointer,1] := Pad(aStructure[nPointer,1],10)
NEXT
nPointer := 1
@ 2,2 DCSTATIC XBPSTATIC_TYPE_RECESSEDBOX SIZE 45,12 ;
OBJECT oBrowBox
@ .1,.5 DCBROWSE oBrowse DATA aStructure PARENT oBrowBox;
SIZE 43,11.8 EDIT xbeBRW_ItemSelected ;
INTO aField ;
POINTER nPointer ;
DELETE xbeK_DEL ;
INSERT xbeK_INS
DCBROWSECOL ELEMENT 1 WIDTH 8 HEADER "Name" PARENT oBrowse ;
OBJECT oColumn1 ;
EDITOR 'NAME'
DCBROWSECOL ELEMENT 2 WIDTH 5 HEADER "Type" PARENT oBrowse ;
EDITOR 'TYPE' // VALID {|c|_XSample49(2,c,aStructure,oBrowse)}
DCBROWSECOL ELEMENT 3 WIDTH 5 HEADER "Length" PARENT oBrowse ;
EDITOR 'LENGTH' // VALID {|n|_XSample49(3,n,aStructure,oBrowse)}
DCBROWSECOL ELEMENT 4 WIDTH 5 HEADER "Decimals" PARENT oBrowse ;
EDITOR 'DECIMALS' // VALID {|n|_XSample49(4,n,aStructure,oBrowse)}
@ NIL,NIL DCGET xNIL PICT "@!" GETID 'NAME' ;
VALID {|o|_XSample49(1,aStructure,oBrowse,nPointer)}
@ NIL,NIL DCGET xNIL PICT "!" GETID 'TYPE' ;
VALID {|o|_XSample49(2,aStructure,oBrowse,nPointer)}
@ NIL,NIL DCGET xNIL PICT "999" GETID 'LENGTH' ;
VALID {|o|_XSample49(3,aStructure,oBrowse,nPointer)} ;
WHEN {|o|_XSample49(7,aStructure,oBrowse,nPointer)}
@ NIL,NIL DCGET xNIL PICT "999" GETID 'DECIMALS' ;
VALID {|o|_XSample49(4,aStructure,oBrowse,nPointer)} ;
WHEN {|o|_XSample49(8,aStructure,oBrowse,nPointer)}
@ 15,1 DCTOOLBAR oToolBar SIZE 45,1.5 BUTTONSIZE 10,1.5
DCADDBUTTON CAPTION '&Insert' PARENT oToolBar ;
TOOLTIP 'Add New Field' ;
ACCELKEY xbeK_ALT_I ;
ACTION {||SetAppFocus(oColumn1),PostAppEvent(xbeK_INS,,,oBrowse)}
DCADDBUTTON CAPTION '&Delete' PARENT oToolBar ;
TOOLTIP 'Delete Field' ;
ACCELKEY xbeK_ALT_D ;
ACTION {||SetAppFocus(oColumn1),PostAppEvent(xbeK_DEL,,,oBrowse)}
DCGETOPTIONS ABORTQUERY
DCREAD GUI FIT TITLE "Database Structure Editor";
BUTTONS DCGUI_BUTTON_OK + DCGUI_BUTTON_CANCEL ;
ARRAYTRANSLATE ;
OPTIONS GetOptions ;
TO lOk ;
SETFOCUS oColumn1 ;
EVAL {|o|SetAppWindow(o)}
RETURN IIF( lOk, aStructure, aOldStruct )
/* ------------------- */
STATIC FUNCTION _XSample49( nAction, aStructure, oBrowse, nPointer, xValue )
LOCAL nFound, GetList := {}, GetOptions, ;
nVarLength, nNumStart, nNumEnd, nVarPointer, cNewString, ;
cFieldName, cFieldType, nFieldLen, nFieldDec, nFieldNmbr, lOk, ;
nFieldCount, cVarName, cVar
cFieldName := aStructure[nPointer,1]
cFieldType := aStructure[nPointer,2]
nFieldLen := aStructure[nPointer,3]
nFieldDec := aStructure[nPointer,4]
IF nAction = 1 // Validate field name
nFound := AScan(aStructure,{|a|Upper(a[1])==Upper(cFieldName)})
IF Empty(cFieldName)
DC_WinAlert('Field name cannot be empty')
RETURN .f.
ELSEIF nFound # 0 .AND. nFound # nPointer
DC_WinAlert('Duplicate Field Name. Please re-enter')
RETURN .f.
ENDIF
ELSEIF nAction = 2 // Validate field type
IF !(cFieldType $ 'CLMND')
DC_MsgBox(,,{ ;
'Valid Field types are:', ;
'', ;
'C - Character', ;
'N - Numeric', ;
'D - Date', ;
'L - Logical', ;
'M - Memo'}, ;
'Field Type Error' )
RETURN .f.
ENDIF
ELSEIF nAction = 3 // Validate field Length
IF nFieldLen <= 0
DC_WinAlert('Length cannot be less than 1')
RETURN .f.
ENDIF
ELSEIF nAction = 4 // Validate field decimals
IF cFieldType $ 'CDLM'
aStructure[nPointer,4] := 0
ELSEIF nFieldDec > nFieldLen - 2
DC_WinAlert('Decimals cannot be greater than ' + ;
Str(nFieldLen-2))
RETURN .f.
ENDIF
ELSEIF nAction = 7 // When test for Field Length
IF cFieldType $ 'MDL'
RETURN .f.
ENDIF
RETURN .t.
ELSEIF nAction = 8 // When test for Field Decimals
IF cFieldType $ 'MDLC'
RETURN .f.
ENDIF
RETURN .t.
ENDIF
IF cFieldType = 'C'
aStructure[nPointer,4] := 0
ELSEIF cFieldType = 'M'
aStructure[nPointer,3] := 10
aStructure[nPointer,4] := 0
ELSEIF cFieldType = 'D'
aStructure[nPointer,3] := 8
aStructure[nPointer,4] := 0
ELSEIF cFieldType = 'L'
aStructure[nPointer,3] := 1
aStructure[nPointer,4] := 0
ENDIF
oBrowse:refreshCurrent()
RETURN .t.
/*
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:
@ DCBROWSE
@ DCQUICKBROWSE
dc_htmlcolumn()
DCDOT
Invoke a Dot-prompt window
Syntax:
DCDOT
Arguments:
None.
Description:
DCDOT will load DCLIP1.DLL and run the DC_Dot() function
to invoke a Dot-Prompt window.
Source/Library:
DCDIALOG.CH
See Also:
DC_Dot()
DCQDEBUG
DCEVAL
Evaluate a code block in the GetList
Syntax:
DCEVAL < bEval > ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[GROUP < cGroup >] ;
[WHEN < bWhen >]
Arguments:
< bEval > is the code block to evaluate.
PARENT < oParent > is the parent object. The HTML source is
written only after all the objects are created from the GetList.
The code is written in a heirarchal sequence depending on the
parent/child relations. PARENTID < cPID > may be used as an
alternative method to establish the parent where < cPID > is the
ID of the parent object.
GROUP < cGroup > is the group to which this GetList item belongs.
If the WHEN < bWhen > clause is used, then < bWhen > is
evaluated
first. If it returns a .TRUE. then < bEval > is evaluated otherwise
it is ignored.
Description:
DCEVAL is used to evaluate a code block when the GetList is
processed by DCREAD HTML. The code block will be evaluated in
the order that it appears in the Getlist.
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
DC_ReadHtml()
DCFINDADDCOL
Add column to an array to be used by DCFINDBROWSE
Syntax:
DCFINDADDCOL ;
[DATA < nbData >] [ELEMENT < nElement >] ;
[FIELD < cField >] ;
[HEADER < cHeader > ] ;
[WIDTH < nWidth > ] ;
[TAG,ORDER,INDEX < cIndexOrder >] ;
[TAGPROMPT,ORDERPROMPT,INDEXPROMPT < cIndexPrompt >] ;
[PREFIX < bcPrefix >] ;
[SEEK < bSeek] ;
[TO < aArray >]
Arguments:
DATA < nbData > is a code block for the data to be displayed or
the element number if browsing an array. ex: {||CUSTOMER- >name}
Alternatively, if browsing an array, the clause ELEMENT < nElement >
may be used.
or
FIELD < cField > is the name of a database field.
HEADER < cHeader > is the heading of the column.
WIDTH < nWidth > is the width of the column
TAG | ORDER | INDEX < cIndexOrder > is the Index Name or Tag
(ex: "CUSTNAME") is the index tag to select when right clicking
the column header. If browsing an array, this is the element
number to SORT.
TAGPROMPT | ORDERPROMPT | INDEXPROMPT < cIndexPrompt > is the
Index Prompt (ex: "Customer Name") that is displayed next to
the user input area when this column is selected as the
controlling index for the seek by right-clicking the column
header.
PREFIX < bcPrefix > is the Prefix for AutoSeek. This must be a
character string or a code block. If it is a code block, the
code block must return a character string. The character string
is inserted before the user input buffer when performing the
seek.
SEEK < bSeek > is the Seek string code block. User input buffer
is passed to this code block and the return value of the code
block is used for the seek. If this argument is not used then
the contents of the user input buffer are used for the seek.
ex: {|c|Right(Space(7)+Alltrim(cString),7)}
TO < aArray > is the name of the array to add the column information.
Description:
DCFINDADDCOL is used to add a column to an array to be later
used with DCFINDBROWSE or DC_FindBrowse().
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
// Example 2 - Browsing an array
FUNCTION FindDir()
LOCAL aFields := {}, lStatus, aDir := Directory()
DCFINDADDCOL DATA 1 PROMPT "File Name" ;
HEADER 'File Name' WIDTH 10 TO aFields ORDER 1
DCFINDADDCOL DATA 2 PROMPT "File Size" ;
HEADER 'File Size' WIDTH 10 TO aFields ORDER 2
@ 0,0 DCFINDBROWSE ;
FIELDS aFields ;
SIZE 50, 15 ;
TITLE 'Select a File' ;
AUTOSEEK ;
DATA aDir ;
NOHSCROLL ;
TO lStatus
RETURN lStatus
Source/Library:
DCDIALOG.CH
See Also:
DC_FindBrowse()
DCFORM
A command for creating FORM tags in HTML
Syntax:
@ [ < nRow >,< nCol > ] DCFORM ;
[OBJECT < oForm >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[ACTION < cAction >] ;
[TARGET < cTarget >] ;
[ENCTYPE < cEncType >] ;
[METHOD < cMethod >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT < bcPreHtml >] ;
[POST,POSTTEXT < bcPostHtml >] ;
[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.
ENCTYPE < cEncType > is the encoding type of the data submitted.
The default is "application/x-www-form-urlencoded". An
alternate type is "multipart/form-data".
ACTION < cAction > is the URL of the application that receives
and processes the form data.
METHOD < cMethod > is the method for sending the data to the
application server. The valid options are "GET" and "POST".
For small forms with few variables use "GET". For large
forms with many variables use "POST".
TARGET < cTarget > is the name of the window or frame which will
receive the posted data.
OBJECT < oForm > 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 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.
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:
DCFORM is a command for creating HTML form elements.
The command DCFORM creates an HTML element 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.
Notes:
DCFORM creates an object of the DC_HtmlForm() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oForm, cHtml, oTable, cComment1, cComment2
DCFORM OBJECT oForm METHOD "POST" ;
ACTION "http://donnay-software.com:8083"
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 cHtml
Source/Library:
DCHTML.PRG
See Also:
DCREAD HTML
dc_htmlform()
dc_readhtml()
DCFRAME
A command for creating FRAME tags in HTML
Syntax:
DCFRAME ;
[OBJECT < oObject >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[NAME < cName >] ;
[MARGINHEIGHT < nMarginHeight >] ;
[MARGINWIDTH < nMarginWidth >] ;
[NORESIZE] ;
[NOSCROLL] ;
[SRC,SOURCE < src >] ;
[FRAMEBORDER < nFrameBorder >] ;
[BORDERCOLOR < cBorderColor >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT < bcPreText >] ;
[POST,POSTTEXT < bcPostText >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
Arguments:
NAME < cName > labels the frame for later reference by the
"target" attribute of other HTML elements.
SRC < src > is the URL of the document that is to be
displayed in the frame. There is no other way to provide
content for a frame.
MARGINHEIGHT < nMarginHeight > and MARGINWIDTH < nMarginWidth >
are used to put space (in pixels) between the edge of the
frame and its contents.
NORESIZE freezes the relative proportions of the frame
so it may not be resized.
NOSCROLL suppresses vertical and horizontal scrollbars
with frames whose contents exceed the allotted window
space.
FRAMEBORDER < nFrameBorder > is used to determine whether
or not there is a frame border. A value of 1 turns on
the border. A value of 0 turns off the border.
BORDERCOLOR < cBorderColor > is the color of the frame border.
Color may be an RGB color value (#XXXXXX) , a standard color
name, an RGB 3-element array or a numeric value defined in
GRA.CH.
OBJECT < oLink > 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 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.
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 DCFRAME creates an HTML FRAME 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.
Notes:
DCFRAME creates an object of the DC_HtmlFrame() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], cHtml, oFrameSet
DCFRAMESET OBJECT oFrameSet ;
ROWS '60%,*'
DCFRAME ;
PARENT oFrameSet ;
NAME 'donnay' ;
SRC 'http://donnay-software.com'
DCFRAME ;
PARENT oFrameSet ;
FRAMEBORDER 0 ;
NAME 'google' ;
SRC 'http://www.google.com'
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_html()
dc_readhtml()
dc_htmlframe()
DCFRAMESET
A command for creating FRAMESET tags in HTML
Syntax:
DCFRAMESET ;
[OBJECT < oObject >] ;
[ROWS < nRows >] ;
[COLS,COLUMNS < nCols >] ;
[NAME < cName >] ;
[FRAMEBORDER < nFrameBorder >] ;
[BORDER < nBorder >] ;
[BORDERCOLOR < cBorderColor >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT] ;
[POST,POSTTEXT >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
Arguments:
COLS,COLUMNS < columns > and ROWS < rows > defines the number
of
columns and rows of either frames or nested framesets.
Both attributes accept a quote-enclosed, comman-separated
list of values that specify either the absolute or relative
width (for columns) or height (for rows) for the frames.
The number of attribute valuess determines how many rows or
columns of frames will display in the document window.
Express each value in the < rows > or < columns > attribute
in one of three ways:
1. As absolute number of pixels.
2. As a percentage of the total width or height of the
frameset.
3. As a portion of the space remaining after setting aside
room for adacent elements.
Examples:< rows > = "150,300,150"
< rows > = "25%,50%,25%"
< columns > = "100,*"
< columns > = "10,*,10"
< rows > = "*,100,*"
NAME < cName > is the name to assign to the frameset.
FRAMEBORDER < nFrameBorder > is used to determine whether
or not there is a frame border. A value of 1 turns on the
border. A value of 0 turns off the border.
BORDER < nBorder > is the width of the frame border in pixels.
BORDERCOLOR < cBorderColor > is the color of the frame border.
Color may be an RGB color value (#XXXXXX) , a standard color
name, an RGB 3-element array or a numeric value defined in
GRA.CH.
OBJECT < oLink > 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 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.
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 DCFRAMESET creates an HTML FRAMESET 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.
Notes:
DCFRAMESET creates an object of the DC_HtmlFrameSet()
class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], cHtml, oFrameSet
DCFRAMESET OBJECT oFrameSet ;
ROWS '60%,*'
DCFRAME ;
PARENT oFrameSet ;
NAME 'donnay' ;
SRC 'http://donnay-software.com'
DCFRAME ;
PARENT oFrameSet ;
FRAMEBORDER 0 ;
NAME 'google' ;
SRC 'http://www.google.com'
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_readhtml()
dc_htmlframeset()
dc_htmlframe()
DCGETOPTIONS
Set the options for the Dialog Reader
Syntax:
DCGETOPTIONS ;
[NAME < cName >] ;
[TITLE < cTitle >] ;
[WINDOWHEIGHT < nWndHeight >] ;
[WINDOWWIDTH < nWndWidth >] ;
[ROWSPACE < nRowSpace >] ;
[FONT < cFont >] ;
[SAYFONT < cSayFont >] ;
[SAYWIDTH < nSayWidth >] ;
[SAYHEIGHT < nSayHeight >] ;
[GETHEIGHT < nGetHeight >] ;
[GETFONT < cGetFont >] ;
[WINDOWROW < nWindowRow >] ;
[WINDOWCOL < nWindowCol >] ;
[ROWOFFSET < nRowOffset >] ;
[COLOFFSET < nColOffset >] ;
[MENU < acMenu > [MSGBOX < oMsgBox >]] ;
[PIXEL] ;
[BUTTONS < aButtons >] ;
[ICON < nIcon >] ;
[CHECKGET] ;
[HELPFILE,HELPBLOCK < bcHelp >] ;
[HELPCODE < cHelpCode >] ;
[VISIBLE] ;
[NOTRANSLATE] ;
[SAYRIGHT] ;
[BITMAP < nBitMap >] ;
[PRESENTATION < aPres >] ;
[SAYOPTIONS < nSayOpt >] ;
[COLOR < anBGColor >] ;
[NOMINBUTTON] ;
[NOMAXBUTTON] ;
[TABSTOP] ;
[NOTABSTOP] ;
[ABORTQUERY [MSG < bAbortQuery >]] ;
[CLOSEQUERY [MSG < bCloseQuery >]] ;
[EXITQUERY [MSG < bExitQuery >]] ;
[QUITQUERY [MSG < bQuitQuery >]] ;
[ROWPIXELS < nRowPixels >] ;
[COLPIXELS < nColPixels >] ;
[NOESCAPEKEY] ;
[DESIGN [HOTKEY < nDesignHotKey >]];
[SOURCECODE < cSource >] ;
[TOOLTIPCOLOR < nTTFg >, < nTTBg >] ;
[TOOLTIPFONT < cTTFont >] ;
[BORDER < nBorder >] ;
[EXITVALIDATE] ;
[NOTASKLIST] ;
[MINSIZE < nMinWidth >, < nMinHeight >] ;
[MAXSIZE < nMaxWidth >, < nMaxHeight >] ;
[NORESIZE] ;
[NOTITLEBAR] ;
[NOMOVEWITHOWNER] ;
[ORIGIN < nOrigin >] ;
[HILITEGETS < nbColor >] ;
[COLORGETS < aColors >] ;
[NOSUPERVISE] ;
[HIDE] ;
[NOBUSYPOINTER] ;
[BUSY < cBusyMsg > ] ;
[CASCADE] ;
[AUTORESIZE] ;
[RESIZE] ;
[CONFIRM] ;
[NOCONFIRM] ;
[FITPAD < nFitPad >] ;
[BUTTONALIGN < nButtonAlign >] ;
[DISABLEDCOLOR < anDisabledColor >] ;
[ENTERTAB] ;
[PREEVAL < bPreEval > ] ;
[EVAL < bEval >] ;
[EDITPROTECT < bProtect >] ;
[MESSAGEINTO < obMsgBox >] ;
... more > > See DCGETOPTIONS (2)
Arguments:
The Dialog Options List is simply a single-dimensionsal array
of 60+ elements. eXPress++ Dialog options are included in
DCDIALOG.CH. Before using the DCGETOPTIONS command you should
declare the GetOptions array variable like so:
LOCAL GetOptions
The elements of the options array are defined as follows:
NAME < cName > is the name of the Dialog screen or application.
It must be all Upper Case characters no longer than characters
in length. It is a unique name assigned to the dialog for saving
to the dCLIP++ DIALOG dictionary database.
TITLE < cTitle > is the title or description of the dialog.
WINDOWHEIGHT < nWndHeight > is the dialog window height in
pixels.
WINDOWWIDTH < nWndWidth > is the dialog window width in pixels.
ROWSPACE < nRowSpace > is the number of pixels between rows when
using text-based coordinates in the Getlist. The default is 20.
This parameter does NOT affect font height.
SAYWIDTH < nSayWidth > is the default width for DCSAY objects if
the SAYSIZE parameter is not used with the DCSAY command.
SAYWIDTH 0 will cause all DCSAY objects (XbpStatic) to be
automatically sized to the size of the text taking into
consideration the selected font.
SAYHEIGHT < nSayHeight > is the default HEIGHT (in pixels) of the
SAY in DCGET and @..DCSAY..GET commands. If this parameter is not
specified then the default height is 20.
FONT < cFont > is the default FONT for all child objects of the
dialog window.
SAYFONT < cSayFont > is the default FONT for DCSAY objects if the
FONT parameter is not used with the DCSAY command. If this parameter
is not specified then the DCSAY object uses the font of the parent.
GETFONT < cGetFont > is the default FONT for DCGET and
@..DCSAY..GET objects if the FONT parameter is not used with the
DCGET or @..DCSAY..GET commands. If this parameter is not
specified, then the object uses the font of the parent.
GETHEIGHT < nGetHeight > is the default HEIGHT (in pixels) of the
GET in DCGET and @..DCSAY..GET commands. If this parameter is not
specified then the default height is 20.
BUTTONS < aButtons > is an optional multi-dimensional array of
buttons to add to the bottom of the dialog box. Each button will
be added in sequence from left to right. Each sub-array is an
array of 13 elements defining the buttons.
Element Type Description
------- ---- ------------------------------------
1 C Button Caption
2 N Button Width (in pixels) Default is 60
3 N Button Height (in pixels) Default is 22
4 B Action Code Block
5 X Button Cargo
6 N/C/O Bitmap resource, name or object when element
7 is an object
7 O Configuration object of the DC_PushButtonXPConfig()
class.
8 B WHEN code block
9 C/B Tooltip text or codeblock
10 C/O Font compound name or font object
11 N/A Accelerator hotkey or array of hot keys.
12 B Menu Action Code Block
NOTE: The BUTTONS array can be used to add custom buttons in
addition to the buttons provided by DCREAD GUI BUTTONS
@..DCPUSHBUTTON.
WINDOWROW < nWndRow > is the starting row of the dialog window
(in pixels). If this argument is nt specified, then the dialog
will be centered vertically in the parent.
WINDOWCOL < nWndCol > is the starting column of the dialog window
(in pixels). If this argument is not specified, then the dialog
will be centered horizontally in the parent.
ROWOFFSET < nRowOffset > is the row offset (in pixels) to add to
each dialog object. The default is 0.
COLOFFSET < nColOffset > is the column offset (in pixels) to add
to each dialog object. The default is 0.
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.
The PIXEL argument forces all coordinates in the Getlist to be
based on pixels, otherwise they are text-based coordinates.
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.
COLOR < anBGColor > is the color to use as the background for the
dialog window. If < anBGColor > is a numeric value, then it must
be a GRA_CLR_* (defined in GRA.CH). If < anBGColor > is an array,
it must contain three numeric values (R,G and B respectively).
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Dialog window.
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.
SAYOPTIONS < nSayOpt > is a set of text alignment options.
Objects created by the @..DCSAY command can be given a set of
options which are used to align the text within the rectangular
area of the say (XbpStatic) object. Constants defined in the
XBP.CH file are used for these options. These constants are
listed in the table below. If combinations of alignment options
are required, the sum of the appropriate constants must are
assigned to the instance variable :options .
#define constants for aligning text
Constant Description
XBPSTATIC_TEXT_LEFT Text is left aligned
XBPSTATIC_TEXT_CENTER Text is horizontally centered
XBPSTATIC_TEXT_RIGHT Text is right aligned
XBPSTATIC_TEXT_TOP Text is displayed at top
XBPSTATIC_TEXT_VCENTER Text is vertically centered
XBPSTATIC_TEXT_BOTTOM Text is displayed at bottom
An alternate method of aligning text is by using the following
defines in place of SAYOPTIONS < nSayOpt >:
SAYRIGHT, SAYLEFT, SAYRIGHTBOTTOM, SAYLEFTBOTTOM, SAYRIGHTCENTER,
SAYLEFTCENTER, SAYRIGHTTOP, SAYLEFTTOP, SAYCENTER, SAYBOTTOM
SAYTOP
PREEVAL < bPreEval > is a code block that is evaluated before the
main dialog window (XbpDialog) is created.
EVAL < bEval > is a code block that is evaluated after the main
dialog window (XbpDialog) is created. This code block is
evaluated before any items from the GetList are created and
added to the Dialog. The Dialog object is passed to the code
block.
ICON < nIcon > is the resource ID of the ICON to place in the upper
left corner of the dialog window.
The CHECKGET argument causes all DCGET or @..DCSAY..GET objects
which GET a logical value to be displayed as a CheckBox rather
than a normal GET.
HELPFILE, HELPBLOCK < bcHelp > is the name of a *.HLP help file
or a code block to activate when the user clicks on the HELP
button on the bottom of the dialog window. If < bcHelp > is a
file name then the HELPCODE associated with the object in focus
when the F1 key is pressed will be passed to the Windows Help
reader. If < bcHelp > is a code block, the HELPCODE associated
with the object in focus with the F1 key is pressed will be
passed to the function referenced in the code block.
HELPCODE < cHelpCode > is the "default" help link to invoke in the
help file established by HELPFILE < bcHelp > when the F1 key is
pressed. Any specific HELPCODE assigned to DC* commands will
override this help link if the F1 key is pressed when the
specific object has focus.
The VISIBLE argument will cause dialog objects in the GetList to
be displayed when they are created, otherwise the entire dialog
will not be displayed until all objects are created.
The default translation mode assumes that all coordinates in the
GetList are based on 0,0 being the upper left home position of the
display or parent object. It is also assumed that coordinates are
text-based unless individually specified as pixel-based by the
PIXEL argument. This will also insure that RELATIVE coordinates
are based on the coordinates of the relative objects specified in
the Getlist. If the NOTRANLATE argument is specified, then
NO TRANLATIONS will occur when the objects are displayed by the
GUI reader and all coordinates are assumed to be based on 0,0
being the lower left home position of the display or parent object
and are all pixel-based. After the GUI reader translates the
coordinates, it writes the translated coordinates back to the
Getlist and automatically sets this flag to .FALSE. so that
successive calls to the GUI reader with the translated Getlist
will not cause anomolies when displaying the objects.
The SAYRIGHT argument causes all GETLIST_SAY type objects in the
Getlist to be displayed with text right-justified, unless that
object specificies LEFT or CENTER justification via the
aGETLIST_OPTIONS element of the Getlist item.
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.
TABSTOP will cause all objects (Xbase Parts) to be set when using
the Tab key. The default for TabStop is .False. or OFF. The
TabStop setting for individual objects can be force to ON or OFF
by using the TABSTOP or NOTABSTOP commands respectively in each
command to override the default setting.
NOTABSTOP will override the setting of TABSTOP in each command.
This clause is mutually-exclusive with the TABSTOP clause.
ROWPIXELS is the amount of pixels that equate to a row when using
text-based coordinates. The default is 20.
COLPIXELS is the amount of pixels that equate to a column when
using text-based coordinates. The default is 7.0.
When using text-based coordinates (default), the coordinates must
be converted to pixels because this is all that the Xbase parts
classes understand. For example, the command @ 10,30 DCSAY 'Test'
will place the word 'Test' at row 200, column 210 (in pixels).
Using text-based coordinates can give an advantage over pixel-
based because the COLPIXELS and ROWPIXELS clauses can be used in
conjunction with the SAYFONT and GETFONT clauses to automatically
adjust the screen to fix the desktop at runtime. See XDEMO.PRG
for a complete example.
ABORTQUERY will cause a Message Box to appear Confirming the
cancelling of operation when the Cancel button is clicked or the
ESCape key is pressed. The optional clause MSG < bAbortQuery > is
a code block to evaluate. If this code block is used, it must
return a logical value of .TRUE. to abort the dialog and must
contain it's own message window (if required)
CLOSEQUERY will cause a Message Box to appear Confirming the
cancelling of operation when the dialog window is close by
clicking on the X in the upper right corner or double clicking
the icon in the upper left corner. The optional clause
MSG < bCloseQuery > is a code block to evaluate. If this code block
is used, it must return a logical value of .TRUE. to close the
dialog window and must contain it's own message window (if
required)
EXITQUERY will cause a Message Box to appear Confirming the
dialog exit when the OK or Exit button is clicked or an attempt
is made to exit with the ENTER key when using the ENTEREXIT
clause. The optional clause MSG < bExitQuery > is a code block
to evaluate. If this code block is used, it must return a
logical value of .TRUE. to exit the dialog and must contain it's
own message window (if required)
QUITQUERY will cause a Message Box to appear Confirming the
dialog exit when the user attempts to shut down the operating
system. The optional clause MSG < bQuitQuery > is a code block
to evaluate. If this code block is used, it must return a
numeric value of XBP_ALLOW (defined in XBP.CH) to exit the dialog
and must contain it's own message window (if required). To
prevent the computer from shutting down if must return a numeric
value of XBP_REJECT.
NOESCAPEKEY will disable the ESCape key. Normally, the ESCape
key will close the dialog window and cancel operation.
DESIGN HOTKEY < nDesignHotKey > is the hot key that will invoke the
"design" mode. In this mode, objects may be moved or resized and
the new coordinates saved to the original source code. Keys are
defined in APPEVENT.CH. Ex: DESIGN HOTKEY xbeK_ALT_D.
SOURCECODE < cSource > is the name of the source code (*.PRG) file
that contains the DC* commands which created the dialog GetList.
This is needed when using the pop-up Dialog Editor in DESIGN mode.
Changes made to a dialog are re-written to the source code file
only if the command is identified by an ID, GETID or SAYID clause.
NOTE: To insure that the source code is found by the application,
include the full path.
TOOLTIPCOLOR < nTTFg >, < nTTBg > is the foreground color and
background color, respectively, of tooltips when using the
TOOLTIP clause on eXPress++ commands. The default colors are
GRA_CLR_BLACK and GRA_CLR_WHITE.
TOOLTIPFONT < cTTFont > is the font compound name of the font
for tooltips when using the TOOLTIP clause on eXpress++
commands.
BORDER < nBorder > defines the border type of the dialog window.
Constants defined in the XBP.CH file can be assigned to < nBorder >.
The define constants start with XBPDLG_.
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.
EXITVALIDATE will traverse the GetList when the user clicks on
the OK button and test all validations. If any validation fails,
the failed object will receive input focus and the dialog will
remain active.
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.
NOMOVEWITHOWNER will prevent the dialog window from automatically
moving when it's owner is moved.
ORIGIN < nOrigin > defines the reference point for the position of
the dialog window. The value of < nOrigin > must be a #define
constant from the file XBP.CH. The define constants start with
XBPDLG_ORIGIN_.
HILITEGETS < nbColor > will draw a box around the currently selected
GET. The color of the box is defined by < nbColor > and must be
a GRA_CLR_* color defined in GRA.CH. If < nbColor > is a codeblock
then it must return a numeric color. This clause highlights only
the GET portion of @.DCSAY..GET commands and DCGET commands.
NOTE: An anomoly in the XbpTabPage class causes this feature to
mess up the look of Tab Pages. To prevent this problem it is
recommended that the Gets be first placed on a DCSTATIC object
which is in turn placed on the DCTABPAGE object.
COLORGETS < aColor > is used to establish an array of foreground
and background colors for determining the color of the GET portion
of @..DCSAY..GET and DCGET commands when the get is placed into
focus. < aColor > is a two-dimensional array consisting of two
sub-array of 2 elements. The first array contains the foreground
and background colors of the GET when it is selected. The second
array contains the foreground and background color of the GET
when it is unselected. If the second array is not used, then the
unselected color is GRA_CLR_BLACK on GRA_CLR_WHITE. The color
definitions must conform to GRA_CLR_* definitions in GRA.CH.
Example 1: COLORGETS { { GRA_CLR_WHITE, GRA_CLR_RED } }
This will paint selected Gets White on Red, unselected Gets
Black on White (default).
Example 2: COLORGETS { { GRA_CLR_WHITE, GRA_CLR_RED }, '
{ GRA_CLR_WHITE, GRA_CLR_BLUE } }
This will paint selected Gets White on Red, unselected Gets
White on Blue.
NOSUPERVISE will cause the ENTER key to move from the last get
of a group of gets to the first get of the next group of gets.
Normal behavior is for the movement from the last get to the
first get of a group of gets that all have the same parent.
For example, if there are gets on 3 different tab pages, and
the user is in the last get of TabPage 1, and ENTER will cause
the first get on TabPage 2 to acquire focus.
HIDE will hide the dialog window from view for later viewing
with the oDlg:show() method.
NOBUSYPOINTER will disable the busy hourglass mouse pointer
that displays by default when DC_ReadGui() is creating the
dialog objects.
BUSY < cBusyMsg > is a message to display in a progress window
when DC_ReadGui() is creating the dialog objects.
CASCADE will set the coordinates of the dialog window to an
offset from a sibling window that has the lowest coordinates.
This provides for cascading of dialog windows. If there are
no siblings (windows belonging to the same parent), this
argument will be ignored.
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) }
DCREAD GUI .. EVAL {|o| o:resize := bReSize }
RESIZE is used to invoke the DC_ReSize() function to resize and
reposition child objects based on the rules defined by the RESIZE
clause of each DC* command. If a DC* command does not invoke the
RESIZE clause, then that object will not be affected by the
resizing of the parent window.
CAUTION: Do not use DCGRA* commands with the RESIZE or 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.
CONFIRM causes all @..DCSAY..GETs and @..DCGETs to require that
the ENTER key be pressed to move to the next GET.
NOCONFIRM causes all @..DCSAY..GETs and @..DCGETs to move to the
next GET when the edit buffer is filled and a key is pressed in
the last position.
FITPAD < nFitPad > is the amount of pixels to use pad with dead
space around all objects when using the FIT clause of DCREAD GUI.
The default is 10.
BUTTONALIGN < nButtonAlign > is a numeric constant used to select
the method in which buttons should be aligned at the bottom of
the dialog window when using the ADDBUTTONS clause or the
BUTTONS < nButtons > clause of DCREAD GUI. The constants are
defined in DCDIALOG.CH. See the below table.
Align Constant Description
------------------------ -------------------------------
DCGUI_BUTTONALIGN_LEFT (*) Align buttons to the left
DCGUI_BUTTONALIGN_CENTER Align buttons in the center
DCGUI_BUTTONALIGN_RIGHT Align buttons to the right
DISABLEDCOLOR < anDisabledColor > is a numeric constant or a
3-element array that is used to establish the background color
of objects that are disabled by the WHEN clause of DC* commands.
If < anDisabledColor > is a numeric value it must conform to the
GRA_CLR_* constants defined in GRA.CH. If < anDisabledColor > is
an array, it must be 3 elements of numeric values in the range
of 0 - 255 to create an RGB color value.
ENTERTAB changes the behavior of the ENTER key when navigating a
table of GETs. The default behavior is to navigate to the next
GET in the list of edit controls and if SET WRAP is ON, an ENTER
in the last GET wraps to the first GET. The ENTERTAB clause
bypasses this logic and instead posts a TAB KEY event to the event
queue to process the ENTER key as though the TAB key was pressed.
Use this feature to overcome some problems related to LOSTFOCUS
clauses.
NOTRANSLATE will assume that coordinates are based on the
standard Xbase Parts coordinate system where the home position
is the lower left corner, otherwise all coordinates will be
translated for compatability with text-based applications and
other Windows applications with the home position as the upper
left corner.
EDITPROTECT < bProtect > is a code block to use as the "default"
code block to use for Edit controls such as DCGET, DCMULTILINE,
DCCOMBOBOX, DCCHECKBOX, and DCRADIOBUTTON. This eliminates the
need to add an EDITPROTECT block to all edit controls in
applications that switch between a "view" and "edit" mode.
MESSAGEINTO < obMsgBox > defines the "default" message box object
to use for DC* commands that support the MESSAGE clause. This
eliminates the need to add an INTO < oMsgBox > block to all
MESSAGE clauses. < obMsgBox > may be a code block or a "prexisting
object". For example, the message receptacle may be an XbpMle()
object for displaying multiple-line messages. The string defined \
in the MESSAGE clause of the associated DC* command is passed to
the code block.
Example:
@ .. DCGET .. MESSAGE 'Message Line 1;Message Line 2'
@ .. DCMULTILINE .. OBJECT oMsgBox
DCGETOPTIONS ;
MESSAGEINTO {|c|c:=Strtran(c,';',CRLF,oMsgBox:setData(c)}
If < obMsgBox > is an object, it must already exist and it must
support the :setCaption() method.
Description:
DCGETOPTIONS is used to add options to a single-dimensional
array named GETOPTIONS.
Before using the DCGETOPTIONS command you must first declare
the GetOptions array variable so:
LOCAL GetOptions
The GETOPTIONS array is passed to the Dialog Reader via
DC_ReadGui(), DC_ReadGets(), or DCREAD.
This documentation is broken into 2 sections to prevent problems
with the Microsoft Help Compiler. See DCGETOPTIONS (2)
Exported Instance Variables:
Methods:
Notes:
Many of the GET OPTIONS are not supported with the DCAPPEDIT,
DCAPPFIELD, and DCAPPBROWSE commands as these commands are
simple adaptations of the respective Xbase++ APPEDIT, APPFIELD,
and APPBROWSE commands.
Examples:
#include "dcdialog.ch"
* ---- Example 1 ---- *
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
DCGETOPTIONS ;
NOMAXBUTTON ;
NOMINBUTTON ;
WINDOWHEIGHT 400 ;
WINDOWWIDTH 400 ;
DESIGN ;
VISIBLE ;
ROWSPACE 30
DCREAD GUI ;
TITLE 'My Dialogue' ;
OPTIONS GetOptions ;
ADDBUTTONS
RETURN
* ---- Example 2 ---- *
// Using the EXITQUERY clause to validate input
* -------------------
FUNCTION ExitQuery()
LOCAL GetList := {}, dStartDate := Date(), dEndDate := Date(), ;
GetOptions, lOk
@ 1,1 DCSAY 'Start Date' GET dStartDate GETOBJECT oStartDate
@ 2,1 DCSAY ' End Date' GET dEndDate GETOBJECT oEndDate
DCGETOPTIONS ;
EXITQUERY MSG {||_Validate(dStartDate,dEndDate,oStartDate, ;
oEndDate)}
DCREAD GUI FIT ADDBUTTONS TO lOk OPTIONS GetOptions ENTEREXIT
RETURN lOk
* --------------
STATIC FUNCTION _Validate( dStartDate, dEndDate, oStartDate, ;
oEndDate )
IF dStartDate >= dEndDate
DC_WinAlert('End Date must be greater than Start Date')
SetAppFocus(oStartDate)
RETURN .f.
ELSEIF Empty(dStartDate)
DC_WinAlert('Start Date cannot be empty')
RETURN .f.
SetAppFocus(oStartDate)
ELSEIF Empty(dEndDate)
DC_WinAlert('End Date cannot be empty')
SetAppFocus(oEndDate)
RETURN .f.
ENDIF
RETURN .t.
Source/Library:
DCDIALOG.CH
See Also:
DCGETOPTIONS (2)
dc_getoptdefault()
DIALOG GETLIST
DCREAD GUI
DCGETOPTIONS (2)
Set the options for the Dialog Reader
Syntax:
DCGETOPTIONS ;
... ;
[AUTOWINDOWMENU] ;
[NOWINDOWMENU] ;
[KEYBOARD < cKeyString >] ;
[NOEDITNAVKEYS < bNoEditNavKeys >] ;
[AUTOFOCUS] ;
[RESIZE] ;
[RESIZEDEFAULT < aDefaultResize >];
[SCALEFACTOR < aScaleFactor >] ;
[DEFAULTFONT < cDefaultFont >] ;
[ALWAYSONTOP] '
[ONCLICK < bOnClick >] ;
[RESTOREDEFAULTSBUTTON] ;
[SCROLLBARS < nScrollBars >] ;
[GETTEMPLATE < cTemplateChar >] ;
[LOCKWINDOWTOOWNER]
Arguments:
AUTOWINMENU (eXPress++ version 1.7 or later) is used in MDI-based
applications where there is a main window with a pull-down menu and
many child windows that were created with DCREAD GUI .. APPWINDOW
< oMainWindow:drawingArea >. This causes a "Window" menu item to be
automatically added to the main window menu bar when a child window
is opened with several window options. Run the XDEMO.EXE program
for an example.
NOWINDOWMENU is used in MDI-based applications that also use the
AUTOWINDOWMENU clause. It is used to prevent a dialog from being
added to the "window" menu when it is created.
KEYBOARD < cKeyString > is a string of keys to pass into the
keyboard queue. The keys will be received by the first object
to get focus. If < cKeyString > is a null string, then any keys
in the keyboard buffer placed by the Xbase++ KEYBOARD command
will pass into the keyboard queue.
NOEDITNAVKEYS < bNoEditNavKeys > is a code block that is evaluated
to disable the key navigation that moves between edit controls
when using the ENTER, UP or DOWN keys.
Example: DCGETOPTIONS .. NOEDITNAVKEYS {||nTabPage==3}
AUTOFOCUS enables the restoration of focus to the object that
last had focus when the parent dialog window receives focus.
If an object is an "Edit Control" such as a DCGET or DCMULTILINE
then it will automatically receive focus if it last had focus.
This is required so as not to defeat validation rules. Objects
which are not "Edit Controls" such as a DCPUSHBUTTON will be
restored focus only if the AUTOFOCUS clause is used.
RESIZE is used in conjunction with the RESIZE clauses of DC*
commands. This clause creates a resize callback to use DC_Resize()
as the function for resizing and repositioning child objects
after the parent window has been resized. Most DC* commands
include a RESIZE clause to establish the rules for how the
object associated with that command will be resized and/or
repositioned.
Each RESIZE clause of an @ .. DC* command accepts an an array
of two elements:
The first element is an optional code block that must return
two numeric values which will be the new X and Y position of
the object after its parent has been resized. The code block
is passed two numeric arguments equivalent to the X delta and
the Y delta of the parent after it has been resized. The second
element is an optional code block that must return two numeric
values which will be the new X and Y size of the object after
its parent has been resized. The code block is passed two
numeric arguments equivalent to the X delta and the Y delta of
the parent after it has been resized.
Examples:
@ .. DCSAY 'Testing' ;
RESIZE { {|x,y,o|{ o:currentPos()[1], o:currentPos()[2] + y} },;
{|x,y,o|{ o:currentSize()[1] + x, o:currentSize()[2] + y} } }
Note: DCDIALOG.CH contains DCGUI_RESIZE_* constants for commonly used
resizing rules.
RESIZEDEFAULT < aDefaultResize > is an array to use for the default
resizing rules. See RESIZE above.
SCALEFACTOR < aScaleFactor > is an array of 5 elements to be used
for adjusting the X,Y size and position of objects. Each value
is multiplied by the scale factor.
Element Type Description Default
------- ---- ------------------- -------
[1] N Column position 1
[2] N Row position 1
[3] N Width 1
[4] N Height 1
[5] L Automatic Font Scaling .F.
[6] L Automatic Re-Scaling* .F.
* This means that a window that has been resized to 50% larger
will be automatically re-scaled 50% larger the next time it is
created.
DEFAULTFONT < cDefaultFont > is the default font to use for all DC*
commands.
ALWAYSONTOP will cause the dialog window to always stay on top
of other desktop windows.
ONCLICK < bOnClick > is a code block to evaluate whenever the left
mouse button is clicked on any object of a dialog window. The
following parameters are passed to the evaluated code block:
oXbp : the object clicked on.
GetList : a pointer to the GetList array.
ENTEREXIT will exit the dialog if the ENTER key is pressed. The
exact behavior is determined by the DC_EnterExitMode() function.
The default behavior is to exit the dialog when the ENTER keys is
pressed in the "last GET". If this option is not used, then pressing
the ENTER key in the last GET will cause the first GET to receive
focus provided that SET WRAP is ON, otherwise pressing ENTER in the
last GET will have no affect.
RESTOREDEFAULTSBUTTON a right-click area in the lower left corner of
each dialog. Clicking in this area will popup a message box
allowing the user to restore the screen position and size to the
defaults. This is used in conjunction with DC_AutoRestoreWindow().
SCROLLBARS < nScrollBars > will cause scrollbars to automatically
appear in the drawingArea of the dialog window if a child object
is displayed outside the drawing area.
Example: SCROLLBARS XBP_SCROLLBAR_VERT+XBP_SCROLLBAR_HORIZ
GETTEMPLATE < cTemplateChar > is the character to use to determine
the width of a DCGET object. Gets are automatically sized to the
number of characters in the associated variable. This does not work
as well for proportional fonts and for fixed fonts, therefore
this sets the template character that is used to determine the size
of a DCGET when using a proportional font. The default is 'W'.
TOOLTIPFONT < cTTFont > is the font to use for tooltips.
LOCKWINDOWTOOWNER insures that a window (even modal windows) cannot be
moved outside the perimeter of the owner window.
Description:
DCGETOPTIONS (continued)
Source/Library:
DCDIALOG.CH
See Also:
DCGETOPTIONS
DCGRUMPBROW
An emulation of Greg Lief's GRUMPBROW
Syntax:
DCGRUMPBROW ;
[ TO < var > ] ;
[ SECURITY < cSec > ] ;
[ TOP < nTop > ] ;
[ LEFT < nLeft > ] ;
[ BOTTOM < nBottom > ] ;
[ RIGHT < nRight > ] ;
[ TITLE < cTitle > ] ;
[ FIELDS < aFields > ] ;
[ HEADINGS < aHeadings > ] ;
[ PICTURES < aPictures > ] ;
[ ALTERNATES < aAlternates > ] ;
[ LOW < xLow > ] ;
[ HIGH < xHigh > ] ;
[ EXTRA < aExtraOptions > ] ;
[ EXTRAKEY < nExtraOptionsKey > ] ;
[ EXTRATITLE < cExtraOptionsTitle > ] ;
[ EXITKEY < nExitKey > ] ;
[ INDEX_DESCRIPTION < aIndexDescriptions > ] ;
[ VALIDS < aValids > ] ;
[ WHENS < aWhens > ] ;
[ AUTOREFRESH < nSeconds > ] ;
[ LOCK < nlock > ] ;
[ CARRY ] ;
[ MEMOWIDTH < nMemoWidth > ] ;
[ MEMOHEIGHT < nMemoHeight > ] ;
[ COLORBLOCKS < aBlocks > ] ;
[ INITIAL < bIinitial > ] ;
[ GOTOP ] ;
[ ALTERNATE_KEYS < aKeys > ] ;
[ PRESENTATION < aPres > ] ;
[ WIDTHS < aWidths > ] ;
[ EDITCOORDS < aEditCoords > ] ;
[ MENU < acMenu > ] ;
[ FONT < cFont > ] ;
[ GETLIST @< aGrumpGetList > ] ;
[ MODAL ] ;
[ PARENT @< oDlg > ] ;
[ APPWINDOW < oAppWindow > ]
Arguments:
SECURITY < cSec > is a string defining the security level you want to
give your users. Case is not significant. You pass the first
letter of each feature that you wish to activate:
A Add
E Edit
D Delete
P Screen Painter // not supported
Q Query by example
S Search*
V View
N do Not allow individual field edit (see below)
C allow cell (individual field edit) only (no full-screen)
K allow user to pack the database
I allow user to swap index with ALT-I
L allow user to lock column with "L"
F allow user to "filter" (show data subset) with ALT-S
O output (print) all or some records (can be overridden
as item #8 in < aAlternates >... see below)
If you do not pass this parameter, all the user will be able to do is
browse vertically and Esc when they are finished.
*If no index file is open, or if the index key is not of character
type, you will not be able to Search, regardless of whether or not
you pass an "S" in < cSecurity >.
TOP < nTop >, LEFT < nLeft >, BOTTOM < nBottom >, RIGHT
< nRight >
delineate the screen region to be used for the browse. The default
values are 0, 0, 24, and 79, respectively.
FIELDS < aFields > contains character strings holding the names of the
fieldnames to show in the browse. Skip this parameter entirely if
you want to show all fields in the currently active database.
SPECIAL NOTE: you can alternatively put code blocks in < aFields >
to show any valid Xbase++ expression. Note that any such columns
will not be editable unless they are Get/Set code blocks. These
code blocks can be used for just about anything, including fields
in databases other than the currently active work area. You may
also wish to make these code blocks "get-set", which means that
they can assign values. For example, the following code block
displays the CUST- >LASTNAME field and allows the user to edit it
as well:
{ | x | if(x == NIL, cust- >lastname, cust- >lastname := x) }
HEADINGS < aHeadings > contains an array of column headings to be used
for the browse. If you do not use this clause, the fieldnames will
be used as column headings.NOTE: No default heading will be provided
for columns that are based on code blocks (see < aFields > description
above).
PICTURES < aPictures > contains PICTURE clauses corresponding to each
field. You may use this if, for example, you wish to truncate certain
fields or use "Y" for logicals. If you do not pass this parameter,
DC_GuiGrumpBrow() will establish default PICTURE values for each
field that conform to the general norm. Use a null string if you
do not wish to use this parameter.
ALTERNATES < aAlternates > is an eight element array which is used to
override the default add/edit/etc. routines. This array should be
eight elements long, and each element should contain either a code
block or a NIL. The elements correspond to the actions as follows:
aAlternate[1] = ADD function
aAlternate[2] = DELETE function
aAlternate[3] = EDIT function
aAlternate[4] = QUERY function
aAlternate[5] = SEARCH function
aAlternate[6] = VIEW function
aAlternate[7] = CELL EDIT codeblocks (see below)
aAlternate[8] = OUTPUT function
You only need to fill the elements that you wish to use. For
example, if you want to use your own Add and Edit routines, you
could do the following:
LOCAL aAlternate[8]
aAlternate[1] = { || SpecAdd() }
aAlternate[3] = { |b| SpecEdit(b)}
When the user presses "A" to Add or "E" to Edit, DC_GuiGrumpBrow()
would evaluate these blocks and call SpecAdd() or SpecEdit(),
respectively. Note that the second code block accepts a parameter
and passes it directly to SpecEdit(). This takes advantage of the
fact that DC_GuiGrumpBrow() will automatically pass the Browse
object and GetList to your alternate functions. You can therefore
manipulate the object as desired (e.g., resizing the window,
forcing a manual refresh, etc).
The seventh element of ALTERNATES array can contain an array
containing code blocks for the columns where alternate cell editing
is necessary.
LOW < xLow > and HIGH < xHigh > allow you to restrict browsing
operations
to a subset of records, ie a SCOPE. These parameters may be of any
data type -- conversion will be handled internally by DCGRUMPBROW.
Note that the subset feature works only if you have an index file
open. Further note that if you have two indexes open, and wish to
switch between them using ALT-I, DCGRUMPBROW will maintain a
different data subset for each index.
EXTRA < aExtraOptions > contains additional options which can be
accessed as a pop-up menu from within DCGRUMPBROW. The default key
to pop up this menu is ALT-F10, although this can be changed.
Create an array that contains nested arrays, each of which contains
the menu option as the first element and the code block to be
executed as the second element. For example:
{ ;
{ "First option", { || firstfunc() } }, ;
{ "Second option", { || secondfunc() } }, ;
{ "Third option", { | a,b | thirdfunc(a,b) } } ;
}
Note that the third code block accepts a parameter and sends it
through to the function. This is because DCGRUMPBROW will
pass the Browse object and GetList as parameters to your code
blocks when it evaluates them. Therefore you can write your code
blocks in this fashion to access the Browse object and manipulate
it as you see fit.
EXTRAKEY < nExtraOptionsKey > can be used to override the default
(ALT-F10) key to pop up the additional options menu.
EXTRATITLE < cExtraOptionsTitle > will be used as the title for the
pop-up menu window. By default, no title will be used.
EXITKEY < nExitKey > allows you to use a different key for exiting the
browse. Pass the INKEY value of the desired key as this parameter.
The default is K_ESC. If you wish to allow multiple exit keys, you
may pass an array containing the desired INKEY values as this
parameter (or in conjunction with the EXITKEY clause of the
DCGRUMPBROW user-defined command).
INDEX_DESCRIPTION < aIndexDescriptions > contains descriptive character
strings for each active index. If you pass this parameter, these
descriptions will be displayed on the top row when users switch
between indexes with ALT-I. Otherwise, the regular indexkey will be
displayed.
VALID < aValids > and WHEN < aWhens > allow you to attach VALID
and
WHEN clauses to any or all columns in the browse. If you use these,
you must use code blocks, and I would recommend generic coding to take
advantage of the GET object being passed as a parameter (e.g.,
{ |o| !empty(o:editBuffer()) }). Note that these will apply to
both single-field and full-screen editing, as well as adding new
records.
AUTOREFRESH < nAutoRefresh > is ideal for multi-user programs. If you
pass a numeric expression as this parameter, DCGRUMPBROW will
automatically refresh the screen as often as you specify. Your
parameter represents the number of seconds.
LOCK < nLockedColumns > is a numeric indicating how many columns
should
be locked from the outset. By default this will be zero.
CARRY enables the values from the current record to be carried
forward as the defaults for new records. Pass a logical True if you
want this behavior.
MEMOWIDTH < nMemoWidth > is a numeric indicating the width to use for
memo windows. By default, this will be either 40 or the width of the
browse window, whichever is smaller.
TITLE < cTitle > is a character string to be centered on the top row
of
the DC_GuiGrumpbrow() window. By default, no title will be used.
< nMemoHeight > is a numeric indicating the height to use for memo
windows. By default, this will be eight rows.
COLORBLOCK < aColorBlocks > allows you to initialize the colorBlock
instance variable for one or more columns within the browse. This
array should contain either code blocks or NILs.
INITIAL < bInitial > will be evaluated just prior to the browse being
displayed. This allows you to manipulate the browse object (e.g.,
changing the separators, changing the defColor instance variable for
one or more columns, moving the cursor to some column other than the
first, etcetera). Your codeblock should be structured to accept one
parameter, which will be the browse object.
GOTOP enables you to force DCGRUMPBROW to move to the top
of the database each time that the user presses ALT-I to cycle
through the active indexes. Pass .T. if you desire this behavior.
By default, the record pointer will remain unchanged, unless a data
subset has been established for the index you are switching to, in
which case the record pointer will be moved to the first record in
said subset.
ALTERNATE_KEYS < aAlternateKeys > can be used to override the default
keys listed below for each DCGRUMPBROW behavior. This array would
contain nested arrays which correspond to the following actions:
Element Action Default Key Default Message
aKeys[1] ADD A [A]dd
aKeys[2] DELETE D [D]elete
aKeys[3] EDIT E [E]dit
aKeys[4] QUERY Q [Q]uery
aKeys[5] SEARCH S [S]earch
aKeys[6] VIEW V [V]iew
aKeys[7] (n/a)
aKeys[8] OUTPUT O [O]utput
aKeys[9] LOCKCOLUMN L [L]ock
aKeys[10] SUBSET Alt-S [Alt-S]ubset
aKeys[11] SWAPINDEX Alt-I [Alt-I]ndex
aKeys[12] PACK K pac[K]
The structure of each nested array is { < nInkeyValue >,
< cPrompt > }. If you do not need to change a particular key,
simply leave that array element NIL.
If you do not want to have any key tooltips displayed, simply pass
NIL as the second element of each nested array.
PRESENTATION < aPresParam > is an array of presentation parameters for
the browse object. See the Xbase++ documentation for the XbpBrowse()
class for a specification of this array.
WIDTHS < aColWidths > is an array of numeric values for each browse
column, one for each element of < aFields >. For automatic sizing
insert a NIL in the array.
EDITCOORDS < aEditCoords > is an array of coordinates that defines the
location of the SAY (Header) prompt and GET (data) of each item in
< aFields > when using the full-screen editor. Each element of
< aEditCoords > is a sub-array of 7 elements:
< aEditCoords > element Type Description
--------------------- ------- --------------------------------
1 Numeric SAY (Header) Start Row
2 Numeric SAY (Header) Start Column
3 Numeric SAY Size (columns) default is 25
4 Numeric SAY Options - XBPSTATIC_TEXT_*
5 Numeric GET (Data) Start Row
6 Numeric GET (Data) Start Column
7 Numeric GET Size (columns) default is
field width
MENU < acMenu > is a Menu array or menu name that conforms to the
specifications for DC_MenuEdit().
FONT < cBrowFont > is the font style for the browse. This is a
character string that must conform to a standard Xbase++ font
declaration, ex: "8.Arial". The default is "8.Courier".
GETLIST @< aGrumpGetList > is a variable (passed by reference) to
store a pointer to the GetList that will be created by
DC_GuiGrumpBrow().
MODAL will cause the dialog window to be Application Modal,
otherwise it will be modeless.
PARENT @< oDialog > is a reference to a parent dialog or to a
memory variable to store a reference to the dialog that will be
created. If < oDialog > has already been created as an Xbase Parts
class object, it will become the parent for all the objects in
the GetList. If < oDialog > is passed by reference as a NIL, the
dialog object created by the reader will be stored in this
memory variable. NOTE: Xbase++ does not allow < oDialog > to be
a PRIVATE or a PUBLIC variable if it is passed by reference.
The parent of the dialog that will be created is referenced by
APPWINDOW < oAppWindow >. If no < oAppWindow > argument is
used
then the parent of the created dialog will be AppDeskTop().
Description:
DCGRUMPBROW is an emulation of the GrumpFish command GRUMPBROW
originally written for Clipper 5.x. It is full GUI and is based on the
eXPress++ DC* command set rather than Tbrowse().
Notes:
MEMO SUPPORT
Memofields are shown in the browse window as "<þmemoþ>". To view a
memo, highlight it and press Enter.
When adding, editing, or doing a query by example, you will notice
that memo support is handled quite neatly. As you go through the GET
list, when you hit a memo, a small window will open for you to edit
the memo.
SECURITY LEVELS
You may define different security levels at different parts of the
program. For example, you might want to give your users the ability
to add and edit records at one part of the program, but only view
records elsewhere.
SEARCH
If you press "S" to search, and if the current controlling index is
of character type, you may jump quickly to records by typing in the
first few letters of the desired value. For example, searching for
the name 'MCALLISTER' could prove quite tedious in a 750-record
database, but with quick-search you need only type in the letters
"M", "C", and "A" to narrow the scope down considerably. As letters
are added to the search string, it is redisplayed centered along the
bottom row of the browse box (unless the new letter results in a
value that is not FOUND() in the database). You may press backspace
to erase the rightmost character of the search string.
SWAPPING INDEXES (Alt-I)
If you have two index files open, you may switch between them by
pressing Alt-I. This means that you could have one index on company
name and another on last name, and jump back and forth between them
for searches.
QUERY BY EXAMPLE
By pressing "Q" you can do a query-by-example to find the next
record matching their specific criteria. All you need do is fill in
the blanks. Fill in as many fields as you want to narrow the search
criteria. Note that all query-by-example searches are
case-insensitive.
If you want to search for a field that contains a certain value, they
may enter that value surrounded by two periods ("..") on either side.
For example, if you wanted to find the next record that contains the
word "STREET" in the address field, you could enter "..STREET.." for
that field.
After you perform a query-by-example, the next time you press "Q" you
will be given the option to repeat the search using the same criteria
(which will save you the bother of re-entering it).
SCREEN PAINTER
The screen painter will be supported in a future version
EDITING ONE FIELD
When the user highlights a field and press Enter, they can edit it
directly without going to a vertical view. (This assumes, of
course, that you have given them Edit privileges.) If they wish to
edit the same field in a series of records, they can terminate the
READ by pressing the down arrow, which will move them down one
record and pop them immediately into edit mode.
However, there may be situations when you do not want the user to be
able to edit an individual field. In such situations, you should
include "N" as part of the security parameter.
By the same token, there may be situations where you only want
the user to be able to edit individual fields (as opposed to a
full-screen edit). This would apply if you had a number of code
block (and thus non-editable) columns. In such situations, you
should include "C" (and not "N") as part of the security parameter.
Source/Library:
DCGRUMP.CH
See Also:
dc_guigrumpbrow()
DCHOTKEY
Set a Hot-Key for action by the GUI Reader
Syntax:
DCHOTKEY < anAccel > ;
;
[ACTION < bAction >] ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
;
[WHEN < bWhen >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >]
Arguments:
< anAccel > is a numeric "hot-key" assignment that will activate
the < bAction > codeblock 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 an action.
ACTION < bAction > is the code block to evaluate when the key
is pressed in the DC_ReadGUI() event loop. The code block
should look like so:
{ | uNIL1, uNIL2, oXbp | ... }
PARENT < oParent > is an optional parent object that is tied to
this key. If this option is used, then the < bAction > code block
will be evaluated only if the < nAccel > key is pressed when the
parent object is in focus.
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.
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 hot-key will be disabled. If the
value returned is .TRUE. then the hot-key will be enabled.
The object is passed as a parameter to the code block.
ID < cID > is a unique ID code to assign to this 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().
Description:
The command DCHOTKEY creates a new Hot-Key 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.
DCHOTKEY objects are used to set establish hot-keys which will
execute pre-defined code-blocks from within the event loop of
the GUI reader.
Examples:
#include "dcdialog.ch"
#include "appevent.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, GetOptions, cOption, oRadio1, oRadio2, ;
oRadio3, oRadio4
cOption := 'P'
@ 1,2 DCRADIO cOption PROMPT 'Save to &Dictionary' VALUE 'D' ;
OBJECT oRadio1
@ 2,2 DCRADIO cOption PROMPT '&Save to Source Code' VALUE 'S' ;
OBJECT oRadio2
@ 3,2 DCRADIO cOption PROMPT 'Make a &Backup file' VALUE 'B' ;
OBJECT oRadio3
@ 4,2 DCRADIO cOption PROMPT '&Pack the File' VALUE 'P' ;
OBJECT oRadio4
DCHOTKEY xbeK_ALT_D ACTION {||SetAppFocus(oRadio1), ;
oRadio2:SetData(.f.), ;
oRadio3:SetData(.f.), ;
oRadio4:SetData(.f.), ;
oRadio1:SetData(.t.), ;
cOption := 'D' }
DCHOTKEY xbeK_ALT_S ACTION {||SetAppFocus(oRadio2), ;
oRadio1:SetData(.f.), ;
oRadio3:SetData(.f.), ;
oRadio4:SetData(.f.), ;
oRadio2:SetData(.t.), ;
cOption := 'S' }
DCHOTKEY xbeK_ALT_B ACTION {||SetAppFocus(oRadio3), ;
oRadio1:SetData(.f.), ;
oRadio2:SetData(.f.), ;
oRadio4:SetData(.f.), ;
oRadio3:SetData(.t.), ;
cOption := 'B' }
DCHOTKEY xbeK_ALT_P ACTION {||SetAppFocus(oRadio4), ;
oRadio1:SetData(.f.), ;
oRadio2:SetData(.f.), ;
oRadio3:SetData(.f.), ;
oRadio4:SetData(.t.), ;
cOption := 'P' }
DCREAD GUI ;
TITLE 'Hot-Key Demo';
FIT ;
ADDBUTTONS
DC_MsgBox({cOption})
RETURN
Source/Library:
DCDIALOG.CH
DCHTML
A command for creating any HTML output
Syntax:
@ [ < nRow > ,< nCol > ] DCHTML ;
[TEXT < bcText >] ;
[PRE,PRETEXT < bcPreHTML >] ;
[POST,POSTTEXT < bcPostHTML >] ;
[OBJECT < oObject >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[STYLE,FONT < cStyle >] ;
[CARGO < xCargo >] ;
[TOOLTIP < bcToolTip >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
[MESSAGE < cMessage >]
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.
TEXT < bcText > is a character string or a codeblock that
returns a character string containing the HTML text or
plain text.
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.
TOOLTIP < bcToolTip > is a tooltip to display over the text.
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.
STYLE < cStyle > is the style tag to wrap around the text. For
example STYLE "H3" will create the following source:
< H3 >< bcText >< /H3 >.
MESSAGE < bcMessage > is a character string or a codeblock
that returns a character string containing a message to
assign to the MESSAGEINTO < cMessageInto > clause of DCREAD
HTML when the mouse is clicked on the element in the browser.
This creates an < a href > around the element and sends a URL
equivalent to /?< cMessageInto >=< bcMessage >.
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.
CARGO < xCargo > is any kind of data you wish to to add to the
:cargo container of object created by this definition.
Description:
The command DCHTML creates an HTML element 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.
Notes:
DCHTML creates an object of the DC_Html() class.
Examples:
/*
This example will create a table containing four sub tables
and write into each sub table.
*/
FUNCTION HtmlCommand()
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 1 ;
COLUMNS 1 ;
PARENT oTable1
@ 1,1 DCHTML TEXT '<h2>This is table</h2><h1>' +
;
(Str(nTable++))+'</h1>' ;
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()
DCHTMLBODY
A ccommand for creating the body tag of an HTML document
Syntax:
DCHTMLBODY ;
[OBJECT < oBody >] ;
[STYLE < style >] ;
[LINK < link >] ;
[ONLOAD < onload >] ;
[VLINK < vlink >] ;
[ALINK < alink >] ;
[TEXT < textColor >] ;
[BGCOLOR < bgcolor >] ;
[BGPROPERTIES < bgproperties >] ;
[LEFTMARGIN < leftmargin >] ;
[TOPMARGIN < topmargin >] ;
[BACKGROUND < background >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[PRE,PRETEXT < bcPreText >] ;
[POST,POSTTEXT < bcPostText >] ;
[ID < cId >] ;
[GROUP < cGroup >]
Arguments:
STYLE < style > is the name of a *.CSS (cascading style sheet)
file to use as the style of the document.
OBJECT < oBody > 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 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.
LINK < link > is the color of hyperlinks which have never been
visited. 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.
ALINK < alink > is the color of hyperlinks which has been
clicked. 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.
VLINK < vlink > is the color of hyperlinks which have been
previously visited. 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.
TEXT < textColor > is the color of the text in the body of the
document. 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.
BGCOLOR < bgcolor > is the color of the background in the body
of the document. 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.
TOPMARGIN < topmargin > and LEFTMARGIN < leftmargin > are the
margins in pixels of the body of the document.
BACKGROUND < background > is a URL pointing to a .JPG or .GIF
image to be used as the background for the body of text.
BGPROPERTIES < bgproperties > if empty allows the background to
scroll. A value of "fixed" will prevent the background from
scrolling.
ONLOAD < onload > is a Script command that will execute after
the document is loaded.
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:
DCHTMLBODY creates the HTML needed in the BODY tag of an
HTML document.
The command DCHTMLBODY creates an HTML element 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.
Notes:
DCHTMLBODY creates an object of the DC_HtmlBody() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oMain, cHtml, oBody
DCHTMLMAIN OBJECT oMain
DCHTMLBODY OBJECT oBody ;
BACKGROUND "http://donnay-software.com/graphics/expback1.gif" ;
STYLE "\exp18\html\default.css" ;
PARENT oMain
DCHTML TEXT MemoRead('\exp18\readme.txt') ;
STYLE 'PRE' ;
PARENT oBody
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_htmlbody()
DCHTMLMAIN
A ccommand for creating the main HTML document
Syntax:
DCHTMLMAIN ;
[OBJECT < oMain >] ;
[STYLE < cStyle >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[PRE,PRETEXT < bcPreText >] ;
[POST,POSTTEXT < bcPostText >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
Arguments:
STYLE < cStyle > is the name of a *.CSS (cascading style sheet)
file to use as the style of the document.
OBJECT < oMain > 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 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.
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:
DCHTMLMAIN creates the HTML needed at the start of an
HTML document.
The command DCHTMLMAIN creates an HTML element 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.
Notes:
DCHTMLMAIN creates an object of the DC_HtmlMain() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oMain, cHtml, oBody
DCHTMLMAIN OBJECT oMain
DCHTMLBODY OBJECT oBody ;
BACKGROUND "http://donnay-software.com/graphics/expback1.gif" ;
STYLE "\exp18\html\default.css" ;
PARENT oMain
DCHTML TEXT MemoRead('\exp18\readme.txt') ;
STYLE 'PRE' ;
PARENT oBody
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
DCHTMLMAIN
dc_htmlmain()
DCHYPERLINK
A command for creating HYPERLINK tags in HTML
Syntax:
@ [ < nRow >, < nCol > ] DCHYPERLINK ;
[CAPTION,TEXT] ;
[HREF < href >] ;
[METHOD < method >] ;
[NAME < name >] ;
[REL < rel >] ;
[REV < rev >] ;
[TARGET < target >] ;
[URN < urn >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[OBJECT < oLink >] ;
[CARGO < xCargo >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT < bcPreText >] ;
[POST,POSTTEXT < bcPostText >] ;
[HIDE < bHide >] ;
[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.
CAPTION, TEXT < text > is any html text or element to include
within the < A > tag. If this argument is not used, then
a child object should be added to the < oLink > parent.
OBJECT < oLink > 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 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.
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.
HREF < href > is the URL to navigate to when the user clicks on
the text or image underlined.
METHOD < method > is the method of the href.
NAME < name > is the name of the label within the target document.
REL < rel > is the relationship of the source to the target.
REV < rev > is the relationship of the target to the source.
TITLE < title > is a tooltip to display when the mouse is moved
over the hyperlink.
TARGET < target > is the name of the window or frame which is the
target for the returned response.
URN < urn > is the Uniform Resource Name for a referenced document.
Description:
DCHYPERLINK is a command for creating HTML href elements
for hyperlinks.
The command DCHYPERLINK creates an HTML element 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.
Notes:
DCHYPERLINK creates an object of the DC_HtmlHyperLink()
class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], cHtml, oLink
DCHYPERLINK HREF "http://donnay-software.com" ;
OBJECT oLink
DCIMAGE SRC "http://donnay-software.com/graphics/donnay-logo.jpg" ;
ALT 'Donnay Logo' PARENT oTable ;
HEIGHT 100 ;
PARENT oLink
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_html()
dc_readhtml()
dc_htmlhyperlink()
DCIMAGE
A command for creating IMAGE tags in HTML
Syntax:
@ [ < nRow >, < nCol > ] DCIMAGE ;
[BORDER < border >] ;
[SRC < src >] ;
[DYNSRC < dynsrc >] ;
[LOWSRC < lowsrc >] ;
[START < start >] ;
[USEMAP < usemap >] ;
[WIDTH < width >] ;
[HEIGHT < height >] ;
[LOOP < loop >] ;
[ISMAP] ;
[ALT < alt >] ;
[CONTROLS < controls >] ;
[ALIGN < align >] ;
[OBJECT < oImage >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[HSPACE < vspace >] ;
[VSPACE < hspace >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[WHEN < bWhen >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[PRE,PRETEXT < bcPreText >] ;
[POST,POSTTEXT < bcPostText >] ;
[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 < oImage > 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 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.
SRC < src > is the URL source of the image to display. This may
may be a character string or an array of 2-character
strings. If it is an array, the URL in the first element
of the array will be used if the WHEN < bWhen > clause
evaluates to .TRUE. otherwise the second element of the
array will be used.
DYNSRC < dynsrc > (Internet Explorer) is the URL source of an AVI
clip to play.
LOWSRC < lowsrc > is the URL source of the low resolution image
to display while the browser is loading the high resolution
image (for speed in loading).
ALT < alt > is the text to display in the event that the URL for
the image is broken.
USEMAP < usemap > is the name of a map that is created with the
< MAP > tag of HTML.
LOOP (Internet Explorer) will force continuous playing of the
AVI clip.
ALIGN < align > is used to align the image within the body content.
Acceptable values are "top", "middle", "bottom", "texttop",
"absmiddle","baseline" and "absbottom".
START < start > (Internet Explorer) contains options for how to
start the AVI clip.
CONTROLS < controls > (Internet Explorer) is a URL pointing to an
image used as the controls for the AVI player.
BORDER < border > should be set to 0 to eliminate the hyperlink
attribute around the image.
ISMAP will send the coordinates of the mouse when clicked on
the image.
WIDTH < nWidth > is the width in pixels to display the image.
If this argument is not used, then the width will default
to the native width of the image.
HEIGHT < nHeight > is the height in pixels to dislay the
image. If this argument is not used, then the height will
default to the native height of the image.
HSPACE < nHSpace > is the number of pixels of space on the
outside of the image on both the left and right side.
VSPACE < nVSpace > is the number of pixels of space on the
outside of the image on both the top and bottom.
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:
DCIMAGE is a command for creating HTML image elements.
The command DCIMAGE creates an HTML element 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.
Notes:
DCIMAGE creates an object of the DC_HtmlImage() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], cHtml, oTable
DCTABLE OBJECT oTable ;
ROWS 1 COLUMNS 2 BORDER 1
@ 1,1 DCIMAGE SRC "http://donnay-software.com\graphics\donnay-logo.jpg" ;
ALT 'Donnay Logo' PARENT oTable ;
HEIGHT 100
@ 1,2 DCIMAGE SRC "http://donnay-software.com\graphics\xb2net.gif" ;
ALT 'XB2.NET Logo' PARENT oTable ;
VSPACE 20 ;
HSPACE 20
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_html()
dc_readhtml()
dc_htmlimage()
DCINPUT
A command for creating input elements for HTML forms
Syntax:
@ [ < nRow >, < nCol > ] DCINPUT ;
[TYPE < ncType >] ;
[OBJECT < oInput >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[SRC,SOURCE < cSource >] ;
[HEIGHT < nHeight >] ;
[WIDTH < nWidth >] ;
[MAXLENGTH < nMaxLength >] ;
[CHECKED,SELECTED] ;
[VALUE < xValue >] ;
[LIST < aList >] ;
[TABINDEX < nTabIndex >] ;
[ONFOCUS < cOnFocus >] ;
[ONBLUR < cOnBlur >] ;
[ONSELECT < cOnSelect >] ;
[ONCHANGE < cOnChange >] ;
[ONCLICK < cOnClick >] ;
[ACCEPT < cAccept >] ;
[ACCESSKEY < cAccessKey >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT] ;
[POST,POSTTEXT] ;
[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 < oForm > is the name of the variable to assign as a
storage place for this object.
TYPE < ncType > is the type of input element to create:
Type Description
------------------------------ ------------------------------
DCHTML_INPUT_TEXT Text similar to standard GET
or "text"
DCHTML_INPUT_PASSWORD Text similar to standard GET
or "password" except asterisks mask input
DCHTML_INPUT_CHECKBOX Logical checkbox
or 'checkbox'
DCHTML_INPUT_RADIOBUTTON Radio button
or 'radio'
DCHTML_INPUT_SUBMITBUTTON Pushbutton to submit form
or 'submit'
DCHTML_INPUT_RESETBUTTON Pushbutton to reset form
or 'reset'
DCHTML_INPUT_IMAGE Clickable image (returns coords)
or 'image'
DCHTML_INPUT_HIDDEN Hidden variable
or 'hidden'
DCHTML_INPUT_TEXTAREA Memo text similar to MLE
or 'textarea'
DCHTML_INPUT_SELECT Combo box
or 'select'
DCHTML_INPUT_BUTTON Push button
or 'button'
DCHTML_INPUT_FILE File Choose Dialog
or 'file'
CHECKED or SELECTED will be check or select the item.
This applies only to "radio", "checkbox" or "select" items.
MAXLENGTH < nMaxLength > is the maximum amount of text allowed
to be input. Applies to type "text", "password" and
"textarea".
SIZE < nSize > is the length (in characters) of type "text" or
"password" items.
WIDTH < nWidth > is the width (in characters) of type "textarea"
HEIGHT < nHeight > is the height (in characters) of type
"textarea"
VALUE < xValue > is the current value of the item. If the
item is a "button", "reset" or "submit" then this will be
the caption of the button.
SRC < cSource > is the URL of the image if the type of input is
an "image".
LIST < aList > is an array of list items for inputs of type
"select".
ONFOCUS < cOnFocus > is a script to run when the item receives
focus.
ONBLUR < cOnBlur > is a script to run when the item loses focus.
ONSELECT < cOnSelect > is a script to run when an item has been
selected.
ONCHANGE < cOnChange > is a script to run when an item has
changed.
ONCLICK < cOnClick > is a script to run when an item has
been clicked with the mouse.
TABINDEX < nTabIndex > is the order in the tab list for this
item.
ACCESSKEY < cAccessKey > assigns an access key to the item.
An access key is a single character from the document
character set.
ACCEPT < cAccept > is the Content Type. (not normally used).
PARENT < oParent > is the name of the variable that was
assigned to the parent of this 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.
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:
DCINPUT is a command for creating input tags to be used
in HTML forms.
The command DCINPUT creates an HTML element 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.
Notes:
DCINPUT creates an object of the DC_HtmlInput() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oHtml, oTable, cHtml, aListItems, cUserId,
cPassword, lCheck, oForm
cUserId := Space(10)
cPassword := ''
lCheck := .t.
aListItems := { 'Men','Women','Dogs','Cats','Mice','Turkeys' }
DCFORM OBJECT oForm
DCTABLE OBJECT oTable ROWS 10 COLUMNS 2 BORDER 1 PARENT oForm
@ 1,1 DCSAY 'User ID' PARENT oTable
@ 1,2 DCINPUT VALUE cUserId NAME 'Input.Type.Text' ;
PARENT oTable MAXLENGTH 10
@ 2,1 DCSAY 'Password' PARENT oTable
@ 2,2 DCINPUT TYPE "password" VALUE cPassword ;
NAME 'Input.Type.PassWord' PARENT oTable MAXLENGTH 10
@ 3,1 DCSAY 'CheckBox' PARENT oTable
@ 3,2 DCINPUT TYPE "checkbox" NAME 'Input.Type.CheckBox' ;
VALUE lCheck CHECKED PARENT oTable
@ 4,1 DCSAY 'Radio Buttons' PARENT oTable
@ 4,2 DCINPUT TYPE "radio" VALUE 'M' NAME 'Input.Type.RadioButton' ;
PARENT oTable POST 'Mint<br>'
@ 4,2 DCINPUT TYPE "radio" VALUE 'E' NAME 'Input.Type.RadioButton' ;
PARENT oTable POST 'Excellent<br>'
@ 4,2 DCINPUT TYPE "radio" VALUE 'G' NAME 'Input.Type.RadioButton' ;
CHECKED PARENT oTable POST 'Good<br>'
@ 4,2 DCINPUT TYPE "radio" VALUE 'F' NAME 'Input.Type.RadioButton' ;
PARENT oTable POST 'Fair<br>'
@ 4,2 DCINPUT TYPE "radio" VALUE 'P' NAME 'Input.Type.RadioButton' ;
PARENT oTable POST 'Poor<br>'
@ 5,1 DCSAY 'Submit Button' PARENT oTable
@ 5,2 DCINPUT TYPE "submit" VALUE 'Hit Me!' ;
NAME 'Input.Type.Submit' PARENT oTable
@ 6,1 DCSAY 'Reset Button' PARENT oTable
@ 6,2 DCINPUT TYPE "reset" VALUE 'Reset Form!' ;
NAME 'Input.Type.Reset' PARENT oTable
@ 7,1 DCSAY 'Image' PARENT oTable
@ 7,2 DCINPUT TYPE "image" SRC '\exp18\images\express2.gif' ;
NAME 'Input.Type.Image' PARENT oTable
@ 8,1 DCSAY 'ComboBox' PARENT oTable
@ 8,2 DCINPUT TYPE "select" ;
LIST aListItems ;
NAME 'Input.Type.Select' PARENT oTable
@ 9,1 DCSAY 'File' PARENT oTable
@ 9,2 DCINPUT TYPE "file" ;
SIZE 40 ;
MAXLENGTH 100 ;
NAME 'Input.Type.File' PARENT oTable
@10,1 DCSAY 'Read Me' PARENT oTable
@10,2 DCINPUT ;
TYPE DCHTML_INPUT_TEXTAREA ;
WIDTH 60 HEIGHT 20 ;
NAME 'Input.Type.TextArea' ;
VALUE {||MemoRead('\exp18\samples\html\readme.txt')} ;
PARENT oTable
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.PRG
See Also:
DCREAD HTML
dc_htmlinput()
dc_readhtml()
DCLDEBUG
Send debug information to a debugging Log File
Syntax:
DCLDEBUG < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCLDEBUG is used to send data to a log file when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCLDEBUG Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
DCQDEBUG
DCLDEBUGOFF
DCBDEBUG
DCLDEBUGOFF
Send debug information to a debugging Log File
Syntax:
DCLDEBUGOFF < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCLDEBUGOFF is used to send data to a log file when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
DCLDEBUGOFF is similar to DCLDEBUG except it will not
echo the expression.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCLDEBUGOFF Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
DCQDEBUG
DCLDEBUG
DCLDEBUGOFFQUIET
Send debug information to a debugging Log File
Syntax:
DCLDEBUGOFFQUIET < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCLDEBUGOFFQUIET is used to send data to a log file when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
DCLDEBUGOFFQUIET is similar to DCLDEBUG except it will not
echo the expression or the callstack information.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCLDEBUGOFFQUIET Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
DCQDEBUG
DCLDEBUG
DCLDEBUGQUIET
Send debug information to a debugging Log File
Syntax:
DCLDEBUGQUIET < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCLDEBUGQUIET is used to send data to a Log File when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
DCLDEBUGQUIET is similar to DCLDEBUG except it will not
echo the callstack information.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCLDEBUGQUIET Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
DCQDEBUG
DCLDEBUG
DCLIST
A command for creating lists in HTML
Syntax:
@ [ < nRow >,< nCol > ] DCLIST ;
[TYPE < nType >] ;
[ITEMLIST < aList >] ;
[ITEMTYPE < nListType >] ;
[STYLE,FONT < cStyle >] ;
[COMPACT] ;
[OBJECT < oList >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT] ;
[POST,POSTTEXT] ;
[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.
TYPE < type > is the type of the list:
"ul" or DCHTML_LIST_UNORDERED creates an unordered list.
"ol" or DCHTML_LIST_ORDERED creates an ordered list.
"dir" or DCHTML_LIST_DIRECTORY creates a directory list.
"menu" or DCHTML_LIST_MENU creates a menu list.
"dl" or DCHTML_LIST_DEFINITION creates a definition list.
ITEMLIST < aList > is an array of items to be displayed in
the list. Each item must be a character string. If no
array of items is used then the list of items consists of
child objects of the type DC_HtmlListItem() or DCLISTITEM.
ITEMTYPE < nListType > is the type of each list item. This
has a different meaning for different types of lists.
Ordered lists:
"A" will order each item in capital letters.
"a" will order each item in lower case letters.
"I" wlll order each item in capital Roman numerals.
"i" wlll order each item in lower case Roman numerals.
"1" will order each item in Arabic numerals.
Unordered, Directory, and Menu lists:
"disc" will display a disc image in front of the item
"circle" will display a circle image in front of the item
"square" will display a square image in front of the item
COMPACT will tell the browser to reduce the indentation
and number of spaces between the sequence numbers and the
list items, or both.
STYLE < cStyle > is the style tag to wrap around the text. For
example STYLE "H3" will create the following source:
< H3 >< bcText >< /H3 >.
OBJECT < oList > 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 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.
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:
DCLIST is a command for creating HTML lists elements. The
list type may be ordered, unordered, directory, menu or
definition.
The command DCLIST creates an HTML element 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.
Notes:
DCLIST creates an object of the DC_HtmlList() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oTable, cHtml, oList1, oList2, aListItems
aListItems := { 'Men','Women','Dogs','Cats','Mice','Turkeys' }
DCTABLE OBJECT oTable ROWS 1 COLUMNS 2
@ 1, 1 DCLIST OBJECT oList1 ;
TYPE 'ol' ;
ITEMLIST aListItems ;
ITEMTYPE 'i' ;
PARENT oTable
@ 1, 2 DCLIST OBJECT oList2 ;
TYPE 'ul' ;
PARENT oTable
FOR i := 1 TO Len(aListItems)
DCLISTITEM aListItems[i] ;
PARENT oList2 ;
TYPE 'circle'
NEXT
DCREAD HTML to cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.PRG
See Also:
DCREAD HTML
dc_htmllist
dc_htmllistitem()
dc_readhtml()
DCLISTITEM
A command for creating list items in HTML
Syntax:
DCLISTITEM ;
[TYPE < nType >] ;
[STYLE,FONT < cStyle >] ;
[OBJECT < oItem >] ;
[VALUE < value >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[PRE,PRETEXT] ;
[POST,POSTTEXT] ;
[TITLE < cTitle >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
Arguments:
TYPE < nListType > is the type of each list item. This
has a different meaning for different types of lists.
The type of list is defined by the DCLIST parent.
Ordered lists:
"A" will order each item in capital letters.
"a" will order each item in lower case letters.
"I" wlll order each item in capital Roman numerals.
"i" wlll order each item in lower case Roman numerals.
"1" will order each item in Arabic numerals.
Unordered, Directory, and Menu lists:
"disc" will display a disc image in front of the item
"circle" will display a circle image in front of the item
"square" will display a square image in front of the item
STYLE < cStyle > is the style tag to wrap around the text. For
example STYLE "H3" will create the following source:
< H3 >< bcText >< /H3 >.
OBJECT < oItem > 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 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.
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.
VALUE < value > lets you change the number of a specific list
item and those that follow it. This is valid only for
ordered lists. Example < value > = 9 will change the order
numbering to start at 9.
Description:
DCLISTITEM is a command for creating HTML lists items to
be added to a DCLIST parent.
The command DCLISTITEM creates an HTML element 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.
Notes:
DCLISTITEM creates an object of the DC_HtmlListItem() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oTable, cHtml, oList1, oList2, aListItems
aListItems := { 'Men','Women','Dogs','Cats','Mice','Turkeys' }
DCTABLE OBJECT oTable ROWS 1 COLUMNS 2
@ 1, 1 DCLIST OBJECT oList1 ;
TYPE 'ol' ;
ITEMLIST aListItems ;
ITEMTYPE 'i' ;
PARENT oTable
@ 1, 2 DCLIST OBJECT oList2 ;
TYPE 'ul' ;
PARENT oTable
FOR i := 1 TO Len(aListItems)
DCLISTITEM aListItems[i] ;
PARENT oList2 ;
TYPE 'circle'
NEXT
DCREAD HTML to cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.PRG
See Also:
DCREAD HTML
dc_htmllist
dc_htmllistitem()
dc_readhtml()
DCMENUBAR
Create a MENUBAR object for displaying with Text/GUI reader
Syntax:
DCMENUBAR < oMenuBar > ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[CARGO < xCargo >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >] ;
[OWNERDRAW] ;
[MENUBARFONT < cMenuBarFont >] ;
[MENUBARCOLOR < anMenuBarColorFG >, < anMenuBarColorBG >]
;
[SUBFGCOLOR < anSubFGColor >] ;
[SUBBGCOLOR < anSubBGColor >] ;
[SUBBARCOLOR < anSubBarColorFG >,< anSubBarColorBG >] ;
[SUBBARFONT < cSubBarFont >] ;
[SUBITEMFONT < cSubItemFont >] ;
[SUBCHECKCHAR < cSubCheckChar >] ;
[SUBCHECKFONT < cSubCheckFont >] ;
[BEGINMENU < bBeginMenu >] ;
[ENDMENU < bEndMenu >] ;
[ITEMMARKED < bItemMarked >] ;
[ITEMSELECTED < bItemSelected >] ;
[BARBITMAP < ocnBarBitmap >] ;
[MESSAGEBOXATTACHED]
Arguments:
< oMenuBar > is the name of the variable to assign as a storage
place for the menu bar.
PARENT < oParent > is the name of the variable that was
assigned to the parent DIALOG for this MenuBar.
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.
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.
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().
OWNERDRAW will cause all submenus to be painted with a more
eye-appealling design, including a vertical bar on the left side
of each submenu with a vertically painted caption and user-defined
colors. This option is available only when using Xbase++ 1.9 or
later.
MENUBARFONT < cMenuBarFont > is the font of the menubar items when
the OWNERDRAW option is used.
MENUBARCOLOR < anMenuBarColorFG >, < anMenuBarColorBG > is the
foreground
and background color of the menubar when the OWNERDRAW option is
used.
SUBBARFONT < cSubBarFont > is the font compound name to use for all
text in the vertical bar when the OWNERDRAW option is used.
SUBFGCOLOR < anSubColorFG > is the foreground color of the pull
down menus when the OWNERDRAW option is used. This may be a numeric
GRA_CLR_* value or an array of 3 numeric values for RGB.
SUBBGCOLOR < anSubColorBG > is the background color of the pull
down menus when the OWNERDRAW option is used. This may be a numeric
GRA_CLR_* value or an array of 3 numeric values for RGB.
SUBBARCOLOR < anSubBarColorFG >, < anSubBarColorBG > are the
foreground
and background colors of the vertical bar when the OWNERDRAW option
is used. These may be a numeric GRA_CLR_* value or an array of
3 numeric values for RGB.
SUBCHECKFONT < cSubCheckFont > is the font to use for the check
character of Submenus when the OWNERDRAW option is used.
Default is 10.Marlett
SUBCHECKCHAR < cSubCheckChar > is the character to use when a
menu item is checked and the OWNERDRAW option is used.
Default is 'b'.
Note: If color options are not used, then they are defaulted for
all menus with DC_XbpMenuConfig().
The BEGINMENU < bBeginMenu > code block is evaluated when a user
activates a
menu and starts with the menu selection. {| uNIL1, uNIL2, self | ... }
The ENDMENU < bEndMenu > code block is evaluated when a user has
selected a
menu item or aborted menu selection. {| uNIL1, uNIL2, self | ... }
The ITEMMARKED < bItemMarked > code block is evaluated when a menu item
in a
menu has been highlighted. This can be used to display additional
information associated with a particular menu item, for example.
{| nItemIndex, uNIL, self | ... }
The ITEMSELECTED < bItemSelected > code block is evaluated when a menu
item in a
menu has been selected. This occurs after the user clicks the left
mouse button on the menu item, presses the Return key when the
item is highlighted, or presses the shortcut key combination. This
event is only generated if the selected menu item does not contain
a code block. If it does not contain a code block, the callback
code block or method of the menu object is executed. The first
parameter < nItemIndex > contains the ordinal position of the selected
menu item. {| nItemIndex, uNIL, self | ... }
SUBITEMFONT < cSubItemFont > is the default font for all subitems of
this submenu.
This parameter is ignored if not using the OWNERDRAW option.
BARBITMAP < ocnBarBitMap > is the name of an icon, bitmap, resource or
XbpIcon or XbpBitmap object to use to tile across the unused area of
the menubar where there are no menu items. See sample program:
.\samples\menu\msgbox.prg.
MESSAGEBOXATTACHED will create a messagebox that is attached to
pull-down menus. This provides a better view of menu messages.
See sample program: .\samples\menu\msgbox2.prg.
Description:
The command DCMENUBAR creates a new MenuBar 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.
DCMENUBAR is used with the DCSUBMENU command to add pull-down
menus to MenuBar.
DCMENUBAR objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCPUSHBUTTON, @..DCMULTILINE, DCTOOBAR, etc.
Notes:
The object created by DCMENUBAR is an object of the
XbpMenuBar() class, therefore it can be manipulated with
any iVar or method supported by XbpMenuBar().
Examples:
/*
This example displays a dialogue box with two tab pages
and a menu with 3 submenus: File, Edit, Util.
*/
#include "dcdialog.ch"
#include "appevent.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oFileMenu, oMenuBar, oEditMenu, oMemo, oUtilMenu, ;
cMemo
USE COLLECT
cMemo := COLLECT->memo
@ 0,0 DCMULTILINE cMemo SIZE 70,7 FONT "10.Courier.Bold"
/* ---- Menu ---- */
DCMENUBAR oMenuBar
DCSUBMENU oFileMenu PROMPT "&File" PARENT oMenuBar
DCMENUITEM "&Open a File" PARENT oFileMenu ;
ACTION {||Msgbox('OpenFile')} ;
DCMENUITEM "&Close File" PARENT oFileMenu ;
ACTION {||Msgbox('CloseFile')}
DCMENUITEM "&Pack File" PARENT oFileMenu ;
ACTION {||Msgbox('Packfile')}
DCSUBMENU oEditMenu PROMPT "&Edit" PARENT oMenuBar
DCMENUITEM "&Next Record" PARENT oEditMenu ;
ACTION {||dbSkip(), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_N ;
WHEN {||!Eof()}
DCMENUITEM "&Previous Record" PARENT oEditMenu ;
ACTION {||dbSkip(-1), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_P ;
WHEN {||!Bof()}
DCMENUITEM "&Top of File" PARENT oEditMenu ;
ACTION {||dbGoTop(), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_T
DCMENUITEM "&Bottom of File" PARENT oEditMenu ;
ACTION {||dbGoBottom(), ;
cMemo := COLLECT->memo, ;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_B
DCSUBMENU oUtilMenu PROMPT "&Util" PARENT oMenuBar
DCMENUITEM "Copy File" PARENT oUtilMenu ;
ACTION {||Msgbox('CopyFile')}
DCMENUITEM "Move File" PARENT oUtilMenu ;
ACTION {||Msgbox('MoveFile')}
DCREAD GUI ;
TITLE 'Menu Demo' ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
See Also:
dc_xbpmenuconfig()
DCSUBMENU
DCMENUITEM
DCMENUITEM
Add Item to SUBMENU object for displaying with Text/GUI reader
Syntax:
DCMENUITEM < cPrompt > ;
[PARENT < oParent >] ;
[PARENTID < cParentId >] ;
[CHECKED] ;
[CHECKWHEN < bCheckWhen >] ;
[SEPARATOR] ;
[STYLE < nStyle >] ;
[ATTRIBUTE < nAttr >] ;
[WHEN < bWhen >] ;
[ACCELKEY < nAccelKey >] ;
[ACTION < bAction >] ;
[HELPCODE < cHelpCode >] ;
[CARGO < xCargo >] ;
[ID < cId >] ;
[PRESENTATION < aPres >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >] ;
[MESSAGE < cbMsg > [INTO < oMsgBox >]] ;
[LOCK < cLock >] ;
[PROTECT < bProtect >] ;
[BITMAP < nBmUnChecked > [, < nBmChecked >] ] ;
[COLUMNBREAK]
Arguments:
PROMPT < bcPrompt > is the caption to assign to this menu item.
The caption may be a character string, a resource number for
a bitmap, an XbpBitMap() object another XbpMenu() object,
a NIL (for separator bars), or a code block. If the caption
is a character string, it may include a Tilde (~) character to
define the hot-key for the item like so: "Save ~Changes". If
< bcPrompt > is a code-block, then it must return a character
string, a resource number or an XbpMenu() object. This code
block will be evaluated whenever the function DC_GetRefresh()
or DC_GetWhen() is called.
ACTION < bAction > is a code block that gets evaluated when
the menu item is selected.
PARENT < oParent > is the name of the variable that was
assigned to the parent SubMenu for this Menu Item.
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.
INDEX < nIndex > is a variable name to store the index number
that is assigned to this item when it is created.
CHECKED will cause a check mark to appear next to the menu
item. This option is ignored if a < nAttr > parameter is used.
CHECKWHEN < 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 item will be unchecked. If the
value returned is .TRUE. then the item will be checked. The
parent DCSUBMENU object is passed as a parameter to the code
block.
SEPARATOR is used only if this is a menu separator bar rather
than a selectable item. Do not include a PROMPT. All other
parameters are ignored. This option is ignored if a < nStyle >
parameter is used.
STYLE < nStyle > is a list of XBPMENUBAR_MIS_* numbers defined
in XBP.CH. These options are summed together.
ATTRIBUTE < nAttr > is a list of XBPMENUBAR_MIA_* numbers defined
in XBP.CH. These options are summed together.
XBPMENUBAR_MIA_NODISMISS Menu is not closed after selection
XBPMENUBAR_MIA_FRAMED Menu item is framed
XBPMENUBAR_MIA_CHECKED Menu item has a check mark
XBPMENUBAR_MIA_DISABLED Menu item is not available
XBPMENUBAR_MIA_HILITED Menu item is displayed highlighted
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed when the mouse is placed
over the menu item. The help code is used by the Help system to
for specific context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Button 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.
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 item will be disabled and grayed.
If the value returned is .TRUE. then the item will be enabled.
The parent DCSUBMENU object is passed as a parameter to the
code block.
ID < cID > is a unique 8-character ID to assign to this menu
item. This is used to allow users to assign a menu item as
"default" by pressing a special key.
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.
ACCELKEY < nAccelKey > is a numeric "hot-key" assignment that will
activate the menu item when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH.
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().
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the mouse is passed over the menu item. 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.
LOCK < cLock > is a lock code to assign to this menu item. Lock
codes are any character string up to 5 characters in length.
To gain access to a menu item, a logged on user must own a key
of the same name as the lock or a master key to the lock. The
function DC_ReadGuiMenuAccess() must be called prior to calling
DC_ReadGui() or using any DCREAD GUI command in which the Getlist
contains menu items with locks. DC_ReadGuiMenuAccess() is passed
a comma-delimited character string containing the set of keys
owned by the logged on user. In a typical application, this
function should be called immediately after the logon of a new
user and the users predefined keylist passed to the function.
Example: DC_ReadGuiMenuAccess('ABC,K*,XY*')
This key list will allow access to any menu items that have
no locks or to menu items locked with 'ABC', 'K*' or 'XY*'
To give access to all menu locks assign the key "*****'.
If a menu item is locked and the user does not own a key, the
menu item will not be displayed in the menu.
PROTECT < bProtect > is a code block to evaluate which protects
this menu item. The code block must return a logical value. If
the value returned is .TRUE. then the menu item will not be
included in the menu.
BITMAP is used to define a bitmap that will be displayed to the
left of the menu item prompt. < nBmUnChecked > and
< nBmChecked >
are the numerical resource numbers of bitmaps that have been
linked into the .EXE and define the bitmaps to be used when the
menu items is checked and unchecked respectively. If only one
argument is passed then that bitmap will be used for both
checked and unchecked items.
NOTE: This clause will not function if the menuitem is at
any level lower than a child of a main submenu. For
example, menuitems that are children of sub-sub-menus
cannot have a bitmap.
COLUMNBREAK causes successive menu items to appear in a new
column of the drop-down or popup menu. Look at the sample
program in the .\SAMPLES\MENU directory.
Description:
The command DCMENUITEM creates a new Menu Item 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.
DCMENUITEM is used with the DCSUBMENU command to add menu
items to a pull-down menu.
Notes:
The object created by DCMENUITEM is an object of the
XbpMenu() class, therefore it can be manipulated with
any iVar or method supported by XbpMenu().
Examples:
/*
This example displays a dialogue box with two tab pages
and a menu with 3 submenus: File, Edit, Util.
*/
#include "dcdialog.ch"
#include "appevent.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oFileMenu, oMenuBar, oEditMenu, oMemo, oUtilMenu, ;
cMemo
USE COLLECT
cMemo := COLLECT->memo
@ 0,0 DCMULTILINE cMemo SIZE 70,7 FONT "10.Courier.Bold"
/* ---- Menu ---- */
DCMENUBAR oMenuBar
DCSUBMENU oFileMenu PROMPT "&File" PARENT oMenuBar
DCMENUITEM "&Open a File" PARENT oFileMenu ;
ACTION {||Msgbox('OpenFile')} ;
DCMENUITEM "&Close File" PARENT oFileMenu ;
ACTION {||Msgbox('CloseFile')}
DCMENUITEM "&Pack File" PARENT oFileMenu ;
ACTION {||Msgbox('Packfile')}
DCSUBMENU oEditMenu PROMPT "&Edit" PARENT oMenuBar
DCMENUITEM "&Next Record" PARENT oEditMenu ;
ACTION {||dbSkip(), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_N ;
WHEN {||!Eof()}
DCMENUITEM "&Previous Record" PARENT oEditMenu ;
ACTION {||dbSkip(-1), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_P ;
WHEN {||!Bof()}
DCMENUITEM "&Top of File" PARENT oEditMenu ;
ACTION {||dbGoTop(), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_T
DCMENUITEM "&Bottom of File" PARENT oEditMenu ;
ACTION {||dbGoBottom(), ;
cMemo := COLLECT->memo, ;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_B
DCSUBMENU oUtilMenu PROMPT "&Util" PARENT oMenuBar
DCMENUITEM "Copy File" PARENT oUtilMenu ;
ACTION {||Msgbox('CopyFile')}
DCMENUITEM "Move File" PARENT oUtilMenu ;
ACTION {||Msgbox('MoveFile')}
DCREAD GUI ;
TITLE 'Menu Demo' ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
See Also:
DCSUBMENU
dc_readguimenuaccess()
DCMSGBOX
Display an array of messages in a window
Syntax:
DCMSGBOX < list,... > ;
[TITLE < cTitle >] ;
[TIMEOUT < nSeconds >] ;
[YESNO] ;
[TO < lOutput >] ;
[FONT < cFont >] ;
[BUTTONS < aButtons >] ;
[CHOICE @< nChoice >] ;
[EVAL < bEval >] ;
[ICON < nIcon >] ;
[NORESTORE] ;
[ALWAYSONTOP] ;
[COLOR < nFG >, [< nBG >]] ;
[BUTTSIZE < aButtSize >] ;
[HORIZONTAL] ;
[OWNER < oOwner >]
Arguments:
< list,... > is a comma-delimited list of message lines.
TITLE < cTitle > is the title to place at the top of the message
box.
TIMEOUT < nSeconds > will display the box for a specified number
of seconds or until a key is hit.
YESNO will display YES / NO menu items below the message text.
CHOICE @< nChoice > : 1 will default to YES (default), 2 will
default to NO. If passed by reference and an array of < aButtons >
is also passed, then the value returned will be equivalent to
the menu item selected.
BUTTONS < aButtons > - An array of menu buttons to choose from. The
number of the selected item will be returned in the < @nChoice >
variable. This is a single-dimensional array of captions for the
buttons.
TO < lOutput > is a logical variable to store the result of the
message box when using the YESNO clause. If the operator selects
YES then < lOutput > will be .TRUE., otherwise it will be .FALSE.
HOTKEY @< cHotKey > - An optional parameter to return the value of
the high-lighted letter in the selected menu item when using
DCMSGBOX with an array of menu buttons. This must be a variable,
passed by reference, in which to store a character value.
FONT < cFont > is the font to use for the message text. This must
conform to standard font declarations used with the
:setFontCompoundName() method of XbpStatic().
EVAL < bEval > is a code block to evaluate after the Message box
is created. The Messsage box dialog object is passed to the
code block.
ICON < nIcon > is the icon to use in the message box text area.
The default is XBPSTATIC_SYSICON_ICONQUESTION when the YESNO clause
is used otherwise it is XBPSTATIC_SYSICON_ICONINFORMATION.
NORESTORE overrides the setting of DC_AutoRestoreWindow().
ALWAYSONTOP forces the window to stay on top of all other
application windows.
COLOR < nFG >, < nBG > is the foreground and background color
of
the text. The default color is set by the DC_MsgBoxColor() get-set
function.
BUTTSIZE < nButtonWidth >, < nButtonHeight > is the width and
height,
in pixels, of the buttons created with the BUTTONS clause,
otherwise the buttons will be sized to the longest caption.
HORIZONTAL will create the buttons horizontally instead of
vertically.
OWNER < oOwner > is the owner of the message box. If the owner
parameter is not used, the message box will center in the
object returned by the SetAppWindow() function, otherwise it
will center on the owner.
Description:
DCMSGBOX is used to display a set of message lines in a
window. This command is an easy-to-use front end to the
function DC_MsgBox().
Examples:
// Example 1
PROCEDURE Xtest( )
DCMSGBOX ;
'This selection will permanently remove all', ;
'deleted records. Continue?' ;
YESNO ;
FONT '12.Arial Bold' ;
TO lOk
IF lOk
PACK
ENDIF
RETURN
// Example 2
FUNCTION Xtest2()
LOCAL nChoice := 2
DCMSGBOX 'There was an error when trying to', ;
'save the file to disk', ;
'Please choose a corrective action.' ;
TITLE "Save Error!" ;
FONT "10.Arial Bold" ;
BUTTONS {'~Quit the Program', ;
'~Format the Hard Drive', ;
'~Get a beer'} ;
CHOICE @nChoice
IF nChoice = 1
QUIT
ELSEIF nChoice = 2
// pray
ELSEIF nChoice = 3
DCMSGBOX "I will meet you a O'Learys"
ENDIF
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
dc_alert()
dc_menupull()
dc_msgbox()
dc_msgboxescape()
dc_msgboxcolor()
DCMXADDBUTTON
Add an MXPUSHBUTTON to a ToolBar
Syntax:
See @ DCMXPUSHBUTTON.
The arguments are the same except that the row and column
arguments are not needed.
Arguments:
See @ DCMXPUSHBUTTON.
Description:
The command DCMXADDBUTTON creates a new MxPushButton object
and adds the object to the array named GETLIST which is later
processed by the DC_READGETS() function or by the DCREAD
command. DCMXADDBUTTON is used with DCTOOLBAR to add a
PushButton to the toolbar. Each button is automatically
placed in the next open place on the previously declared
ToolBar. The GETLIST array must be first declared and
initialized to the value of {}. The command DCREAD 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.
@..DCMXADDBUTTON objects can be combined with any objects that
that use the DCDIALOG system, such as @..DCSAY..GET,
@..DCRADIO, @..DCMULTILINE, @..DCCHECKBOX or @..DCTABPAGE.
@..DCMXADDBUTTON objects are derived from Joe Carrick's
MxPushButton class. Each object may contain up to 3 captions
of type text, bitmap or icon.
Notes:
The object created by @ DCMXPUSHBUTTON is an object of the
MxPushButton() class, therefore it can be manipulated with
any iVar or method supported by MxPushButton() class.
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.
The function DC_BitmapTransparentColor() may be used to set the
default transparent color for pushbuttons that have bitmaps as
captions.
Examples:
Run XDEMO.EXE - Sample Group 6 - MxPushButton
Source/Library:
DCMXBUTT.CH
See Also:
@ DCTOOLBAR
@ DCMXPUSHBUTTON
DCPANEL
Anchor a Dialog Window to the perimiter of a main Dialog
Syntax:
DCPANEL < oDialog > ;
[DRAWINGAREA < oDrawingArea >] ;
[ALIGN < nAlign >] ;
[HEIGHT < nHeight >] ;
[WIDTH < nWidth >] ;
[BITMAP < ncoBitMap >] ;
[BORDER < nBorder >] ;
[COLOR nbColorFG [,nbColorBG] ;
[CARGO < xCargo >] ;
[PRESENTATION < aPres >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[HIDE < bHide >] ;
[ID < cId >] ;
[GROUP < cGroup >]
Arguments:
< 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().
ALIGN < nAlign > is a numeric constant defined in DCDIALOG.CH.
DCGUI_ALIGN_TOP - Attach statusbar to top of window
DCGUI_ALIGN_BOTTOM - Attach statusbar to bottom of window
DCGUI_ALIGN_RIGHT - Attach statusbar to right side of window
DCGUI_ALIGN_LEFT - Attach statusbar to left side of window
HEIGHT < nHeight > is the height (in pixels) of the status bar if
it has a top or bottom alignment. This clause is ignored if the
status bar has a left or right alignment.
WIDTH < nWidth > is the width (in pixels) of the status bar if
it has a left or right alignment. This clause is ignored if the
status bar has a top or bottom alignment.
BITMAP < ncoBitMap > is a bitmap to use as wallpaper for the panel.
BORDER < nBorder > is the border type of the panel. Borders are
defined in XBP.CH. The default is XBPDLG_SIZEBORDER. This allows
the panels to be resized by the user.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Statusbar 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 Status Bar object is created. The object is passed
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 status bar will be hidden from view. If
the value returned is .FALSE. then the status bar will be displayed.
The object is passed as a parameter 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_GETOBJECT() 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().
Description:
DCPANEL is used to create Dialog windows around the perimiter of the
a main dialog window that are automatically resized when the dialog
is resized and are children of the main XbpDialog() object rather
than the drawingArea. This allows for panels which can be used
as parents for any other objects that are anchored to the main
dialog window and cannot be hidden by other child windows.
A single dialog may have multiple panels. Each panel can be
individually hidden from view which will shift all other panels to
the top, bottom, etc. The panel is a window of the XbpDialog()
type class and can be the parent of any other type of DC* object.
Source/Library:
DCDIALOG.CH
See Also:
DCSTATUSBAR
DCPRINT ?/??
Send text to printer using ?/?? style printing
Syntax:
DCPRINT ? | ?? < uText > ;
[PRINTER < oPrinter >] ;
[WHEN < bWhen >]
Arguments:
< uText > is any variable.
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.
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 ? prints text at the start column of the next row
after the current print row.
DCPRINT ?? prints text at the current row/column.
Notes:
The DCPRINT ?/?? command uses the :Qout()/:QQout() methods
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 nRow, cScrn, aFor_Sale, cFontName, oPrinter, i
lPreview := IIF( Valtype(lPreview)='L',lPreview,.t.)
USE collect NEW
GO TOP
aFor_Sale := { 'No','Yes','Not Sure' }
BEGIN SEQUENCE
IF lPreview
DCPRINT ON SIZE 50,90 FONT '9.Terminal' TO oPrinter PREVIEW
ELSE
DCPRINT ON SIZE 50,90 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 := 1
oPrinter:nPage := 1
DO WHILE !Eof()
IF nRow = 1
DCPRINT FONT '14.Arial.Bold'
DCPRINT ? 'My Personal Collection Inventory '
DCPRINT ?? 'Page ' + Alltrim(Str(oPrinter:nPage))
DCPRINT ?? ' '
DCPRINT ?? Date()
DCPRINT ?
nRow += 2
DCPRINT FONT '12.Arial.Bold'
DCPRINT ? Pad('Description',35)
DCPRINT ?? Pad('Type',15)
DCPRINT ?? Pad('Sub-Type',15)
DCPRINT ?? Pad('Cond',6)
DCPRINT ?? Pad('For Sale?',11)
DCPRINT ?? 'Value'
DCPRINT ?
nRow += 2
DCPRINT FONT cFontName
ELSE
DCPRINT ? Pad(COLLECT->descrip,35)
DCPRINT ?? Pad(COLLECT->type,15)
DCPRINT ?? Pad(COLLECT->sub_type,15)
DCPRINT ?? Pad(COLLECT->condition,6)
DCPRINT ?? Pad(aFor_Sale[COLLECT->for_sale+1],11)
DCPRINT ?? Str(COLLECT->appr_value,7,2)
nRow++
SKIP
IF nRow > ( oPrinter:nRows - 5 )
DCPRINT EJECT
nRow := 1
ENDIF
ENDIF
ENDDO
NEXT
END SEQUENCE
DCPRINT OFF
IF !lPreview
DC_Impl(cScrn)
ENDIF
CLOSE
RETURN
Source/Library:
DCPRINT.CH
DCPRINT ABORT
Abort the print job
Syntax:
DCPRINT ABORT ;
[PRINTER < oPrinter >]
Arguments:
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. .
Description:
DCPRINT ABORT is used to abort a print job before it gets sent
to the printer. This command must be called before the
DCPRINT OFF command to insure that the print is properly
aborted.
Notes:
The :Eject() method looks at the current ::nPage instance
variable and compares it to ::nFrom and ::nTo. If the
current page is outside the range selected by the user
then the page will not be ejected and only the ::nPage
instance variable will be incremented.
Examples:
#include "dcprint.ch"
#include "inkey.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() .AND. DC_PrinterOk() .AND. Inkey(.1) # K_ESC
@ 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 LastKey() = K_ESC
DCPRINT ABORT
ENDIF
IF !lPreview
DC_Impl(cScrn)
ENDIF
END SEQUENCE
DCPRINT OFF
RETURN
Source/Library:
DCPRINT.CH
DCPRINT ATTRIBUTE
Set the Attributes for printing with DCPRINT commands
Syntax:
DCPRINT ATTRIBUTE ;
[PRINTER < oPrinter >] ;
[TEXT | STRING < aString >] ;
[LINE < aLine > ] ;
[AREA < aArea > ] ;
[MARKER < aMarker >] ;
[WHEN < bWhen >]
Arguments:
< ocFont > is a character string containing the Compound Font
Name or a Font object.
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.
TEXT | STRING < aString > is an attribute array that meets the
specification for string attributes used by @ DCPRINT SAY. See
the Alaska documentation for GraSetAttrString() for more
information about the specification for this array.
LINE < aLine > is an attribute array that meets the
specification for line attributes used by @ DCPRINT BOX. See
the Alaska documentation for GraSetAttrLine() for more
information about the specification for this array.
AREA < aArea > is an attribute array that meets the
specification for area attributes used by @ DCPRINT BOX. See
the Alaska documentation for GraSetAttrArea() for more
information about the specification for this array.
MARKER < aMarker > is an attribute array that meets the
specification for line attributes used by @ DCPRINT MARKER. See
the Alaska documentation for GraSetAttrMarker() for more
information about the specification for this array.
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 ATTRIBUTE is used to set the attributes for use with
the @..DCPRINT SAY, DCPRINT ?/??, @ DCPRINT BOX commands.
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
DCPRINT EJECT
Eject the printer page
Syntax:
DCPRINT EJECT ;
[PRINTER < oPrinter >]
Arguments:
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. .
Description:
DCPRINT EJECT has a dual purpose depending on whether the print
output is going to a print device or to the PREVIEW window.
If the PREVIEW clause was used in the DCPRINT ON command, then
DCPRINT EJECT will start a new page and display a preview window.
The preview window includes "zoom", scrollbars, next and previous
buttons. Each time DCPRINT EJECT is encountered in the code the
next page is displayed and stored in a buffer. The NEXT button on
the Preview window will exit the preview and return control to the
print loop. The PREVIOUS button on the Preview window will
display the previously buffered page.
If the NONSTOP sub-clause of the PREVIEW clause is used, then
DCPRINT EJECT will only start a new page but will not stop and
give control to the preview window until the DCPRINT OFF or
DCPRINT GROUPEJECT command is encountered in the code.
If the PREVIEW clause was NOT USED in the DCPRINT ON command,
the DCPRINT EJECT is used to eject the printer paper, start
a new page and set the printer row/column to 0,0.
Notes:
The :Eject() method looks at the current ::nPage instance
variable and compares it to ::nFrom and ::nTo. If the
current page is outside the range selected by the user
then the page will not be ejected and only the ::nPage
instance variable will be incremented.
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:
DCPRINT ON
DCPRINT GROUPEJECT
DCPRINT ENDPAGE
Start a new Page in a Print Job
Syntax:
DCPRINT ENDPAGE
Description:
DCPRINT ENDPAGE ends the current page within the print job.
DCPRINT ENDPAGE ends the current page but no new page is begun.
After DCPRINT ENDPAGE, the print job is temporarily halted between
pages. This can be used by the application to change the following
print attributes before the next page is begun via a call to
DCPRINT STARTPAGE.
Print attributes that may be changed after DCPRINT ENDPAGE
Attribute Related command
Page Orientation DCPRINT ORIENTATION
Paper Bin DCPRINT PAPERBIN
Form Size DCPRINT SIZE
Examples:
FUNCTION XTest()
nOrientation := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
DCPRINT ON
DCPRINT SIZE 60,80
DCPRINT FONT cFont
FOR nPage := 1 TO 4
@ 2, 10 DCPRINT SAY 'This is Page ' + Alltrim(Str(nPage)) + ;
IIF(nOrientation=1,' (PORTRAIT - Bin 1)',' (LANDSCAPE - Bin 2)' )
FOR i := 5 to nRows - IIF( nOrientation=1,10,20)
cString := ''
FOR j := 10 TO IIF(nOrientation=1,70,120)
cString += Alltrim(Str(j%10))
NEXT
@ i, 10 DCPRINT SAY cString
NEXT
DCPRINT ENDPAGE
IF nPage % 2 == 0
nOrientation := 1
nPaperBin := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
ELSE
nOrientation := 2
nPaperBin := 2
nRows := 60
nCols := 130
cFont := '9.Courier New'
ENDIF
DCPRINT ORIENTATION nOrientation
DCPRINT PAPERBIN nPaperBin
DCPRINT SIZE nRows, nCols
DCPRINT FONT cFont
DCPRINT STARTPAGE
NEXT
DCPRINT OFF
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
DCPRINT STARTPAGE
DCPRINT ON
DCPRINT ORIENTATION
DCPRINT PAPERBIN
DCPRINT EVAL
Evaluate a code block to imbed custom graphs in printed page
Syntax:
DCPRINT EVAL < bEval > ;
[PRINTER < oPrinter >] ;
[WHEN < bWhen >]
Arguments:
< bEval > is the code block to evaluate. The DC_Printer() object
is passed as a parameter to the code block.
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.
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 EVAL is used to run any special print routine and imbed
the results within the printed page or preview window. This
command is handy for printing routines such as pie-charts and
graphs.
Examples:
FUNCTION XTest()
LOCAL oPrinter, i
DCPRINT ON TO oPrinter PREVIEW FONT '6.Terminal'
FOR i := 5 TO 20
@ i,10 DCPRINT SAY 'This is line ' + Alltrim(Str(i))
NEXT
FOR i := 25 TO 40
GraStringAt( oPrinter:oPS, oPrinter:PenCoords(i,10), ;
'This is line ' + Alltrim(Str(i)) )
NEXT
DCPRINT EJECT
@ 5,10 DCPRINT SAY 'Look at the below Pie Chart' ;
FONT '14.Arial Bold'
DCPRINT EVAL {|o|DrawPieChart(o)}
DCPRINT OFF
RETURN nil
* -------------
FUNCTION DrawPieChart( oPrinter )
LOCAL nX, nY, nRadius, nStartAngle, aAngle, ;
aPattern, i, aPenCoords
aPenCoords := oPrinter:PenCoords(20,40)
nX := aPenCoords[1] // mid-point of the
nY := aPenCoords[2] // pie chart
nRadius := 350 // radius
aAngle := { 30, 100, 15, 75, 80, 60 }
aPattern := { ; // various fill attributes
GRA_SYM_DENSE2, ;
GRA_SYM_DIAG1 , ;
GRA_SYM_DENSE4, ;
GRA_SYM_DIAG2 , ;
GRA_SYM_DENSE6, ;
GRA_SYM_DIAG3 }
nStartAngle := 45 // starting angle
FOR i := 1 TO LEN( aAngle ) // draw filled arcs
DrawFilledPartialArc( {nX, nY}, nRadius, ;
nStartAngle, aAngle[i], ;
aPattern[i], .T., oPrinter:oPS )
nStartAngle += aAngle[i] // increment starting angle
NEXT
RETURN nil
*****************************************
* Draws filled arcs *
*****************************************
FUNCTION DrawFilledPartialArc( aCenter, ;
nRadius, ;
nStartAngle, ;
nSweepAngle, ;
nPattern , ;
lOutline, ;
oPS )
LOCAL aAttr, nSegment
aAttr := Array( GRA_AA_COUNT ) // select fill pattern
aAttr [ GRA_AA_SYMBOL ] := nPattern
aAttr := GraSetAttrArea( oPS, aAttr )
// open segment
nSegment := GraSegOpen( oPS, GRA_SEG_MODIFIABLE )
GraPathBegin( oPS ) // define path
GraPos( oPS, aCenter ) // define arc
GraArc( oPS, aCenter, nRadius,, nStartAngle, nSweepAngle )
GraPathEnd( oPS, .T. ) // end path definition
GraSegClose( oPS ) // close segment
GraSegDraw( oPS, nSegment ) // create path for drawing
GraPathFill( oPS ) // fill path
IF lOutline
GraSegDraw( oPS, nSegment ) // recreate path
GraPathOutline( oPS ) // outline path
ENDIF
GraSegDestroy( oPS, nSegment) // delete segment
GraSetAttrArea( oPS, aAttr ) // reset old attributes
RETURN NIL
Source/Library:
DCPRINT.CH
DCPRINT FIXED
Set FIXED mode ON/OFF within a print job
Syntax:
DCPRINT FIXED ON / OFF
Description:
DCPRINT FIXED ON will print each character in fixed columns (even when
using proportional fonts).
DCPRINT FIXED OFF will cause characters will be printed in the same
proportion as the chosen font.
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ON
DCPRINT FONT
Set the Font for printing with @..SAY style coordinates
Syntax:
DCPRINT FONT < ocFont > ;
[CODEPAGE < nCodePage >] ;
[PRINTER < oPrinter >] ;
[WHEN < bWhen >]
Arguments:
< ocFont > is a character string containing the Compound Font
Name or a Font object.
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
selected font other than the default code page.
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.
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 FONT is used to set the font for use with the
@..DCPRINT SAY or DCPRINT ?/?? commands.
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
DCPRINT FORMSIZE
Change the form size within a print job
Syntax:
DCPRINT FORMSIZE < nFormSize >
Description:
DCPRINT FORMSIZE sets the print form size within a print job.
A #define constant from DCPRINT.CH must be used for <þnBinþ> . Valid
constants have the prefix XBPPRN_FORM_. Alternatively, a value
obtained via the oPrinter:oDC:setFormSize() method can be used.
This command may be used only after a DCPRINT ENDPAGE and before
a DCPRINT STARTPAGE.
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ENDPAGE
DCPRINT GROUPEJECT
Preview the next print group
Syntax:
DCPRINT GROUPEJECT ;
[PRINTER < oPrinter >] ;
[TO < nStatus >]
Arguments:
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.
TO < nStatus > is the name of a variable to store a numeric return
value based on the key clicked by the user. The manifest constants
in the below table are defined in "DCPRINT.CH".
< nStatus > Description
------------------ -------------------------------------------
DCPRINT_GROUP_FIRST Returned when "Top" button is clicked
DCPRINT_GROUP_PREV Returned when "Prev" button is clicked.
DCPRINT_GROUP_NEXT Returned when "Next" button is clicked.
DCPRINT_GROUP_LAST Returned when "Bottom" button is clicked.
DCPRINT_GROUP_NONE Returned when "Ok" or "Cancel" button is clicked.
Description:
DCPRINT GROUPEJECT is used to allow for previewing of print jobs in
"groups" of pages. For example, this can be used to step through a
set of invoices in which each invoice may have a different number of
pages. Each previewed invoice will be a "group" of pages.
Clicking the "Next" group button will exit the preview window and
return a value of DCPRINT_GROUP_NEXT. By testing for this value in
the print loop the record pointer can be moved to the next invoice
for printing.
The "Print" button will print only the pages that are part of the
group and are visible in the preview window. Each time DCPRINT
GROUPEJECT is encountered in the code, control is given to the
preview window. If the user clicks on "Top", "Prev", "Next" or
"Bottom", the preview buffer is cleared and a respective numeric
value is returned to be used for selecting the next group to
preview.
Examples:
#include "dcprint.ch"
PROCEDURE XTest
DCPRINT ON PREVIEW NONSTOP HIDE GROUPBUTTONS
USE INVOICES
DO WHILE .t.
PrintInvoice() // code to print multiple pages of invoice
DCPRINT GROUPEJECT TO nStatus
IF nStatus == DCPRINT_GROUP_FIRST
INVOICE->(dbGoTop())
ELSEIF nStatus == DCPRINT_GROUP_PREV
INVOICE->(dbSkip(-1))
ELSEIF nStatus == DCPRINT_GROUP_NEXT
INVOICE->(dbSkip(1))
ELSEIF nStatus == DCPRINT_GROUP_LAST
INVOICE->(dbGoBottom())
ELSEIF nStatus == DCPRINT_GROUP_NONE
EXIT
ENDIF
ENDDO
DCPRINT OFF
RETURN
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ON
dc_printergroupeject()
DCPRINT OFF
Destroy a printer object
Syntax:
DCPRINT OFF ;
[PRINTER < oPrinter >]
Arguments:
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.
Description:
DCPRINT OFF destroys a printer object that was previously
created with DCPRINT ON or DC_PrinterOn().
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_printeroff()
DCPRINT ON
DCPRINT ON
Create a printer class object for @..SAY style printing
Syntax:
DCPRINT ON ;
[TO < oPrinter >] ;
[OPTIONS < aDefaultOptions >] ;
[NAME < cPrinterName >] ;
[SIZE < nRows >,< nCols >] ;
[PAGES < nFrom >,< nTo >] ;
[VIEWPORT < nX1 >,< nY1 >,< nX2 >,< nY2 >] ;
[ALLPAGES] ;
[COPIES < nCopies >] ;
[COPYLOOP] ;
[COLLATE] ;
[TEXTONLY] ;
[TOFILE] ;
[OUTFILE < cOutFile > [OVERWRITE] [APPEND]] ;
[FONT < ocFont >] ;
[FIXED] ;
[NOSCALE] [PIXEL] ;
[PAGESIZE < nPageWidth >,< nPageHeight >] ;
[UNITS < nUnits >] ;
[USEDEFAULT ] ;
[FORCEPRINTDIALOG] ;
[HANDLER < bHandler >] ;
[FONTBUTTON] ;
[ORIENTATION < nOrientation >] ;
[PAPERBIN < nPaperBin >] ;
[FORMSIZE < nFormSize >] ;
[DUPLEXMODE < nDuplexMode >] ;
[COLORMODE < nColorMode >] ;
[RESOLUTION < nResolution >] ;
[MARGIN < anMargin >] ;
[TITLE < cTitle >] ;
[CANCELENABLE] ;
[AUTOEJECT] ;
[DIALOGSTYLE < nDialogStyle >] ;
[GRID] ;
[PREVIEW] ;
[ZOOMFACTOR < nZoomFactor > [,< nZoomIncr >]] ;
[SCROLLFACTOR < nScrollFactor >] ;
[PPOSITION < nStartCol >,< nStartRow >] ;
[PSIZE < nWidth >,< nHeight >] ;
[NOSTOP] ;
[HIDE] ;
[NOPRINTBUTTON] ;
[BUSYMESSAGE < cBusyMsg >] ;
[FINDBUTTON] ;
[BUTTONS < aButtons >] ;
[ADDBUTTONS < aAddButtons >] ;
[GROUPBUTTONS] ;
[EXITAFTERPRINT] ;
[NOSCROLLBARS] ;
[ACROBAT [NOSPAWN]] ;
[IMAGEWRITER] ;
[XPSWRITER [NOSPAWN]] ;
[EXCEL]
Arguments:
TO < oPrinter > is a variable to store the printer object.
OPTIONS < aDefaultOptions > is used to establish the default
options for print jobs. < aDefaultOptions > is an array that was
previously created by the DCPRINT OPTIONS command.
NAME < cPrinterName > is the name of the printer. If
this argument is not used, a printer dialog will appear
for the operator to choose a printer and other options.
SIZE < nRows >, < nCols > is the number of print rows and
columns.
The default is 66 rows, 80 columns for compatibility with existing
Xbase language reports. This establishes a "grid" on the page
so the page may be addressed using text-based coordinates. To
get tighter control of the pen location on the paper use very
high numbers, such as 660,800. When using commands such as
@ < nRow >, < nCol > DCPRINT SAY, the < nRow > and
< nCol > coordinates
are the grid coordinates.
PAGES < nFrom >, < nTo > is the starting and ending page.
The default is All pages.
VIEWPORT < nX1 >, < nY1 >, < nX2 >, < nY2 >
contains the coordinates for
the lower left and upper right corners of the viewport. Including
this parameter is optional and sets the size of the viewport.
The viewport is important for graphic output in the device context
linked to the printer or preview presentation space. The viewport
coordinates are relative to the point {0,0} of the output device
or device context. In the viewport itself everything is displayed
that is visible in the page of the presentation space. The
viewport contents are transferred to the output device (the device
context).
Note: When dimensioning the viewport two automatic graphic
transformations are performed. One is the transformation of the
page to the viewport and the other is the transformation of the
viewport to the output device (the device context). See the
Xbase++ documentation for more information about the ViewPort.
ALLPAGES will disable the users selection of pages to print
in the printer dialog window.
COPIES < nCopies > is the number of copies to print. The
default is 1.
COLLATE will collate the pages.
COPYLOOP is used to disable the sending of the request to the
print driver to print multiple copies. If the user selects
copies from the print dialog screen the value selected will be
placed in the oPrinter:nCopies variable and the programmer must
used this value in a FOR..NEXT loop to print multiple copies.
FONT < ocFont > is the starting font. May be a character string
with a Font name or a font object. Default is 12.Courier.
FIXED will print each character in fixed columns (even when
using proportional fonts). If argument is not used,
characters will be printed in the same proportion as the
chosen font.
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.
PAGESIZE < nPageWidth >, < nPageHeight > determines the page
size of
the presentation space. The page size depends on the unit < nUnits >
of the coordinate system. The origin of the coordinate system (the
point {0,0}) is the lower left corner of the page.
UNITS < nUnits > optionally sets the unit for the coordinate system
of the presentation space. The default unit is pixel. To define a
different unit, a #define constant must be passed for < nUnits > .
The following table lists the valid constants for < nUnits > .
Constant Description
GRA_PU_ARBITRARY Any unit. The coordinate system is scaled to
the viewport.
GRA_PU_PIXEL Unit is a pixel
GRA_PU_LOMETRIC * Unit is 0.1 millimeter
GRA_PU_HIMETRIC Unit is 0.01 millimeter
GRA_PU_LOENGLISH Unit is 0.1 inch
GRA_PU_HIENGLISH Unit is 0.01 inch
GRA_PU_TWIPS Unit is 1/1440 inch
*) Default value
TEXTONLY will output the report in text-only mode. The user will
be prompted for the name of a text file to create unless the
OUTFILE < cOutFile > clause is used. Only text commands will be
processed in TEXTONLY mode. OVERWRITE will automatically
overwrite any existing file. APPEND will automatically append
the output to the existing file.
TOFILE is used to send the print job to a file rather than
directly to the print spooler. The user will be prompted for
the name of a print image file to create unless the OUTFILE
< cOutFile > clause is used. The file that is created may be
later sent to the print spooler via RunShell() as per the
following example:
DCPRINT ON TOFILE OUTFILE JUNK.PRN
..... print commands
RunShell( '/C COPY JUNK.PRN \\gigadrive\sc254887_p1' )
USEDEFAULT will send the print job to the currently selected
Windows default printer driver without displaying a Printer
dialog window (unless FORCEPRINTDIALOG) is used.
FORCEPRINTDIALOG will force the Printer dialog window to be
displayed.
HANDLER < bHandler > is a codeblock to evaluate in the event loop
of the preview window. This gives the programmer control over
previewing operations. The DC_Printer() object is passed as a
parameter when evaluating the code block. A numeric value is
returned from the code block:
VALUE FUNCTION
------------------ -----------------------------------------
DCGUI_NONE Normal operation
DCGUI_IGNORE Ignore this event (do not handle it)
DCGUI_EXIT_OK Exit the event loop and return control
to printing loop.
DCGUI_EXIT_ABORT Exit the event loop and set the ::terminated
flag of the DC_Printer() object to abort
the print routine.
FONTBUTTON will enable the FONT button on the Printer dialog
for the operator to select a font for the print operation.
Note: Any FONT clause in DCPRINT commands will override the
selection by the operator.
ORIENTATION < nOrientation > is used to select the paper orientation
the output is to the printer.
< nOrientation > Mode
-------------- ----------------------------
1 Portrait (default)
2 Landscape
PAPERBIN < nPaperBin > is used to instruct the printer which paper
bin to use for the print job. A #define constant from XBPDEV.CH
must be used for < nPaperBin > . Valid constants have the prefix
XBPPRN_PAPERBIN_.
FORMSIZE < nFormSize > is used to instruct the printer what paper
format is being used. Common formats are Letter, Legal or A4.
They are selected by their numeric ID which is available as a
#define constant from XBPDEV.CH. Valid constants have the prefix
XBPPRN_FORMSIZE_.
DUPLEXMODE < nDuplexMode > is used to set the duplex mode for
double-sided printing. The mode is selected by a numeric ID
which is available as a #define constant from XBPDEV.CH. Valid
constants have the prefix XBPPRN_DUPLEXMODE_.
COLORMODE < nColorMode > is used to set the color mode for printing.
The mode is selected by a numeric ID which is available as a
#define constant from XBPDEV.CH. Valid constants have the prefix
XBPPRN_COLORMODE_.
RESOLUTION < nResolution > is used to set the resolution for printing.
The mode is selected by a numeric ID which is available as a
#define constant from XBPDEV.CH. Valid constants have the prefix
XBPPRN_RESOLUTION_.
MARGIN < anMargin > may be a numeric value or an array of two
numeric values. If it is a numeric value, then this will be the
value of the left margin. If it is an array, then the first
element is the TOP margin and the second element is the LEFT
margin. The margins may be negative and/or decimal values.
TITLE < cTitle > is the title to display in the title bar area of the
Preview window and the Printer Dialog window. This is also the
name of the print job that is sent to the spooler.
CANCELENABLE will display a dialog window during printing that
includes a CANCEL button to cancel the print job. It is required
that the function DC_PrinterOK() be included in your print loop
to cancel the print loop because cancelling will cause
DC_PrinterOK() to return a .FALSE.
AUTOEJECT will cause an automatic page eject whenever an
attempt is made to print past the last print row defined by the
SIZE < nRows >, < nCols > command or whenever an attempt is
made to
print to a row that is higher on the page than the last printed
row. This feature is provided for compatability with existing
Clipper reports.
DIALOGSTYLE < nDialogStyle > allows users of eXPress++ 1.3 and earlier
versions to display the same style dialog in their 1.5 applications
as was displayed in 1.3. Xbase++ 1.5 introduced a new
XbpPrinterDialog() class which was incorporated in eXPress++ 1.5.
This new dialog is created by the print driver whereas the old
dialog was created by eXPress++ and also included a FONT button for
selecting a print font. DIALOGSTYLE DCPRINT_DIALOG_EXPRESS will
display the 1.3 style printer dialog.
GRID will print a cross-hatch grid on the paper or preview
window at each text-based row and column defined by the SIZE
clause. The grid will also include row/column numbers at the
top and left border. The GRID option will aid in the designing
of reports.
PREVIEW will cause the printed output to be sent to the
display rather than the print device. The PREVIEW arguments
causes the methods of the DC_PRINTER() class to write to an
XbpDialog() GUI dialog screen rather than to an XbpPrinter()
object.
ZOOMFACTOR < nZoomFactor > is a numeric value to use as the
base for the initial zoom value of the Preview window. This
clause is used only in PREVIEW mode. The default is 1.0. A
higher number will cause the text and graphics in the screen
to be larger. The minimum value is .25. Numeric values from
0.25 to 4.00 are recommended. < nZoomIncr > is a numeric value
specifying the zoom resolution. A smaller number will cause
each click of the ZOOM+/ZOOM- key to have a smaller change.
The default value is .25.
SCROLLFACTOR < nScrollFactor > is used to set the sensitivity of
the scroll bars in the PREVIEW window. The default is 40.
PPOSITION < nStartCol >, < nStartRow > are the starting
coordinates
of the PREVIEW window (in pixels) relative to the left, bottom
of the screen. The default is 0,0.
PSIZE < nWidth >, < nHeight > is the width and height of the
PREVIEW window (in pixels). If no size is given then the
window will be automatically sized to fit the screen.
NOSTOP will supress the automatic stop of program execution each
time a DCPRINT EJECT command or oPrinter:eject() method is
encountered in the program. The control will then be given to
the event loop of the PREVIEW window. If the NOSTOP clause is
used then the control will only be given to the PREVIEW window
when the command DCPRINT OFF or the function DC_PrinterOff() are
encountered in the program.
HIDE will hide the previewer window until the command DCPRINT OFF
or the function DC_PrinterOff() are encountered in the program.
If the HIDE clause is not used, each page will be visible in
the preview window as they are being created.
NOPRINTBUTTON will remove the 'Print' button from the preview
window, thereby disabling the ability to print while previewing.
BUSYMESSAGE < cBusyMsg > is a message to display while each
screen is being created. Use this clause if your application
takes a long time to create a screen.
FINDBUTTON will paint a 'Find' button on the preview window.
Activating this button will popup a dialog window for the user to
enter "Text to find in Report". The preview buffer will be
searched for a match and will jump to the page containing the
found text. The found text will be outlined.
BUTTONS < aButtons > is an array that is used to configure the
thirteen
(13) pushbuttons at the top of the preview window. This allows the
buttons to be resized or deleted or the captions to be changed to
character string, numeric resource or bitmap. Each sub-array is an
array of 3 elements:
Element Description
------- -----------------------------------------------
1 Button Width (numeric). NIL for no change.
2 Button Height (numeric). NIL for no change.
3 Button Caption (numeric resource, string or
XbpBitMap() object). NIL for no change.
This may also be an array of 2 bitmaps, to be
used for the enabled and disabled condition
of the button respectively.
The button(s) to be configured are defined by the DCPRINT_BUTTON*
constants in DCPRINT.CH.
Constant Description
-------------------------- -----------------------------------
DCPRINT_BUTTON_PLUS Plus (Zoom Out) Button
DCPRINT_BUTTON_MINUS Minus (Zoom In) Button
DCPRINT_BUTTON_FIRSTPAGE First Page Button
DCPRINT_BUTTON_PREVPAGE Previous Page Button
DCPRINT_BUTTON_NEXTPAGE Next Page Button
DCPRINT_BUTTON_LASTPAGE Last Page Button
DCPRINT_BUTTON_PRINT Print Button
DCPRINT_BUTTON_FIND Find Button
DCPRINT_BUTTON_EXIT Ok/Exit Button
DCPRINT_BUTTON_FIRSTGROUP First Group Button
DCPRINT_BUTTON_PREVGROUP Previous Group Button
DCPRINT_BUTTON_NEXTGROUP Next Group Button
DCPRINT_BUTTON_LASTGROUP Last Group Button
Example:
In this example, the Find button is resized to a width of 50
pixels and the caption is changed to BITMAP_FIND_1 (defined in
DCBITMAP.CH).
aButtons := Array(13)
aButtons[DCPRINT_BUTTON_FIND] := { 50,nil,BITMAP_FIND_1 }
GROUPBUTTONS will paint four (4) "Group" buttons at the top of
the window. These buttons are used in conjunction with the
DCPRINT GROUPEJECT command to allow control within the print loop
to manage the previewing of print projects in "groups". For
example, this can be used to step through a set of invoices in
which each invoice may have a different number of pages. Each
invoice will be a "group" of pages. Click the "Next" group button
will exit the preview window and return a value of DCPRINT_GROUP_NEXT.
By testing for this value in the print loop the record pointer can
be moved to the next invoice for printing.
ADDBUTTONS < aAddButtons > is an array of pushbutton data. Each
sub-array
with add a pushbutton to the top toolbar of the preview window.
Each sub-array must consist of 4 elements:
Element Type Description
------- ---- ---------------------------------------------
[1] N Button width in pixels (default is 70)
[2] N Button height in pixels (default is 20)
[3] C/O Caption of button. May be a character string
or an XbpBitmap object.
[4] B Action code block
EXITAFTERPRINT will close the preview window after the print from
preview is selected.
NOSCROLLBARS will supress the creation of scrollbars in the preview window.
ACROBAT is used to invoke Acrobat Reader as the the print
previewer for a much more WYSIWIG preview of the print job.
DO NOT this clause with the PREVIEW, IMAGEWRITER, or DOCWRITER
clauses. To use this clause both the Acrobat Reader
(http://www.adobe.com) and the Win2PDF driver (http://daneprarie.com)
or BullZip drvier (http://bullzip.com) must be installed. The
Acrobat Reader is free and the Win2PDF driver is $39.00. The
demo version of Win2PDF and BullZip are included. The Win2PDF
driver works only on Windows NT, 2000, XP or Vista. The BullZip
driver is free, however it requires that GhostScript be installed
on the workstation computer. GhostScript can be downloaded at
http://www.bullzip.com/download/gsl/gslite.exe. If the NOSPAWN
clause is used, the Acrobat reader with not be spawned to view the
print job.
IMAGEWRITER is used to invoke the 'Microsoft Office Document Image Writer'
as the the print previewer for a much more WYSIWIG preview of the
print job. DO NOT this clause with the PREVIEW or ACROBAT clauses.
To use this clause the Microsoft Office Document Image Writer
must be installed on the workstation. This is a printer driver
that is installed when Microsoft Office is installed.
XPSWRITER is used to invoke the 'Microsoft XPS Document Writer'
as the the print previewer for a much more WYSIWIG preview of the
print job. DO NOT this clause with the PREVIEW or ACROBAT clauses.
To use this clause the Microsoft XPS Document Writer must be
installed on the workstation. NOSPAWN will supress the launching
of the XPS Viewer.
EXCEL is used to create an Excel .XLS spreadsheet as the output.
CAUTION: Some print jobs to not translate well to Excel because
they are not columnar and/or do not contain much numeric data.
To get the best possible export, it is recommend that print code
be formatted using a technique that is compatible. Look at the
\exp19\samples\printer\excel.prg file for an example.
Description:
DCPRINT ON creates a printer class which is used to create
reports that use row/column addressing identical to the
@..SAY addressing used by Clipper. This class provides
for an easy migration of existing reports so that they
may use the more powerful features of the Windows print
manager like font selection and selection of a network
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 HIDE
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_printeron()
DCPRINT OFF
DCPRINT OPTIONS
DCPRINT OPTIONS
Create an option array for setting printing defaults
Syntax:
DCPRINT OPTIONS ;
[TO < aOptions >] ;
[NAME < cPrinterName >] ;
[SIZE < nRows >,< nCols >] ;
[PAGES < nFrom >,< nTo >] ;
[VIEWPORT < nX1 >,< nY1 >,< nX2 >,< nY2 >] ;
[ALLPAGES] ;
[COPIES < nCopies >] ;
[COPYLOOP] ;
[COLLATE] ;
[TOFILE] ;
[TEXTONLY [OUTFILE < cOutFile > [OVERWRITE] [APPEND]] ;
[FONT < ocFont >] ;
[FIXED] ;
[NOSCALE] [PIXEL] ;
[PAGESIZE < aPageSize >] ;
[UNITS < nUnits >] ;
[USEDEFAULT ] ;
[FORCEPRINTDIALOG] ;
[HANDLER < bHandler >] ;
[FONTBUTTON] ;
[ORIENTATION < nOrientation >] ;
[PAPERBIN < nPaperBin >] ;
[FORMSIZE < nFormSize >] ;
[DUPLEXMODE < nDuplexMode >] ;
[COLORMODE < nColorMode >] ;
[RESOLUTION < nResolution >] ;
[MARGIN < anMargin >] ;
[TITLE < cTitle >] ;
[CANCELENABLE] ;
[AUTOEJECT] ;
[DIALOGSTYLE < nDialogStyle >] ;
[GRID] ;
[PREVIEW] ;
[ZOOMFACTOR < nZoomFactor > [,< nZoomIncr >]] ;
[SCROLLFACTOR < nScrollFactor >] ;
[PPOSITION < nStartCol >,< nStartRow >] ;
[PSIZE < nWidth >,< nHeight >] ;
[NOSTOP] ;
[HIDE] ;
[NOPRINTBUTTON] ;
[BUSYMESSAGE < cBusyMsg >]
Arguments:
TO < aOptions > is the array to store the print options.
NAME < cPrinterName > is the name of the printer. If
this argument is not used, a printer dialog will appear
for the operator to choose a printer and other options.
SIZE < nRows >, < nCols > is the number of print rows and
columns.
The default is 66 rows, 80 columns for compatibility with existing
Xbase language reports. This establishes a "grid" on the page
so the page may be addressed using text-based coordinates. To
get tighter control of the pen location on the paper use very
high numbers, such as 660,800. When using commands such as
@ < nRow >, < nCol > DCPRINT SAY, the < nRow > and
< nCol > coordinates
are the grid coordinates.
PAGES < nFrom >, < nTo > is the starting and ending page.
The default is All pages.
VIEWPORT < nX1 >, < nY1 >, < nX2 >, < nY2 >
contains the coordinates for
the lower left and upper right corners of the viewport. Including
this parameter is optional and sets the size of the viewport.
The viewport is important for graphic output in the device context
linked to the printer or preview presentation space. The viewport
coordinates are relative to the point {0,0} of the output device
or device context. In the viewport itself everything is displayed
that is visible in the page of the presentation space. The
viewport contents are transferred to the output device (the device
context).
Note: When dimensioning the viewport two automatic graphic
transformations are performed. One is the transformation of the
page to the viewport and the other is the transformation of the
viewport to the output device (the device context). See the
Xbase++ documentation for more information about the ViewPort.
ALLPAGES will disable the users selection of pages to print
in the printer dialog window.
COPIES < nCopies > is the number of copies to print. The
default is 1.
COLLATE will collate the pages.
COPYLOOP is used to disable the sending of the request to the
print driver to print multiple copies. If the user selects
copies from the print dialog screen the value selected will be
placed in the oPrinter:nCopies variable and the programmer must
used this value in a FOR..NEXT loop to print multiple copies.
TOFILE is used to send the print job to a file rather than
directly to the print spooler. The user will be prompted for
the name of a print image file to create unless the OUTFILE
< cOutFile > clause is used. The file that is created may be
later sent to the print spooler via RunShell() as per the
following example:
DCPRINT ON TOFILE JUNK.PRN
..... print commands
RunShell( '/C COPY JUNK.PRN \\gigadrive\sc254887_p1' )
FONT < ocFont > is the starting font. May be a character string
with a Font name or a font object. Default is 12.Courier.
FIXED will print each character in fixed columns (even when
using proportional fonts). If argument is not used,
characters will be printed in the same proportion as the
chosen font.
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.
PAGESIZE < aPageSize) determines the page size of the presentation
space. < aPageSize > is an array of two elements that specifies the
dimensions of the page in the x and y direction (X = width,
Y = height). The page size depends on the unit < nUnits > of the
coordinate system. The origin of the coordinate system( the point
{0,0}) is the lower left corner of the page.
UNITS < nUnits > optionally sets the unit for the coordinate system
of the presentation space. The default unit is pixel. To define a
different unit, a #define constant must be passed for < nUnits > .
The following table lists the valid constants for < nUnits > .
Constant Description
GRA_PU_ARBITRARY Any unit. The coordinate system is scaled to
the viewport.
GRA_PU_PIXEL Unit is a pixel
GRA_PU_LOMETRIC * Unit is 0.1 millimeter
GRA_PU_HIMETRIC Unit is 0.01 millimeter
GRA_PU_LOENGLISH Unit is 0.1 inch
GRA_PU_HIENGLISH Unit is 0.01 inch
GRA_PU_TWIPS Unit is 1/1440 inch
*) Default value
TEXTONLY will output the report in text-only mode. The user will
be prompted for the name of a text file to create unless the
OUTFILE < cOutFile > clause is used. Only text commands will be
processed in TEXTONLY mode. OVERWRITE will automatically
overwrite any existing file. APPEND will automatically append
the output to the existing file.
USEDEFAULT will send the print job to the currently selected
Windows default printer driver without displaying a Printer
dialog window (unless FORCEPRINTDIALOG) is used.
FORCEPRINTDIALOG will force the Printer dialog window to be
displayed.
HANDLER < bHandler > is a codeblock to evaluate in the event loop
of the preview window. This gives the programmer control over
previewing operations. The DC_Printer() object is passed as a
parameter when evaluating the code block. A numeric value is
returned from the code block:
VALUE FUNCTION
------------------ -----------------------------------------
DCGUI_NONE Normal operation
DCGUI_IGNORE Ignore this event (do not handle it)
DCGUI_EXIT_OK Exit the event loop and return control
to printing loop.
DCGUI_EXIT_ABORT Exit the event loop and set the ::terminated
flag of the DC_Printer() object to abort
the print routine.
FONTBUTTON will enable the FONT button on the Printer dialog
for the operator to select a font for the print operation.
Note: Any FONT clause in DCPRINT commands will override the
selection by the operator.
ORIENTATION < nOrientation > is used to select the paper orientation
the output is to the printer.
< nOrientation > Mode
-------------- ----------------------------
1 Portrait (default)
2 Landscape
PAPERBIN < nPaperBin > is used to instruct the printer which paper
bin to use for the print job. A #define constant from XBPDEV.CH
must be used for < nPaperBin > . Valid constants have the prefix
XBPPRN_PAPERBIN_.
FORMSIZE < nFormSize > is used to instruct the printer what paper
format is being used. Common formats are Letter, Legal or A4.
They are selected by their numeric ID which is available as a
#define constant from XBPDEV.CH. Valid constants have the prefix
XBPPRN_FORMSIZE_.
DUPLEXMODE < nDuplexMode > is used to set the duplex mode for
double-sided printing. The mode is selected by a numeric ID
which is available as a #define constant from XBPDEV.CH. Valid
constants have the prefix XBPPRN_DUPLEXMODE_.
COLORMODE < nColorMode > is used to set the color mode for printing.
The mode is selected by a numeric ID which is available as a
#define constant from XBPDEV.CH. Valid constants have the prefix
XBPPRN_COLORMODE_.
RESOLUTION < nResolution > is used to set the resolution for printing.
The mode is selected by a numeric ID which is available as a
#define constant from XBPDEV.CH. Valid constants have the prefix
XBPPRN_RESOLUTION_.
MARGIN < anMargin > may be a numeric value or an array of two
numeric values. If it is a numeric value, then this will be the
value of the left margin. If it is an array, then the first
element is the TOP margin and the second element is the LEFT
margin. The margins may be negative and/or decimal values.
TITLE < cTitle > is the title to display in the title bar area of the
Preview window and the Printer Dialog window. This is also the
name of the print job that is sent to the spooler.
CANCELENABLE will display a dialog window during printing that
includes a CANCEL button to cancel the print job.
AUTOEJECT will cause an automatic page eject whenever an
attempt is made to print past the last print row defined by the
SIZE < nRows >, < nCols > command or whenever an attempt is
made to
print to a row that is higher on the page than the last printed
row. This feature is provided for compatability with existing
Clipper reports.
DIALOGSTYLE < nDialogStyle > allows users of eXPress++ 1.3 and earlier
versions to display the same style dialog in their 1.5 applications
as was displayed in 1.3. Xbase++ 1.5 introduced a new
XbpPrinterDialog() class which was incorporated in eXPress++ 1.5.
This new dialog is created by the print driver whereas the old
dialog was created by eXPress++ and also included a FONT button for
selecting a print font. DIALOGSTYLE DCPRINT_DIALOG_EXPRESS will
display the 1.3 style printer dialog.
GRID will print a cross-hatch grid on the paper or preview
window at each text-based row and column defined by the SIZE
clause. The grid will also include row/column numbers at the
top and left border. The GRID option will aid in the designing
of reports.
PREVIEW will cause the printed output to be sent to the
display rather than the print device. The PREVIEW arguments
causes the methods of the DC_PRINTER() class to write to an
XbpDialog() GUI dialog screen rather than to an XbpPrinter()
object.
ZOOMFACTOR < nZoomFactor > is a numeric value to use as the
base for the initial zoom value of the Preview window. This
clause is used only in PREVIEW mode. The default is 1.0. A
higher number will cause the text and graphics in the screen
to be larger. The minimum value is .25. Numeric values from
0.25 to 4.00 are recommended. < nZoomIncr > is a numeric value
specifying the zoom resolution. A smaller number will cause
each click of the ZOOM+/ZOOM- key to have a smaller change.
The default value is .25.
SCROLLFACTOR < nScrollFactor > is used to set the sensitivity of
the scroll bars in the PREVIEW window. The default is 40.
PPOSITION < nStartCol >, < nStartRow > are the starting
coordinates
of the PREVIEW window (in pixels) relative to the left, bottom
of the screen. The default is 0,0.
PSIZE < nWidth >, < nHeight > is the width and height of the
PREVIEW window (in pixels). If no size is given then the
window will be automatically sized to fit the screen.
NOSTOP will supress the automatic stop of program execution each
time a DCPRINT EJECT command or oPrinter:eject() method is
encountered in the program. The control will then be given to
the event loop of the PREVIEW window. If the NOSTOP clause is
used then the control will only be given to the PREVIEW window
when the command DCPRINT OFF or the function DC_PrinterOff() are
encountered in the program.
HIDE will hide the previewer window until the command DCPRINT OFF
or the function DC_PrinterOff() are encountered in the program.
If the HIDE clause is not used, each page will be visible in
the preview window as they are being created.
NOPRINTBUTTON will remove the 'Print' button from the preview
window, thereby disabling the ability to print while previewing.
BUSYMESSAGE < cBusyMsg > is a message to display while each
screen is being created. Use this clause if your application
takes a long time to create a screen.
Description:
DCPRINT OPTIONS will create an option array to be used later
with the DCPRINT ON command or DC_PrintFile() function.
Examples:
#include "dcprint.ch"
FUNCTION XTest()
LOCAL aOptions
DCPRINT OPTIONS ;
TO aOptions ;
NOPRINTBUTTON ;
PSIZE AppDeskTop():currentSize()[1], ;
AppDeskTop():currentSize()[2] ;
HIDE ;
NOSTOP
DC_PrintFile('README.TXT',.t.,nil,aOptions)
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ON
DC_PrintFile()
DCPRINT ORIENTATION
Change the orientation within a print job
Syntax:
DCPRINT ORIENTATION < nOrientation >
Description:
DCPRINT ORIENTATION instructs the printer whether to print horizontally
or vertically.
#define constants for <þnOrientationþ>
Constant Description
XBPPRN_ORIENT_PORTRAIT Prints vertically (portrait)
XBPPRN_ORIENT_LANDSCAPE Prints horizontally (landscape)
This command may be used only after a DCPRINT ENDPAGE and before
a DCPRINT STARTPAGE.
Examples:
FUNCTION XTest()
nOrientation := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
DCPRINT ON
DCPRINT SIZE 60,80
DCPRINT FONT cFont
FOR nPage := 1 TO 4
@ 2, 10 DCPRINT SAY 'This is Page ' + Alltrim(Str(nPage)) + ;
IIF(nOrientation=1,' (PORTRAIT - Bin 1)',' (LANDSCAPE - Bin 2)' )
FOR i := 5 to nRows - IIF( nOrientation=1,10,20)
cString := ''
FOR j := 10 TO IIF(nOrientation=1,70,120)
cString += Alltrim(Str(j%10))
NEXT
@ i, 10 DCPRINT SAY cString
NEXT
DCPRINT ENDPAGE
IF nPage % 2 == 0
nOrientation := 1
nPaperBin := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
ELSE
nOrientation := 2
nPaperBin := 2
nRows := 60
nCols := 130
cFont := '9.Courier New'
ENDIF
DCPRINT ORIENTATION nOrientation
DCPRINT PAPERBIN nPaperBin
DCPRINT SIZE nRows, nCols
DCPRINT FONT cFont
DCPRINT STARTPAGE
NEXT
DCPRINT OFF
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ENDPAGE
DCPRINT PAPERBIN
Change the paper bin within a print job
Syntax:
DCPRINT PAPERBIN < nBin >
Description:
DCPRINT PAPERBIN instructs the printer which paper bin to use for
a print job.
<þnBinþ>
A #define constant from XBPDEV.CH must be used for <þnBinþ> . Valid
constants have the prefix XBPPRN_PAPERBIN_. Alternatively, a value
obtained via the oPrinter:oDC:paperBins() method can be used.
This command may be used only after a DCPRINT ENDPAGE and before
a DCPRINT STARTPAGE.
Examples:
FUNCTION XTest()
nOrientation := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
DCPRINT ON
DCPRINT SIZE 60,80
DCPRINT FONT cFont
FOR nPage := 1 TO 4
@ 2, 10 DCPRINT SAY 'This is Page ' + Alltrim(Str(nPage)) + ;
IIF(nOrientation=1,' (PORTRAIT - Bin 1)',' (LANDSCAPE - Bin 2)' )
FOR i := 5 to nRows - IIF( nOrientation=1,10,20)
cString := ''
FOR j := 10 TO IIF(nOrientation=1,70,120)
cString += Alltrim(Str(j%10))
NEXT
@ i, 10 DCPRINT SAY cString
NEXT
DCPRINT ENDPAGE
IF nPage % 2 == 0
nOrientation := 1
nPaperBin := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
ELSE
nOrientation := 2
nPaperBin := 2
nRows := 60
nCols := 130
cFont := '9.Courier New'
ENDIF
DCPRINT ORIENTATION nOrientation
DCPRINT PAPERBIN nPaperBin
DCPRINT SIZE nRows, nCols
DCPRINT FONT cFont
DCPRINT STARTPAGE
NEXT
DCPRINT OFF
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ENDPAGE
DCPRINT SIZE
Set the size of the print page in rows and columns
Syntax:
DCPRINT SIZE < nRows >, < nCols > ;
WHEN < bWhen >
Arguments:
< nRows >, < nCols > is the number of print rows and
columns. The default is 66 rows, 80 columns.
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 SIZE is used to change the number of print rows and
columns (the text-based grid size). This command functions the
same as the SIZE clause of the DCPRINT ON command except it
allows for changing of the print grid within a single document,
to allow for such printing variations as a different grid for
the header than for the body of the document.
Examples:
FUNCTION Xtest()
LOCAL oPrinter, i, j, x
DCPRINT ON TO oPrinter PREVIEW
FOR x := 1 TO 5
DCPRINT SIZE 40, 80
DCPRINT FONT '12.Courier New'
@ 1, 20 DCPRINT SAY 'This is Header Line 1 (Row 1, Col 20)'
@ 2, 20 DCPRINT SAY 'This is Header Line 2 (Row 2, Col 20)'
@ 3, 20 DCPRINT SAY 'This is Header Line 3 (Row 3, Col 20)'
@ 4, 20 DCPRINT SAY 'This is Header Line 4 (Row 4, Col 20)'
DCPRINT SIZE 66, 132
DCPRINT FONT '6.Courier New'
FOR i := 10 TO 40
FOR j := 1 TO 120 STEP 15
@ i,j DCPRINT SAY 'Row ' + Str(i,2) + ' Col ' + Alltrim(Str(j,3))
NEXT
NEXT
DCPRINT EJECT
NEXT
DCPRINT OFF
RETURN nil
Source/Library:
DCPRINT.CH
DCPRINT STARTPAGE
Start a new Page in a Print Job
Syntax:
DCPRINT STARTPAGE
Description:
DCPRINT STARTPAGE is used to start a new page within a print job.
This command is used after a DCPRINT ENDPAGE command.
After an application uses DCPRINT ENDPAGE to end a page, certain
attributes of the print job can be changed before a new page is
begun using DCPRINT STARTPAGE . See DCPRINT ENDPAGE for more details.
Examples:
FUNCTION XTest()
nOrientation := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
DCPRINT ON
DCPRINT SIZE 60,80
DCPRINT FONT cFont
FOR nPage := 1 TO 4
@ 2, 10 DCPRINT SAY 'This is Page ' + Alltrim(Str(nPage)) + ;
IIF(nOrientation=1,' (PORTRAIT - Bin 1)',' (LANDSCAPE - Bin 2)' )
FOR i := 5 to nRows - IIF( nOrientation=1,10,20)
cString := ''
FOR j := 10 TO IIF(nOrientation=1,70,120)
cString += Alltrim(Str(j%10))
NEXT
@ i, 10 DCPRINT SAY cString
NEXT
DCPRINT ENDPAGE
IF nPage % 2 == 0
nOrientation := 1
nPaperBin := 1
nRows := 60
nCols := 80
cFont := '12.Courier New'
ELSE
nOrientation := 2
nPaperBin := 2
nRows := 60
nCols := 130
cFont := '9.Courier New'
ENDIF
DCPRINT ORIENTATION nOrientation
DCPRINT PAPERBIN nPaperBin
DCPRINT SIZE nRows, nCols
DCPRINT FONT cFont
DCPRINT STARTPAGE
NEXT
DCPRINT OFF
RETURN nil
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ENDPAGE
DCQDEBUG
Send debug information to a debugging window
Syntax:
DCQDEBUG < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCQDEBUG is used to send data to a debugging window when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
The debugging window is an object of the XbpMle() class
therefore only the last 32000 characters of debug information
will be displayed.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCQDEBUG Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
dc_debugqout()
dc_debugqoutappendblock()
dc_qout()
DCQOUT
DCQDEBUGOFF
Send debug information to a debugging window
Syntax:
DCQDEBUGOFF < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCQDEBUGOFF is used to send data to a debugging window when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
DCQDEBUGOFF is similar to DCQDEBUG except it will not
echo the expression.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCQDEBUGOFF Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
dc_debugqout()
dc_debugqoutappendblock()
dc_qout()
DCQOUT
DCQDEBUGOFFQUIET
Send debug information to a debugging window
Syntax:
DCQDEBUGOFFQUIET < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCQDEBUGOFFQUIET is used to send data to a debugging window when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
DCQDEBUGOFFQUIET is similar to DCQDEBUG except it will not
echo the expression or the callstack information.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCQDEBUGOFFQUIET Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
DCQDEBUG
DCQDEBUGQUIET
Send debug information to a debugging window
Syntax:
DCQDEBUGQUIET < xExpr1 > [ ; < xExprN > ]
Arguments:
< xExpr1 > through < xExprN > is any expression.
Description:
DCQDEBUGQUIET is used to send data to a debugging window when
debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed on a new line in the window.
DCQDEBUGQUIET is similar to DCQDEBUG except it will not
echo the callstack information.
Notes:
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCQDEBUGQUIET Alias(), RecCount()
Source/Library:
DCDIALOG.CH
See Also:
DCQDEBUG
DCQOUT
Send data to a debugging window
Syntax:
DCQOUT | DCQQOUT [ xText ]
Arguments:
< xText > is any variable type.
Description:
DCQOUT and DCQQOUT are used to send data to a debugging window
window when debugging GUI applications.
Examples:
#include "dcapp.ch"
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oStatic, oAppEdit
USE COLLECT NEW SHARED
DCQOUT Alias(), RecCount()
@ 0,0 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,7 ;
GROUP oStatic
DCAPPEDIT INTO oAppEdit STYLE 3D POSITION 0,0 PARENT oStatic
DCQOUT COLLECT->descrip
DCAPPFIELD COLLECT->descrip INTO oAppEdit ;
CAPTION 'Description' ;
COLOR GRA_CLR_BLUE
DCQQOUT COLLECT->type
DCAPPFIELD COLLECT->type INTO oAppEdit ;
CAPTION 'Type' ;
COLOR GRA_CLR_BLUE
DCREAD GUI ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
See Also:
dc_qoutwindow()
dc_qout()
DCQOUT WINDOW
DCQDEBUG
DCQOUT WINDOW
Establish or Create a CRT window for debugging GUI apps
Syntax:
DCQOUT WINDOW [ oCrt ] ;
[ EVAL < bEval > ] ;
[ APPWINDOW ] )
Arguments:
< oCrt > is a pointer to an existing XbpCrt() object to post
as the object for DCQOUT commands. If no argument is passed
then a new XbpCrt() object will be created.
EVAL < bEval > is a code block to evaluate after the XbpCrt() window
is created. The Crt object is passed to the code block.
APPWINDOW set the Crt object as the application window with
SetAppWindow().
Description:
DCQOUT WINDOW is used to Create a CRT window for debugging
GUI applications. The CRT window is used with the DC_Qout()
function and DCQOUT command to echo any information. Using the
? command or Qout() function will cause an error if SetAppWindow()
is not set to an XbpCrt() object. This makes it very difficult
to use ? or Qout() inside GUI applications where SetAppWindow()
is pointing to a GUI object like an XbpDialog().
Examples:
#include "dcapp.ch"
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oStatic, oAppEdit
USE COLLECT NEW SHARED
DCQOUT WINDOW
DCQOUT Alias(), RecCount()
@ 0,0 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 78,7 ;
GROUP oStatic
DCAPPEDIT INTO oAppEdit STYLE 3D POSITION 0,0 PARENT oStatic
DCQOUT COLLECT->descrip
DCAPPFIELD COLLECT->descrip INTO oAppEdit ;
CAPTION 'Description' ;
COLOR GRA_CLR_BLUE
DCQQOUT COLLECT->type
DCAPPFIELD COLLECT->type INTO oAppEdit ;
CAPTION 'Type' ;
COLOR GRA_CLR_BLUE
DCREAD GUI ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
See Also:
dc_qoutwindow()
dc_qout()
DCREAD GUI
Read the DIALOG GetList with the GUI reader
Syntax:
DCREAD GUI ;
[TO < lVar >] ;
[TITLE < cTitle >] ;
[OPTIONS < aOptions >] ;
[BUTTONS < nButtons > | ADDBUTTONS ] ;
[HANDLERBLOCK < bEventHandler >] [HANDLER < HandlerFunc >]
;
[REFERENCE < xRef >] ;
[PARENT @< oDlg >] ;
[OWNER < oOwner >] ;
[APPWINDOW < oAppWindow >] ;
[EXIT] ;
[FIT] ;
[MODAL] ;
[EVAL < bEval >] ;
[SAVE] ;
[ENTEREXIT] ;
[NOENTEREXIT] ;
[ARRAYTRANSLATE] ;
[SETFOCUS < xObject >] ;
[GROUP < ancGroup >] ;
[TIMEOUT < anTimeOut > [NOKEYPRESS]] ;
[NODESTROY] ;
[CLEAREVENTS] ;
[SETAPPWINDOW] ;
[POSTEVENT < nEvent >] ;
[MULTILISTS] ;
[NOAUTORESTORE | NORESTORE] ;
[AUTORESTORE | RESTORE]
Arguments:
TO < lVar > is a memory variable to store the result of the
dialog when it is exited. If it was exited with the OK button,
or DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList) then < lVar > will be set
to .TRUE. If it was exited with the CANCEL button or ESCAPE or
DC_ReadGuiEvent(DCGUI_EXIT_ABORT,GetList) then < lVar > will be set
to .FALSE.
TITLE < cTitle > is the title to display on the top of the dialog
box.
OPTIONS < aOptions > is an array of options for the GUI dialogue
box. This is ignored if painting text-based GETS. See
DCDIALOG.CH for a description of this array.
BUTTONS < nButtons > will add extra buttons to the bottom area
of the main dialog window. < nButtons > is a numeric value
designating the buttons to add based on the below table.
DCDIALOG.CH contains DCGUI_BUTTON_* constant definitions for
the available buttons. These values are summed to enable multiple
buttons.
Numeric Value Description
------------------ ---------------------------------------------
DCGUI_BUTTON_OK Will add a button with the caption OK.
Selecting this button will exit the GUI reader
and save all changes to their associated
memory variables.
DCGUI_BUTTON_CANCEL Will add a button with the caption CANCEL.
Selecting this button will exit the GUI reader
and restore all memory variables to their
original value.
DCGUI_BUTTON_YES Will add a button with the caption YES.
Selecting this button will exit the GUI reader
and save all changes to their associated
memory variables.
DCGUI_BUTTON_NO Will add a button with the caption NOL.
Selecting this button will exit the GUI reader
and restore all memory variables to their
original value.
DCGUI_BUTTON_EXIT Same as DCGUI_BUTTON_OK except the caption is
labeled as EXIT.
Optionally, the ADDBUTTONS clause may be used in place of
BUTTONS < nButtons >. This will paint both the OK and CANCEL
buttons.
NOTE: The added buttons may be aligned left, center or right
by using the BUTTONALIGN clause of the DCGETOPTIONS command.
HANDLERBLOCK < bEventHandler > is a code block which points
to a custom event handler. DC_ReadGui() 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 that
was passed to DC_ReadGets().
8. lOk - A logical value that is .TRUE. if the OK button
was clicked and .FALSE. if CANCEL was clicked.
The Function should look like this:
STATIC FUNCTION MyHandler ( nEvent, mp1, mp2, oXbp, oDlg,
aGetlist, aRef, lOk )
/* 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 DC_ReadGui() reader event loop
DCGUI_MOVE_UP Set focus to previous object in Get List
DCGUI_MOVE_DOWN Set focus to next object in Get List
DCGUI_MOVE_TOP Set focus to first object in Get List
DCGUI_MOVE_BOTTOM Set focus to last object in Get List
DCGUI_MOVE_UP_PAR Set focus to previous object in Get List that
has the same parent as the current object.
DCGUI_MOVE_DOWN_PAR Set focus to next object in Get List that
has the same parent as the current object.
DCGUI_MOVE_TOP_PAR Set focus to first object in Get List that
has the same parent as the current object.
DCGUI_MOVE_BOTTOM_PAR Set focus to last object in Get List that
has the same parent as the current object.
DCGUI_NOHOTKEY Don't activate hot key associated with
the current object.
As an alternative the clause HANDLER < HandlerFunc > may be used,
where
< HandlerFunc > is the name of the function. The code block will be
created from the function name.
REFERENCE < aRef > is any array or variable to pass to the handler
function. 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. See example 2.
PARENT @< oDialog > is a reference to a parent dialog or to a
memory variable to store a reference to the dialog that will be
created. If < oDialog > has already been created as an Xbase Parts
class object, it will become the parent for all the objects in
the GetList. If < oDialog > is passed by reference as a NIL, the
dialog object created by the reader will be stored in this
memory variable. NOTE: Xbase++ does not allow < oDialog > to be
a PRIVATE or a PUBLIC variable if it is passed by reference.
The parent of the dialog that will be created is referenced by
APPWINDOW < oAppWindow >. If no < oAppWindow > argument is
used
then the parent of the created dialog will be AppDeskTop().
OWNER < oOwner > is the owner of the dialog window.
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 of the DCGETOPTIONS command. The default is 10
pixels.
CAUTION: Do not use GRASTRING clause of @..DCSAY or DCGRA*
commands with the FIT clause of DCREAD GUI or the
AUTOSIZE 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.
EXIT will exit the reader after the objects are created and will
not enter the reader's event loop. It is the responsibility of
the programmer to insure that events are managed and the dialog
is destroyed. This feature is used to add more objects to an
existing dialog, or to create a dialog that will be managed by
an external event loop.
APPWINDOW < oAppWindow > is the parent object for the main dialog.
If this option is not used then the AppDeskTop() will be used
as the application window.
MODAL will set this dialog modal state to MODAL -
APPLICATION WIDE. If this option is not used, then the dialog
with be NON-MODAL.
NOTE: For MODAL windows to function properly, the calling window
must be the SetAppWindow(). This can be accomplished quite
easily by using the EVAL clause of the DCREAD GUI command
like so:
DCREAD GUI ;
FIT ;
ADDBUTTONS ;
MODAL ;
EVAL {|o|SetAppWindow(o)}
EVAL < bEval > is an optional code block to evaluate after all the
objects are created and just before entering the event loop.
Three parameters are passed to the code block: (1) the main dialog
object, (2) the Getlist array, (3) the DC_GetList() object.
SAVE will save the GetList array after returning from the text
or GUI reader. If the SAVE clause is not used, the GetList
array will be re-initialized to an empty array.
ENTEREXIT will exit the dialog if the ENTER key is pressed. The
exact behavior is determined by the DC_EnterExitMode() function.
The default behavior is to exit the dialog when the ENTER keys is
pressed in the "last GET". If this option is not used, then pressing
the ENTER key in the last GET will cause the first GET to receive
focus provided that SET WRAP is ON, otherwise pressing ENTER in the
last GET will have no affect.
The ENTEREXIT clause of DCGETOPTIONS will automatically enable
ENTEREXIT for all dialog windows when use in DC_GetOptDefault().
To disable it for a specific dialog window use the NOENTEREXIT clause.
ARRAYTRANSLATE will translate the HEIGHT, WIDTH, START COLUMN and
START ROW elements in the GETLIST array to pixel coordinates and
write these coordinates back to the original GETLIST array. It
will also write the translated Dialog window coordinates to the
GETOPTIONS array and set the TRANSLATE flag in the GETOPTIONS
array to .FALSE.
SETFOCUS < xObject > is the object that receives focus when entering
the event handler. < xObject > may be a type "O" (object), a type
"N" (numeric) or a type "C" character. If < xObject > is a type "O"
the pass-by-reference operator should be used like so: @< xObject >.
If < xObject > is a type "N" then the numeric value must be a
number from 1 to the length of the GetList. This is an ordinal
pointer to the GetList item. If < xObject > is a type "C" then the
character string value must be a value equivalent to the ID of
the item in the GetList which is to receive focus.
GROUP < ancGroup > is the GetList group to create. Each item in
the GetList may be assigned a group name or number via the
GROUP < ancGroup > clause. If a numeric or character value is
passed then only the items in the GetList which match < ancGroup >
will be created. < ancGroup > may consist of an array of numeric
values or character values so that more than one group may be
created. If < ancGroup > is a nil then all items in the GetList
will be refreshed.
TIMEOUT < anTimeOut > is used to exit the dialog after a specified
number of seconds. < anTimeOut > may be a numeric value equivalent
to the number of seconds or an array of two elements as defined
below:
ELEMENT TYPE DESCRIPTION
------- ---- ------------------------------------------------
1 N The timeout in seconds
2 B A code block to execute after the timeout. The
code block must return a logical value. If a .T.
is returned the exit will occur, otherwise the
timeout will be reset.
The NOKEYPRESS sub-option will cause the dialog to imeout only if
there is no key pressed within the timeout period.
NODESTROY will preserve the dialog window that is created when
a NIL PARENT clause is used. By default, this window is
automatically destroyed when exiting the read.
CLEAREVENTS will clear all events from the event queue before
starting up the event loop. Many times there are many extra
xbeP_Paint events created by DC_ReadGui(), especially when
creating browse screens to insure that all browse objects are
stablized. If you see a flicker in the screen at startup it
is recommended that you use the CLEAREVENTS clause.
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.
POSTEVENT < nEvent > will post an event to the event queue
before starting up the event loop.
MULTILISTS changes the behavior of the event loop slightly so
one event loop can work with multiple GetLists. This clause
is needed only if the application will be creating new dialogs
or new objects with the DCREAD GUI EXIT command and returning
control to the main event loop.
NOAUTORESTORE or NORESTORE will override DC_AutoRestoreWindow()
default setting and insure that the window coordinates and size
are never saved and restored.
AUTORESTORE or RESTORE will override DC_AutoRestoreWindow()
default setting and insure that the window coordinates and size
are always saved and restored.
Description:
DCREAD GUI is used to process the Getlist array using the GUI
Dialog reader.
This is the equivalent to DC_ReadGui().
It uses the GetList array of dialogue definitions created by the
DC* commands in DCDIALOG.CH, DCDIR.CH, DCAPP.CH and
DCTREE.CH.
An array of DIALOG definitions must exist when using this command
and it must have the variable name GETLIST.
Examples:
-- Example 1 --
/*
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. The example shows
how to use DCREAD GUI to create a master dialog and
a sub dialog.
*/
#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 ;
WINDOWHEIGHT 360 ;
WINDOWWIDTH 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
--- Example 2 ---
This example shows how to use the DCGUI_NOHOTKEY return value
in a custom handler. Return this value from any custom event
handler to disable the hotkey processing of the event. This was
added to solve a problem with a customer who used ACCELKEY
parameters of xbeK_CTRL_M (ENTER) and xbeK_CTRL_I (TAB) as hot
keys but wanted the pressing of ENTER and TAB to behave normally
and not activate the hotkey.
aButtons := { xbeK_CTRL_M, {||Ctrl_M_Key()}, ;
xbeK_CTRL_I, {||Ctrl_I_Key()} }
@ 1,0 DCPUSHBUTTON .. ACTION aButtons[1,2] ACCELKEY aButtons[1,1]
@ 2,0 DCPUSHBUTTON .. ACTION aButtons[2,2] ACCELKEY aButtons[2,1]
bHandler := {|a,b,c,d,e,f,g,h|My_EventHandler(a,b,c,d,e,f,@g,h)}
DCREAD GUI HANDLERBLOCK bHandler
STATIC FUNCTION ;
My_EventHandler( nEvent, mp1, mp2, oXbp, oDlg, GetList, aButtons )
LOCAL nButton, nKeyState := AppKeyState( xbeK_CTRL )
IF nEvent == xbeP_Keyboard
nButton := AScan( aButtons, {|a|a[1]==mp1} )
IF nButton > 0
IF nKeyState == 1 // Ctrl key down
Eval( aButtons[nButton,2], nil, nil, oXbp )
RETURN DCGUI_IGNORE
ELSE // Ctrl key up
RETURN DCGUI_NOHOTKEY
ENDIF
ENDIF
ENDIF
RETURN DCGUI_NONE
Source/Library:
DCDIALOG.CH
See Also:
dc_readgui()
DCGETOPTIONS
dc_getrefresh()
dc_enterexitmode()
DCREAD HTML
Read the DIALOG GetList with the HTML reader
Syntax:
DCREAD HTML ;
[ TO < cHtml > ]
;
[ TITLE < cTitle > ]
;
[ PARENT < oParent > ]
;
[ ROOTDIR < cRootDir > ]
;
[ OBJECT < oHtml > ]
;
[ MESSAGEINTO < cMessageInto > [TARGET < cTarget >] ]
;
Arguments:
TO < cHtml > is a memory variable to store the HTML source
code that is a result of evaluating the GetList.
TITLE < cTitle > is the title to display on the top of the
browser window.
PARENT < oParent > is any parent DC_Html*() object previously
created by DCREAD HTML.
ROOTDIR < cRootDir > is the root directory where other HTML
documents or images reference in the HTML code exist.
OBJECT < oHtmlMain > is the name of a variable to store a
a pointer to the DC_HtmlMain() object created by the HTML
reader. This object can be stored to a static variable or
state management cargo system to maintain the state of the
application.
MESSAGEINTO < cMessageInto > is the name of a variable that
will be passed in a < a href > tag with the message text of
any object that uses the message clause. This is activated
when the user clicks on the underlined screen prompt.
TARGET < cTarget > is the name of the Web Browser frame to
invoke the message call. If this argument is not used,
then a new browser window will be displayed.
variable.
Description:
DCREAD HTML is used to process the Getlist array using the GUI
HTML reader.
This is the equivalent to DC_ReadHtml().
It uses the GetList array of dialogue definitions created by the
DC* commands in DCDIALOG.CH and DCHTML.CH.
An array of DIALOG definitions must exist when using this command
and it must have the variable name GETLIST.
Source/Library:
DCHTML.CH
See Also:
dc_readhtml()
DCREAD TEXT
Read the DIALOG GetList
Syntax:
DCREAD TEXT ;
[TITLE < cTitle >] ;
[TO < lVar >] ;
[SAVE]
Arguments:
The GetList is passed to DC_READMODAL() - the text reader.
TO < lVar > is a memory variable to store the result of the
dialog when it is exited. If it was exited with the OK button,
or DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList) then < lVar > will be set
to .TRUE. If it was exited with the CANCEL button or ESCAPE or
DC_ReadGuiEvent(DCGUI_EXIT_ABORT,GetList) then < lVar > will be set
to .FALSE.
TITLE < cTitle > is the title to display on the top of the dialog
box.
SAVE will save the GetList array and not reinitialize it
to an empty array.
Description:
DCREAD TEST is used to process the Getlist array using the
TEXT Dialog reader.
This is the equivalent to DC_ReadModal().
It uses the GetList array of dialogue objects created by the
DC* commands in DCDIALOG.CH.
An array of DIALOG definitions must exist when using this command
and it must have the variable name GETLIST.
Source/Library:
DCDIALOG.CH
See Also:
dc_readgets()
DCSETCOLOR
Set the COLOR for successive DC* commands
Syntax:
DCSETCOLOR [TO] [< bncColorFG >] [,< ncColorBG >]
Arguments:
< bncColorFG >, < ncColorBG > 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 < bncColorFG > is a code block is must return a 2-element array
containing a foreground and background color.
If the < bncColorFG > clause is not used, then the default color
setting for successive commands will be reset.
Description:
The command DCSETCOLOR creates a new COLOR definition and
adds the definition to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. DCSETCOLOR is used to set the default COLOR to
be used for all successive DC* commands when the COLOR clause
is not used.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
DCSETCOLOR TO GRA_CLR_WHITE, GRA_CLR_BLUE
@ 1,1 DCSAY 'This is white on Blue'
@ 2,1 DCSAY 'This is also white on Blue'
DCSETCOLOR TO GRA_CLR_RED, GRA_CLR_YELLOW
@ 3,1 DCSAY 'This is Red on Yellow'
DCSETCOLOR TO
@ 4,1 DCSAY 'This is normal color (Black on Background)'
DCREAD GUI FIT ADDBUTTONS TITLE 'Example of DCSETCOLOR command'
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DCSETGROUP
DCSETFONT
DCSETSAYOPTION
DCSETFONT
Set the FONT for successive DC* commands
Syntax:
DCSETFONT [TO] [< bocFont >]
Arguments:
< bocFont > is a character string defining an optional
font for successive commands. 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().
If the < bocFont > clause is not used, then the default font
setting for successive commands will be reset.
Description:
The command DCSETFONT creates a new FONT definition and
adds the definition to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. DCSETFONT is used to set the default FONT to
be used for all successive DC* commands when the FONT clause
is not used.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
DCSETFONT TO '10.Lucida Console'
@ 1,1 DCSAY 'This is Lucida Console, 10 point'
@ 2,1 DCSAY 'This is also Lucida Console, 10 point'
DCSETFONT TO '12.Arial Bold'
@ 3,1 DCSAY 'This is Arial Bold, 12 point'
DCSETFONT TO
@ 4,1 DCSAY 'This is normal font (8.Arial)'
DCREAD GUI FIT ADDBUTTONS TITLE 'Example of DCSETFONT command'
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DCSETCOLOR
DCSETGROUP
DCSETSAYOPTION
DCSETGROUP
Set the GROUP name for successive DC* commands
Syntax:
DCSETGROUP [TO] [< cGroup >]
Arguments:
TO < cGroup > is the name of the group.
Description:
The command DCSETGROUP creates a new GROUP definition and
adds the definition to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. DCSETGROUP is used to set the default GROUP name to
be used for all successive DC* commands when the GROUP clause
is not used.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL oTabPage1, oTabPage2, GetList := {}
@ 1,1 DCTABPAGE oTabPage1 CAPTION 'Page 1' SIZE 50,10
DCSETPARENT TO oTabPage1
DCSETGROUP TO 'PAGE1'
@ 2,2 DCSAY 'This goes on Tab Page ONE'
@ 4,2 DCSAY 'This goes on Tab Page ONE too!'
@ 6,2 DCSAY 'This goes on Tab Page ONE too!'
DCSETPARENT TO
DCSETGROUP TO
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Page 2' RELATIVE oTabPage1
DCSETPARENT TO oTabPage2
DCSETGROUP TO 'PAGE2'
@ 2,2 DCSAY 'This goes on Tab Page TWO'
@ 4,2 DCSAY 'This goes on Tab Page TWO too!'
@ 6,2 DCSAY 'This goes on Tab Page TWO too!'
DCREAD GUI FIT ADDBUTTONS TITLE 'Example of DCSETGROUP command'
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DC_GetRefresh()
DCSETPARENT
Set the Parent object for successive DC* commands
Syntax:
DCSETPARENT [TO] [< oParent >]
Arguments:
TO < oParent > is the variable that points to the object to set as
the default parent. If this parameter is not used, then the
parent is set to the main dialog window.
Description:
The command DCSETPARENT creates a new Parent object definition
adds the definition to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. DCSETPARENT is used to set the default object to be
used for all successive DC* commands when the PARENT clause is
not used.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL oTabPage1, oTabPage2, GetList := {}
@ 1,1 DCTABPAGE oTabPage1 CAPTION 'Page 1' SIZE 50,10
DCSETPARENT TO oTabPage1
@ 2,2 DCSAY 'This goes on Tab Page ONE'
@ 4,2 DCSAY 'This goes on Tab Page ONE too!'
@ 6,2 DCSAY 'This goes on Tab Page ONE too!'
DCSETPARENT TO
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Page 2' RELATIVE oTabPage1
DCSETPARENT TO oTabPage2
@ 2,2 DCSAY 'This goes on Tab Page TWO'
@ 4,2 DCSAY 'This goes on Tab Page TWO too!'
@ 6,2 DCSAY 'This goes on Tab Page TWO too!'
DCREAD GUI FIT ADDBUTTONS TITLE 'Example of DCSETPARENT command'
RETURN nil
Source/Library:
DCDIALOG.CH
DCSETRESIZE
Set the RESIZE method for successive DC* commands
Syntax:
DCSETRESIZE TO [< aResize >]
Arguments:
< aResize > is an an array of two elements:
The first element is an optional code block that must return
two numeric values which will be the new X and Y position of
the object after its parent has been resized. The code block
is passed two numeric arguments equivalent to the X delta and
the Y delta of the parent after it has been resized. The second
element is an optional code block that must return two numeric
values which will be the new X and Y size of the object after
its parent has been resized. The code block is passed two
numeric arguments equivalent to the X delta and the Y delta of
the parent after it has been resized.
Examples:
DCSETRESIZE { {|x,y,o|{ o:currentPos()[1], o:currentPos()[2] + y} },;
{|x,y,o|{ o:currentSize()[1] + x, o:currentSize()[2] + y} } }
DCSETRESIZE DCGUI_RESIZE_AUTORESIZE
DCSETRESIZE DCGUI_RESIZE_REPOSONLY_Y
Note: DCDIALOG.CH contains DCGUI_RESIZE_* constants for commonly used
resizing rules.
If the < aResize > clause is not used, then the default resize
method for successive commands will be reset to the value
established by DCGETOPTIONS..RESIZEDEFAULT.
Description:
The command DCSETRESIZE creates a new RESIZE definition and
adds the definition to the array named GETLIST which is later
processed by the DC_READGUI() function or by the DCREAD GUI
command. DCSETRESIZE is used to set the default RESIZE method to
be used for all successive DC* commands when the RESIZE clause
is not used.
This command creates a resize callback to use DC_Resize()
as the function for resizing and repositioning child objects
after the parent window has been resized. Most DC* commands
include a RESIZE clause to establish the rules for how the
object associated with that command will be resized and/or
repositioned.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList[0], GetOptions
DCSETRESIZE TO DCGUI_RESIZE_REPOSONLY_Y
@ 1,1 DCSAY 'This will move up when the window is resized vertically'
DCSETRESIZE TO DCGUI_RESIZE_REPOSONLY
@ 3,1 DCSAY 'This will move up and to the right when window is enlarged'
DCSETRESIZE TO
@ 4,1 DCMULTILINE cText SIZE 40,10 // resize both directions
DCGETOPTIONS RESIZE RESIZEDEFAULT DCGUI_RESIZE_RESIZEONLY ;
SAYWIDTH 0
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Example of DCSETFONT command' ;
OPTIONS GetOptions
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DCGETOPTIONS
DCSETCOLOR
DCSETGROUP
DCSETSAYOPTION
DCSETFONT
DCSETSAYOPTION
Set the text alignment options for successive DCSAY commands
Syntax:
DCSETSAYOPTION [TO] [< nSayOpt >]
Arguments:
< nSayOpt > is a set of options that can be used to
align the text within the rectangular area of the SAY object.
Constants defined in the XBP.CH file are used for these options.
If combinations of alignment options are required, the sum of
the appropriate constants must be included in < nSayOpt >.
The below constants are defined in XBP.CH.
XBPSTATIC_TEXT_LEFT Text is left aligned
XBPSTATIC_TEXT_CENTER Text is horizontally centered
XBPSTATIC_TEXT_RIGHT Text is right aligned
XBPSTATIC_TEXT_TOP Text is displayed at top
XBPSTATIC_TEXT_VCENTER Text is vertically centered
XBPSTATIC_TEXT_BOTTOM Text is displayed at bottom
XBPSTATIC_TEXT_WORDBREAK Text is wrapped (multi-line)
If the < nSayOpt > clause is not used, then the default option
setting for successive commands will be reset.
Description:
The command DCSETSAYOPTION creates a new text alignment
definition and adds the definition to the array named GETLIST
which is later processed by the DC_READGUI() function or by
the DCREAD GUI command. DCSETSAYOPTION is used to set the
default text alignment option to be used for all successive
DCSAY and DCSAY..GET commands when the OPTION clause is not used.
Examples:
#include "dcdialog.ch"
PROCEDURE Xtest()
LOCAL GetList[0], GetOptions
DCSETSAYOPTION TO XBPSTATIC_TEXT_RIGHT
@ 1,1 DCSAY 'This is aligned right'
@ 2,1 DCSAY 'This is also aligned right'
DCSETSAYOPTION TO XBPSTATIC_TEXT_LEFT
@ 3,1 DCSAY 'This is aligned left'
DCSETSAYOPTION TO
@ 4,1 DCSAY 'This is normal alignment (left bottom)'
DCGETOPTIONS SAYWIDTH 400 SAYLEFTBOTTOM
DCREAD GUI FIT ADDBUTTONS ;
TITLE 'Example of DCSETSAYOPTION command' ;
OPTIONS GetOptions
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DCSETCOLOR
DCSETGROUP
DCSETFONT
DCSTATUSBAR
Create a Status Bar area on the perimiter of a dialog
Syntax:
DCSTATUSBAR < oObject > ;
[TYPE < nType >] ;
[ALIGN < nAlign >] ;
[HEIGHT < nHeight >] ;
[WIDTH < nWidth >] ;
[SPACING < nSpacing >] ;
[CARGO < xCargo >] ;
[PRESENTATION < aPres >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[HIDE < bHide >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
[COLOR < nFG >, < nBG >] ;
[ANCHOR < nAnchor >] ;
Arguments:
< oStatus > is the name of the variable to assign as a storage
place for this object.
TYPE < nType > is the type of status bar. Status Bars 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_RAISEDBOX.
ALIGN < nAlign > is a numeric constant defined in DCDIALOG.CH.
DCGUI_ALIGN_TOP - Attach statusbar to top of window
DCGUI_ALIGN_BOTTOM - Attach statusbar to bottom of window
DCGUI_ALIGN_RIGHT - Attach statusbar to right side of window
DCGUI_ALIGN_LEFT - Attach statusbar to left side of window
HEIGHT < nHeight > is the height (in pixels) of the status bar if
it has a top or bottom alignment. This clause is ignored if the
status bar has a left or right alignment.
WIDTH < nWidth > is the width (in pixels) of the status bar if
it has a left or right alignment. This clause is ignored if the
status bar has a top or bottom alignment.
SPACING < nSpacing > is the number of pixels between child objects
on the status bar. The default is 3 pixels. When a child object
is placed on a top or bottom status bar, only the < row > address
is significant because this determines the vertical location of
the object on the status bar. The < column > address is ignored
because the object is placed to the right of the previous child
object spaced by < nSpacing > pixels. When a child object is
placed on a left or right status bar, only the < column > address
is significant because this determines the horizontal location
of the object on the status bar. The < row > address is ignored
because the object is below the previous child object spaced by
< nSpacing > pixels.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Statusbar 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 Status Bar object is created. The object is passed
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 status bar will be hidden from view. If
the value returned is .FALSE. then the status bar will be displayed.
The object is passed as a parameter 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_GETOBJECT() 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().
COLOR < nFG >, < nBG > are foreground and background colors for
the
statusbar.
ANCHOR < nAnchor > is an option that is used to anchor child items
to the left rather than the right (default) side of the status bar.
Ex. ..ANCHOR DCGUI_ALIGN_LEFT
Description:
DCSTATUSBAR is used to create areas around the perimiter of the
a dialog window that are automatically resized when the dialog
is resized and are children of the main XbpDialog() object
rather than the drawingArea. This allows for toolbars, message
areas, progress bars, etc that are anchored to the main dialog
window and cannot be hidden by other child windows.
A single dialog may have multiple status bars. Each status bar
can be individually hidden from view which will shift all other
status bars to the top, bottom, etc. The status bar is a window
of the XbpStatic() type class and can be the parent of any other
type of DC* object.
Examples:
/*
This example demonstrates status bars of all four alignment
styles in an MDI application. The first status bar is used as
a toolbar with buttons to HIDE or SHOW the other status bars.
*/
FUNCTION XTest()
LOCAL GetList := {}, GetOptions, oMenuBar, oFileMenu, oToolBottom, ;
oDlg, oDrawingArea, oStatBottom, bReSize, oMsgBox, oProgress, ;
oMsgStatic, lTesting := .f., oInsStatic, oNumStatic, ;
oCapsStatic, oStatTop, oToolTop, oStatTop2, oToolTop2, ;
lHideStatus2 := .f., lHideStatus3 := .f., lHideStatus4 := .f., ;
lHideStatus5 := .f., oStatLeft1, oStatLeft2, oStatRight1, ;
oToolLeft1, oToolleft2, oToolRight1, oProgressStatic, ;
oStatRight2, oToolRight2, lHideStatus6 := .f., lHideStatus7 := .f.
DCMENUBAR oMenuBar
DCSUBMENU oFileMenu CAPTION 'File' ;
MESSAGE 'File Options' INTO oMsgBox ;
PARENT oMenuBar
DCMENUITEM CAPTION 'Browse' ;
MESSAGE 'Browse the Documentation Database' ;
INTO oMsgBox ;
PARENT oFileMenu ;
ACTION {|o|o:=Thread():new(), ;
o:start({||BrowseWindow(oDlg:drawingArea,oMsgBox,;
oProgress,@lTesting,GetList)}) }
DCMENUITEM CAPTION 'Exit' ;
MESSAGE 'Quit this Program' INTO oMsgBox ;
PARENT oFileMenu ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}
// Top Statusbar #1 with Toolbar
DCSTATUSBAR oStatTop HEIGHT 20 ALIGN DCGUI_ALIGN_TOP SPACING 0
@ 0,0 DCTOOLBAR oToolTop SIZE 400,20 BUTTONSIZE 100,20 ;
TYPE XBPSTATIC_TYPE_RAISEDBOX PARENT oStatTop PIXEL
DCADDBUTTON CAPTION 'Top ToolBar 2' ;
ACTION {||lHideStatus2 := !lHideStatus2, ;
DC_GetRefresh(GetList), ;
DC_StatusBarRePaint(oDlg)} ;
PARENT oToolTop PIXEL
DCADDBUTTON CAPTION 'Bottom StatusBar' ;
ACTION {||lHideStatus3 := !lHideStatus3, ;
DC_GetRefresh(GetList), ;
DC_StatusBarRePaint(oDlg)} ;
PARENT oToolTop PIXEL
DCADDBUTTON CAPTION 'Left ToolBar #1' ;
ACTION {||lHideStatus4 := !lHideStatus4, ;
DC_GetRefresh(GetList), ;
DC_StatusBarRePaint(oDlg)} ;
PARENT oToolTop PIXEL
DCADDBUTTON CAPTION 'Left ToolBar #2' ;
ACTION {||lHideStatus5 := !lHideStatus5, ;
DC_GetRefresh(GetList), ;
DC_StatusBarRePaint(oDlg)} ;
PARENT oToolTop PIXEL
DCADDBUTTON CAPTION 'Right ToolBar #1' ;
ACTION {||lHideStatus6 := !lHideStatus6, ;
DC_GetRefresh(GetList), ;
DC_StatusBarRePaint(oDlg)} ;
PARENT oToolTop PIXEL
DCADDBUTTON CAPTION 'Right ToolBar #2' ;
ACTION {||lHideStatus7 := !lHideStatus7, ;
DC_GetRefresh(GetList), ;
DC_StatusBarRePaint(oDlg)} ;
PARENT oToolTop PIXEL
// Top Statusbar #2 (Hideable) with toolbar
DCSTATUSBAR oStatTop2 HEIGHT 20 ALIGN DCGUI_ALIGN_TOP ;
HIDE {||lHideStatus2}
@ 0,0 DCTOOLBAR oToolTop2 SIZE 400,20 BUTTONSIZE 50,20 ;
TYPE XBPSTATIC_TYPE_RAISEDBOX PARENT oStatTop2 PIXEL
DCADDBUTTON CAPTION 'Button4' ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)} ;
PARENT oToolTop2 PIXEL
DCADDBUTTON CAPTION 'Button5' ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)} ;
PARENT oToolTop2 PIXEL
DCADDBUTTON CAPTION 'Button6' ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)} ;
PARENT oToolTop2 PIXEL
// Bottom Statusbar (Hideable) with message, scrollbar, buttons, key status
DCSTATUSBAR oStatBottom HEIGHT 28 ALIGN DCGUI_ALIGN_BOTTOM ;
HIDE {||lHideStatus3}
@ 3,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX ;
SIZE 300,20 ;
PARENT oStatBottom PIXEL OBJECT oMsgStatic
@ 2,2 DCMESSAGEBOX TYPE XBPSTATIC_TYPE_TEXT ;
SIZE 300,20 MOTION ;
COLOR GRA_CLR_BLUE, GRA_CLR_BACKGROUND ;
OBJECT oMsgBox PARENT oMsgStatic PIXEL
@ 3,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX ;
OBJECT oProgressStatic ;
SIZE 100,20 PARENT oStatBottom PIXEL
@ 2,3 DCPROGRESS oProgress ;
COLOR GRA_CLR_DARKRED, GRA_CLR_BACKGROUND ;
TYPE XBPSTATIC_TYPE_TEXT ;
SIZE 96,16 PARENT oProgressStatic PIXEL
@ 3,0 DCTOOLBAR oToolBottom SIZE 126,20 BUTTONSIZE 40,20 ;
TYPE XBPSTATIC_TYPE_RECESSEDBOX PARENT oStatBottom PIXEL
DCADDBUTTON CAPTION '&Exit' ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)} ;
PARENT oToolBottom PIXEL
DCADDBUTTON TYPE XBPSTATIC_TYPE_RAISEDBOX SIZE 3,22 ;
PARENT oToolBottom PIXEL
DCADDBUTTON CAPTION '&Cancel' ;
ACTION {||lTesting := .f.} ;
WHEN {||lTesting} ;
PARENT oToolBottom PIXEL
DCADDBUTTON TYPE XBPSTATIC_TYPE_RAISEDBOX SIZE 3,22 ;
PARENT oToolBottom PIXEL
DCADDBUTTON CAPTION '&Browse' ;
PARENT oToolBottom ;
ACTION {|o|o:=Thread():new(), ;
o:start({||BrowseWindow(oDlg:drawingArea,oMsgBox:ChildList()[1], ;
oProgress,@lTesting,GetList)}) } ;
PIXEL
@ 3,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX ;
SIZE 30,20 PARENT oStatBottom PIXEL OBJECT oCapsStatic
@ 1,1 DCSAY '' PARENT oCapsStatic ID 'CAPSLOCK' ;
SAYSIZE 28,18 SAYCENTER PIXEL
@ 3,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX ;
SIZE 30,20 PARENT oStatBottom PIXEL OBJECT oNumStatic
@ 1,1 DCSAY '' PARENT oNumStatic ID 'NUMLOCK' ;
SAYSIZE 28,18 SAYCENTER PIXEL
@ 3,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX ;
SIZE 30,20 PARENT oStatBottom PIXEL OBJECT oInsStatic
@ 1,1 DCSAY '' PARENT oInsStatic ID 'INSERT' ;
SAYSIZE 28,18 SAYCENTER PIXEL
// Left Statusbar #1 (Hideable) with toolbar
DCSTATUSBAR oStatLeft1 WIDTH 45 ALIGN DCGUI_ALIGN_LEFT ;
HIDE {||lHideStatus4} TYPE XBPSTATIC_TYPE_TEXT
@ 0,0 DCTOOLBAR oToolLeft1 SIZE 45,1000 BUTTONSIZE 45,20 ;
TYPE XBPSTATIC_TYPE_RAISEDBOX PARENT oStatLeft1 PIXEL
DCADDBUTTON CAPTION '1-Test1' PARENT oToolLeft1 PIXEL
DCADDBUTTON CAPTION '1-Test2' PARENT oToolLeft1 PIXEL
DCADDBUTTON CAPTION '1-Test3' PARENT oToolLeft1 PIXEL
DCADDBUTTON CAPTION '1-Test4' PARENT oToolLeft1 PIXEL
// Left Statusbar #2 (Hideable) with toolbar
DCSTATUSBAR oStatLeft2 WIDTH 45 ALIGN DCGUI_ALIGN_LEFT ;
HIDE {||lHideStatus5} TYPE XBPSTATIC_TYPE_TEXT
@ 0,0 DCTOOLBAR oToolLeft2 SIZE 45,1000 BUTTONSIZE 45,20 ;
TYPE XBPSTATIC_TYPE_RAISEDBOX PARENT oStatLeft2 PIXEL
DCADDBUTTON CAPTION '2-Test1' PARENT oToolLeft2 PIXEL
DCADDBUTTON CAPTION '2-Test2' PARENT oToolLeft2 PIXEL
DCADDBUTTON CAPTION '2-Test3' PARENT oToolLeft2 PIXEL
DCADDBUTTON CAPTION '2-Test4' PARENT oToolLeft2 PIXEL
// Right Statusbar #1 (Hideable) with toolbar
DCSTATUSBAR oStatRight1 WIDTH 30 ALIGN DCGUI_ALIGN_RIGHT ;
HIDE {||lHideStatus6} TYPE XBPSTATIC_TYPE_TEXT
@ 0,0 DCTOOLBAR oToolRight1 SIZE 30,1000 BUTTONSIZE 30,25 ;
TYPE XBPSTATIC_TYPE_RAISEDBOX PARENT oStatRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_EXECUTE_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_UNDO_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_REDO_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_BOLD_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_ITALIC_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_UNDERLINE_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_CODEWRITE_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_CONFIG_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_DESIGN_M PARENT oToolRight1 PIXEL
DCADDBUTTON CAPTION BITMAP_COMMENT_M PARENT oToolRight1 PIXEL
// Right Statusbar #2 (Hideable) with toolbar
DCSTATUSBAR oStatRight2 WIDTH 30 ALIGN DCGUI_ALIGN_RIGHT ;
HIDE {||lHideStatus7} TYPE XBPSTATIC_TYPE_TEXT
@ 0,0 DCTOOLBAR oToolRight2 SIZE 30,1000 BUTTONSIZE 30,25 ;
TYPE XBPSTATIC_TYPE_RAISEDBOX PARENT oStatRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_BROWSER_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_CHECKBOX_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_LISTBOX_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_DIALOG_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_EDIT_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_SPINBUTTON_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_MLE_M PARENT oToolRight2 PIXEL
DCADDBUTTON CAPTION BITMAP_GET_M PARENT oToolRight2 PIXEL
DCHOTKEY xbeK_INS ACTION {||ReadInsert(!ReadInsert())}
DCGETOPTIONS WINDOWWIDTH 610 ;
WINDOWHEIGHT 400
DCREAD GUI OPTIONS GetOptions ;
PARENT @oDlg ;
TITLE 'Status Bar Example' ;
EVAL {|o|SetTimerEvent(100,{||_UpdateStats(GetList)}) }
SetTimerEvent(0)
RETURN nil
* ------------------
STATIC FUNCTION _UpdateStats( GetList )
LOCAL oCapsLock := DC_GetObject(GetList,'CAPSLOCK')
LOCAL oNumLock := DC_GetObject(GetList,'NUMLOCK')
LOCAL oInsert := DC_GetObject(GetList,'INSERT')
LOCAL lCaps := AppKeystate( VK_CAPITAL, .T. )
LOCAL lNum := AppKeystate( VK_NUMLOCK, .T. )
IF lNum == APPKEY_PRESSED
oNumlock:SetCaption( "Num" )
ELSE
oNumlock:SetCaption( "" )
ENDIF
IF lCaps == APPKEY_PRESSED
oCapslock:SetCaption( "Caps" )
ELSE
oCapslock:SetCaption( "" )
ENDIF
IF ReadInsert()
oInsert:SetCaption( "Ins" )
ELSE
oInsert:SetCaption( "Ovr" )
ENDIF
RETURN nil
* ------------
STATIC FUNCTION BrowseWindow( oDlg, oMsgBox, oProgress, ;
lTesting, aMainGetList )
LOCAL GetList := {}, oBrowse, GetOptions
IF !File('..\XDOC\EXPRESS.DBF')
DC_MsgBox({'Sorry. The database required to show this feature',;
'is not included in the demonstration version', ;
'or the ..\XDOC\EXPRESS.DBF file does not exist'})
RETURN nil
ENDIF
SET DEFA TO ..\XDOC
USE EXPRESS VIA FOXCDX SHARED ALIAS 'XDOC'
SET INDEX TO EXPRESS.CDX
OrdSetFocus('COMMAND')
SET DEFA TO
@ 0,0 DCSAY ''
@ 1,0 DCBROWSE oBrowse ALIAS 'XDOC' SIZE 50, 8
DCBROWSECOL DATA {||XDOC->command} HEADER 'Command' ;
PARENT oBrowse ;
MESSAGE 'This is the Command, Function or Class' ;
INTO oMsgBox
DCBROWSECOL DATA {||XDOC->short} HEADER 'Short' ;
PARENT oBrowse ;
MESSAGE 'This is the Short Description' ;
INTO oMsgBox
DCBROWSECOL DATA {||XDOC->type} HEADER 'Type' ;
PARENT oBrowse ;
MESSAGE 'This is the Type of Help Item' ;
INTO oMsgBox
DCBROWSECOL DATA {||XDOC->module} HEADER 'Module' ;
PARENT oBrowse ;
MESSAGE 'This is the name of the Module containing this item' ;
INTO oMsgBox
DCBROWSECOL DATA {||XDOC->see_also} HEADER 'See Also' ;
PARENT oBrowse ;
MESSAGE 'This is a list of related items' ;
INTO oMsgBox
@ 9.5,40 DCPUSHBUTTON CAPTION 'Test' SIZE 10,1.2 ;
TOOLTIP 'Test all the records in the database' ;
WHEN {||!lTesting} ;
TITLE 'eXPress++ Documentation' ;
ACTION {||_TestRecords(oMsgBox,oProgress,@lTesting,aMainGetList)}
DCHOTKEY xbeK_INS ACTION {||ReadInsert(!ReadInsert())}
DCGETOPTIONS ;
AUTORESIZE ;
WINDOWCOL 5 ;
CASCADE
DCREAD GUI FIT ;
OPTIONS GetOptions ;
APPWINDOW oDlg ;
TITLE 'eXPress++ Help File'
RETURN nil
* -------------
STATIC FUNCTION _TestRecords( oMsgBox, oProgress, lTesting, aMainGetList )
LOCAL nRecNo := RecNo(), nCount
lTesting := .t.
DC_GetRefresh(aMainGetList)
oMsgBox:setCaption('Test in Progress...')
GO TOP
nCount := 0
DO WHILE !Eof() .AND. lTesting
DC_AppEvent(@lTesting,0,.01)
DC_GetProgress( oProgress, nCount++, RecCount() )
Sleep(1)
// .. put test code here
SKIP
ENDDO
oMsgBox:setCaption('Test Completed! No Errors!')
DC_GetProgress( oProgress, -1, 0 ) // Clear progress box
GO nRecNo
lTesting := .f.
DC_GetRefresh(aMainGetList)
RETURN nil
Source/Library:
DCDIALOG.CH
See Also:
DCPANEL
DCSUBMENU
Add Submenu to MENUBAR object for displaying with Text/GUI reader
Syntax:
DCSUBMENU < oSubMenu > ;
[PROMPT < bcPrompt >] ;
[INDEX < nIndex >] ;
[PARENT < oParent >] ;
[PARENT < cParentId >] ;
[WHEN < bWhen >] ;
[ACTION < bAction >] ;
[ACTIVATEITEM < bActivate >] ;
[NAME < nName >] ;
[CHECKED] ;
[CHECKWHEN < bCheckWhen >] ;
[SEPARATOR] ;
[STYLE < nStyle >] ;
[ATTRIBUTE < nAttr >] ;
[HELPCODE < cHelpCode >] ;
[LOCK < cLock >] ;
[CARGO < xCargo >] ;
[ACCELKEY < nAccelKey >] ;
[ID < cId >] ;
[PRESENTATION < aPres >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[GROUP < cGroup >] ;
[MESSAGE < bcMsg > [INTO < oMsgBox >]] ;
[LOCK < cLock >] ;
[PROTECT < bProtect >] ;
[OWNERDRAW] ;
[BARTEXT < cBarText >] ;
[BARFONT < cBarFont >] ;
[FGCOLOR < anFGColor >] ;
[BGCOLOR < anBGColor >] ;
[BARCOLOR < anBarColorFG >,< anBarColorBG >] ;
[ITEMFONT < cItemFont >] ;
[BEGINMENU < bBeginMenu >] ;
[ENDMENU < bEndMenu >] ;
[ITEMMARKED < bItemMarked >] ;
[ITEMSELECTED < bItemSelected >] ;
[SUBITEMFONT < cSubItemFont >] ;
[COLUMNBREAK]
Arguments:
< oSubMenu > is the name of the variable to assign to the
object.
PROMPT < bcPrompt > is the caption to assign to this menu item.
The caption may be a character string, a resource number for
a bitmap, another XbpMenu() object, a NIL (for separator
bars), or a code block. If the caption is a character string,
it may include a Tilde (~) character to define the hot-key for the item
like so: "Save ~Changes". If < bcPrompt > is a code-block, then
it must return a character string, a resource number or an
XbpMenu() object. This code block will be evaluated whenever
the function DC_GetRefresh() or DC_GetWhen() is called.
ACTION < bAction > is a code block that gets evaluated when
the menu item is selected. Do not use this clause if
the submenu has menu items.
ACTIVATEITEM < bActivate > is a code block to run in lieu of using
ACTION clauses on child DCMENUITEM commands. < bActivate > can be
used to run an Indexed procedure. NAME < nName > is applied to the
:setName() method of the menu object to be retrieved later.
Example:
bRunProc := {|nItem,nIndex,oXbp,nName|nName := oXbp:setName(), ;
RunProcedure( nName + nItem )}
DCSUBMENU oMenu1 NAME 1000 ACTIVATEITEM bRunProc
DCMENUITEM 'Item 1' PARENT oMenu1
DCMENUITEM 'Item 2' PARENT oMenu1
DCSUBMENU oMenu1 NAME 2000 ACTIVATEITEM bRunProc
DCMENUITEM 'Item 1' PARENT oMenu2
DCMENUITEM 'Item 2' PARENT oMenu2
PARENT < oParent > is the name of the variable that was
assigned to the parent MenuBar (XbpMenuBar()), SubMenu (XbpMenu()),
or TreeViewItem (XbpTreeViewItem()) for this SubMenu.
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.
INDEX < nIndex > is a variable name to store the index number
that is assigned to this item when it is created.
CHECKED will cause a check mark to appear next to the menu
item. This option is ignored if a < nAttr > parameter is used.
CHECKWHEN < 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 item will be unchecked. If the
value returned is .TRUE. then the item will be checked. The
parent DCSUBMENU object is passed as a parameter to the code
block.
SEPARATOR is used only if this is a menu separator bar rather
than a selectable item. Do not include a PROMPT. All other
parameters are ignored. This option is ignored if a < nStyle >
parameter is used.
STYLE < nStyle > is a list of XBPMENUBAR_MIS_* numbers defined
in XBP.CH. These options are summed together.
ATTRIBUTE < nAttr > is a list of XBPMENUBAR_MIA_* numbers defined
in XBP.CH. These options are summed together.
MESSAGE < cMsg > is the message you want to display in the
message area of the dialogue screen defined by an @..DCMESSAGE
command. The message is displayed when the mouse is passed over
the menu item. 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.< oSubMenu > is the variable name to assign to
this submenu for storage of the XbpMenu() object.
HELPCODE < cHelp > is a character string that is passed to the
DC_HelpF1() function if F1 is pressed when the mouse is placed
over the menu item. The help code is used by the Help system
to for specific context-help.
PRESENTATION < aPres > is a two-dimensional array. If specified,
this contains presentation parameters for the Button 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.
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 submenu will be disabled and grayed.
If the value returned is .TRUE. then the submenu will be enabled.
The object is passed as a parameter to the code block.
ID < cID > is a unique 8-character ID to assign to this menu
item. This is used to allow users to assign a menu item as
"default" by pressing a special key.
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 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 the title or description of the submenu.
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().
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the mouse is passed over the menu item. 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.
LOCK < cLock > is a lock code to assign to this sub-menu. Lock
codes are any character string up to 5 characters in length.
To gain access to a menu item, a logged on user must own a key
of the same name as the lock or a master key to the lock. The
function DC_ReadGuiMenuAccess() must be called prior to calling
DC_ReadGui() or using any DCREAD GUI command in which the Getlist
contains menu items with locks. DC_ReadGuiMenuAccess() is passed
a comma-delimited character string containing the set of keys
owned by the logged on user. In a typical application, this
function should be called immediately after the logon of a new
user and the users predefined keylist passed to the function.
Example: DC_ReadGuiMenuAccess('ABC,K*,XY*')
This key list will allow access to any menu items that have
no locks or to menu items locked with 'ABC', 'K*' or 'XY*'
To give access to all menu locks assign the key "*****'.
If a submenu is locked and the user does not own a key, the
submenu and all of its menu items will not be displayed in the
menu.
PROTECT < bProtect > is a code block to evaluate which protects
this menu item. The code block must return a logical value. If
the value returned is .TRUE. then the menu item will not be
included in the menu.
ACCELKEY < nAccelKey > is a numeric "hot-key" assignment that will
activate the menu item when the hot-key is pressed. The key
must be a valid key with the prefix xbeK_*. These keys are
defined in APPEVENT.CH.
OWNERDRAW will cause the menu to be painted with a more
eye-appealling design, including a vertical bar on the left side
of each submenu with a vertically painted caption and user-defined
colors. This option is available only when using Xbase++ 1.9 or
later.
BARTEXT < cBarText > is the text to paint on the vertical bar when
the OWNERDRAW options is used.
BARFONT < cBarFont > is the font compound name to use for all
text in the vertical bar when the OWNERDRAW option is used.
FGCOLOR < anFGColor > is the foreground color of the pull down
menus when the OWNERDRAW option is used. This may be a numeric
GRA_CLR_* value or an array of 3 numeric values for RGB.
BGCOLOR < anBGColor > is the background color of the pull down
menus when the OWNERDRAW option is used. This may be a numeric
GRA_CLR_* value or an array of 3 numeric values for RGB.
BARCOLOR < anBarColorFG >, < anBarColorBG > are the foreground
and
background colors of the vertical bar when the OWNERDRAW option
is used. These may be a numeric GRA_CLR_* value or an array of
3 numeric values for RGB.
Note: If color options are not used, then they are defaulted to
the colors set by the DCMENUBAR or DCSUBMENU parent. If the parent
is not a DCMENUBAR or a DCSUBMENU then the colors are defaulted
to those established by DC_XbpMenuConfig().
ITEMFONT < cItemFont > is the font of the menu items when using the
OWNERDRAW feature.
The BEGINMENU < bBeginMenu > code block is evaluated when a user
activates a
menu and starts with the menu selection. {| uNIL1, uNIL2, self | ... }
The ENDMENU < bEndMenu > code block is evaluated when a user has
selected a
menu item or aborted menu selection. {| uNIL1, uNIL2, self | ... }
The ITEMMARKED < bItemMarked > code block is evaluated when a menu item
in a
menu has been highlighted. This can be used to display additional
information associated with a particular menu item, for example.
{| nItemIndex, uNIL, self | ... }
The ITEMSELECTED < bItemSelected > code block is evaluated when a menu
item in a
menu has been selected. This occurs after the user clicks the left
mouse button on the menu item, presses the Return key when the
item is highlighted, or presses the shortcut key combination. This
event is only generated if the selected menu item does not contain
a code block. If it does not contain a code block, the callback
code block or method of the menu object is executed. The first
parameter < nItemIndex > contains the ordinal position of the selected
menu item. {| nItemIndex, uNIL, self | ... }
SUBITEMFONT < cSubItemFont > is the default font for all subitems of
this submenu.
This parameter is ignored if not using the OWNERDRAW option.
COLUMNBREAK causes successive menu items to appear in a new
column of the drop-down or popup menu. Look at the sample
program in the .\SAMPLES\MENU directory.
Description:
The command DCSUBMENU creates a new SubMenu definition and
adds the definition 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.
DCSUBMENU is used with the DCMENUBAR command to add pull-down
menus to a MenuBar object or with the DCTREEROOT / DCTREEITEM
commands to add tree branches to a Treeview object.
Notes:
The dialog object created by DCSUBMENU is an object of the
XbpMenu() class, therefore it can be manipulated with
any iVar or method supported by XbpMenu().
Examples:
/*
This example displays a dialogue box with two tab pages
and a menu with 3 submenus: File, Edit, Util.
*/
#include "dcdialog.ch"
#include "appevent.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oFileMenu, oMenuBar, oEditMenu, oMemo, oUtilMenu, ;
cMemo
USE COLLECT
cMemo := COLLECT->memo
@ 0,0 DCMULTILINE cMemo SIZE 70,7 FONT "10.Courier.Bold"
/* ---- Menu ---- */
DCMENUBAR oMenuBar
DCSUBMENU oFileMenu PROMPT "&File" PARENT oMenuBar
DCMENUITEM "&Open a File" PARENT oFileMenu ;
ACTION {||Msgbox('OpenFile')} ;
DCMENUITEM "&Close File" PARENT oFileMenu ;
ACTION {||Msgbox('CloseFile')}
DCMENUITEM "&Pack File" PARENT oFileMenu ;
ACTION {||Msgbox('Packfile')}
DCSUBMENU oEditMenu PROMPT "&Edit" PARENT oMenuBar
DCMENUITEM "&Next Record" PARENT oEditMenu ;
ACTION {||dbSkip(), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_N ;
WHEN {||!Eof()}
DCMENUITEM "&Previous Record" PARENT oEditMenu ;
ACTION {||dbSkip(-1), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_P ;
WHEN {||!Bof()}
DCMENUITEM "&Top of File" PARENT oEditMenu ;
ACTION {||dbGoTop(), ;
cMemo := COLLECT->memo,;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_T
DCMENUITEM "&Bottom of File" PARENT oEditMenu ;
ACTION {||dbGoBottom(), ;
cMemo := COLLECT->memo, ;
DC_GetRefresh(GetList)} ;
ACCELKEY xbeK_ALT_B
DCSUBMENU oUtilMenu PROMPT "&Util" PARENT oMenuBar
DCMENUITEM "Copy File" PARENT oUtilMenu ;
ACTION {||Msgbox('CopyFile')}
DCMENUITEM "Move File" PARENT oUtilMenu ;
ACTION {||Msgbox('MoveFile')}
DCREAD GUI ;
TITLE 'Menu Demo' ;
FIT ;
ADDBUTTONS
RETURN
Source/Library:
DCDIALOG.CH
See Also:
DCMENUBAR
DCMENUITEM
dc_readguimenuaccess()
dc_xbpmenuconfig()
DCTABGROUP
A command for creating TABPAGES in HTML
Syntax:
@ [ < nRow >, < nCol > ] DCTABGROUP ;
[OBJECT < oObject >] ;
[TABOBJECT < oTabs >] ;
[BORDER < nBorder >] ;
[TABS,COLS,COLUMNS < nCols >] ;
[CAPTIONS < aCaptions >] ;
[NAME < cName >] ;
[SELECT < nTabSelect >] ;
[ALIGN < nAlign >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[BGCOLOR < ncBgC >] ;
[SELECTEDCOLOR < xSelColor >] ;
[UNSELECTEDCOLOR < xUnSelColor >];
[BORDERCOLOR < xBorderColor >] ;
[BORDERCOLORLIGHT < xBorderColorLight] ;
[BORDERCOLORDARK < xBorderColorDark >] ;
[CELLPADDING < nCellPadding >] ;
[CELLSPACING < nCellSpacing >] ;
[HSPACE < nHspace >] ;
[VALIGN < nValign >] ;
[VSPACE < nVspace >] ;
[WIDTH < nWidth >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[EVAL < bEval >] ;
[TITLE < cTitle >] ;
[PRE,PRETEXT < bcPreHTML >] ;
[POST,POSTTEXT < bcPostHTML >] ;
[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 < oObject > is the name of the variable to assign as a
storage place for this object.
TABOBJECT < oTabs > is the name of the variable to assign as a
storage place for the tab 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.
BORDER < nBorder > specifies the width in pixels of the border
around the table.
NAME < cName > is the name to assign to this Tab Group.
TABS < nTabs > is the number of tabs in the Tab Group.
SELECT < nTabSelect > is the number of the currently selected tab.
CAPTIONS < aCaptions > is an array of character strings to use
as captions for each tab. If this array is not used, then
tabs captions, images, etc must be added to the childlist
of the TABOBJECT < oTabs >.
UNSELECTEDCOLOR < xSelColor > is the color of the tabs that are
not selected. The color may be an RGB color value (#XXXXXX) ,
a standard color name, an RGB 3-element array or a numeric
value defined in GRA.CH.
SELECTEDCOLOR < xUnSelColor > is the color of the tab that is
currently selected. The color may be an RGB color value
(#XXXXXX), a standard color name, an RGB 3-element array or
a numeric value defined in GRA.CH.
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.
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.
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.
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:
DCTABGROUP is a command for creating HTML tables that
emulate GUI tab pages. The class name associated with this
command is DC_HtmlTabGroup(). The :writeHtml() method
returns the source code of the table tag and all of its
child elements.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], oForm, cHtml, oTabGroup, oTabs, aTabCaptions, ;
aMemos[4]
DCFORM OBJECT oForm
DCTABGROUP ;
WIDTH '400' ;
OBJECT oTabGroup ;
TABOBJECT oTabs ;
PARENT oForm ;
SELECT 2 ;
COLOR GRA_CLR_WHITE ;
SELECTEDCOLOR GRA_CLR_GREEN ;
UNSELECTEDCOLOR GRA_CLR_PALEGRAY ;
BORDER 0 ;
CELLPADDING 0 ;
CELLSPACING 0 ;
TABS 4
aTabCaptions := {'Customer','Vendor','History','Misc'}
FOR i := 1 TO Len(aTabCaptions)
DCSUBMIT ;
TYPE DCHTML_BUTTONTYPE_SUBMIT ;
CAPTION aTabCaptions[i] ;
PARENT oTabs ;
NAME 'App.Tab' + Alltrim(Str(i))
aMemos[i] := 'This is the ' + aTabCaptions[i] + ' Memo'
@ 0,0 DCMULTILINE aMemos[i] SIZE 60,10 ;
PARENT oTabGroup
NEXT
DCREAD GUI TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_html()
dc_readhtml()
dc_htmltabgroup()
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 >] ;
[BACKGROUND < bcBackGroun >] ;
[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.
BACKGROUND < bcBackGround > is the name of a .JPG file to use as
the background of the table. If < bcBackGround > is a code block
it must return a character string. The image will be tiled over
the entire area of the table.
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 '<h1>' + Alltrim(Str(nTable++)) + ;
'</h1>' 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()
DCTREEITEM
Create a new item for a Tree View
Syntax:
DCTREEITEM ;
[CAPTION < cCaption >] ;
[PARENT < oParent >] ;
[LOCK < cLock >] ;
[PROTECT < bProtect >] ;
[ACTION < bAction >] ;
[HELPCODE < cHelpCode >] ;
[MESSAGE < cMsg > [INTO < oMsg >]] ;
[CARGO < xCargo >] ;
[ID < cId >] ;
[OBJECT < oObject >] ;
[TITLE < cTitle >] ;
[PREEVAL < bPreEval >] ;
[EVAL < bEval >] ;
[GROUP < cGroup >] ;
[IMAGEEXPANDED < noImageExpanded >] ;
[IMAGENORMAL < noImageNormal >] ;
[IMAGEMARKED < noImageMarked >] ;
[IMAGECHECKED < noImageChecked >] ;
[CHECKWHEN < bCheckWhen >] ;
[CHARCHECKED < cCharChecked >] ;
[SUBCLASS < cSubClass >]
Arguments:
CAPTION < cCaption > is the Caption which will appear in the
Tree View window for this item.
PARENT < oParent > is the name of the variable that was assigned to
the parent XbpTreeView or DCTREEROOT object for this object.
If this argument is not passed then the parent will be the
object set with the DCSETPARENT command.
OBJECT < oObject > is the variable to use as a container for the
object after it is created by the GUI reader.
MESSAGE < bcMsg > is the message you want to display in the
message area of the dialogue screen defined by the DCMESSAGEBOX
command when the item is marked. 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.
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.
ACTION < bAction > is a code block to evaluate when this tree item
is selected either with the ENTER key or a double-click. The
code block is passed three parameters as follows:
{| oItem, aRect, oTree | ... }
< oItem > is the selected XbpTreeViewItem object.
< aRect > := { nX1, nY1, nX2, nY2 }
< aRect > is an array with four elements. They contain the
xy-coordinates for the lower left and upper right corner of
< oItem > . The origin for the coordinates is the lower left
corner of the parent XpbTreeView object.
< oTree > is the Parent XbpTreeView object.
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.
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.
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().
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.
IMAGEEXPANDED < noImageExpanded > is the icon or bitmap to use when
this tree item is expanded. If < noImageExpanded > is a numeric
value it must be an icon resource that is linked to the .EXE or
exists in < cDllName >. If < noImageExpanded > is an object,
it
must be a bitmap of the XbpBitMap() class. An object may be used
only with Xbase++ 1.7 or later.
IMAGENORMAL < noImageNormal > is the icon resource to use when this
tree item is not marked or expanded. If < noImageNormal > is a
numeric value it must be an icon resource that is linked to the
.EXE or exists in < cDllName >. If < noImageNormal > is an
object, it
must be a bitmap of the XbpBitMap() class. An object may be used
only with Xbase++ 1.7 or later.
IMAGEMARKED < noImageMarked > is the icon resource to use when this
tree item is marked. If < noImageMarked > is a numeric value it
must be an icon resource that is linked to the .EXE or exists in
< cDllName >. If < noImageMarked > is an object, it must be a
bitmap
of the XbpBitMap() class. An object may be used only with Xbase++
1.7 or later.
IMAGECHECKED < noImageChecked > is the icon resource to use when this
tree item is marked. If < noImageChecked > is a numeric value it
must be an icon resource that is linked to the .EXE or exists in
< cDllName >. If < noImageChecked > is an object, it must be a
bitmap
of the XbpBitMap() class. An object may be used only with Xbase++
1.7 or later. A tree item is checked or unchecked with the
CHECKWHEN codeblock.
CHECKWHEN < bCheckWhen > is a code block that is evaluated every
time DC_GetRefresh() or DC_GetWhen() is called. This code block
must return a logical value of .T. to cause the item to be
checked or .F. to cause the item to be unchecked. A checked item
will display a programmer-defined icon (defined by IMAGECHECKED)
and/or sequence of characters at the start of the item caption
(defined by CHARCHECKED).
CHARCHECKED is a character or sequence of characters to display
in the item caption (at the beginning of the caption) when the
item is checked via the CHECKWHEN code block.
DLLNAME < cDllName > is the name of the DLL containing the image
icons. If this clause is not used, then the icons must be linked
into the .EXE.
LOCK < cLock > is a lock code to assign to this tree item. Lock
codes are any character string up to 5 characters in length.
To gain access to a tree item, a logged on user must own a key
of the same name as the lock or a master key to the lock. The
function DC_ReadGuiMenuAccess() must be called prior to calling
DC_ReadGui() or using any DCREAD GUI command in which the Getlist
contains tree items with locks. DC_ReadGuiMenuAccess() is passed
a comma-delimited character string containing the set of keys
owned by the logged on user. In a typical application, this
function should be called immediately after the logon of a new
user and the users predefined keylist passed to the function.
Example: DC_ReadGuiMenuAccess('ABC,K*,XY*')
This key list will allow access to any tree items that have
no locks or to tree items locked with 'ABC', 'K*' or 'XY*'
To give access to all tree locks assign the key "*****'.
If a tree item is locked and the user does not own a key, the
item and it's sub-items will not be displayed in the tree.
PROTECT < bProtect > is a code block to evaluate which protects
this tree item. The code block must return a logical value. If
the value returned is .TRUE. then the tree item will not be
included in the tree.
SUBCLASS < cSubClass > is a string containing a class name that
will be used to create the class, rather than DC_XbpTreeViewItem().
This class should inherit from DC_XbpTreeViewItem().
See the example in \exp19\samples\subclass.
Description:
The command DCTREEITEM creates a new TreeView item 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.
DCTREEITEM is used with the @ DCTREEROOT command to create
a TreeView system for viewing any kind of data.
Notes:
The object created by DCTREEITEM is an object of the
XbpTreeViewItem() class, therefore it can be manipulated with
any iVar or method supported by XbpTreeViewItem().
Examples:
#include "dctree.ch"
PROCEDURE Xtest()
LOCAL GetList := {}, oTree, oSubTree1, oSubTree2, cSelected
@ 1,1 DCTREEROOT SIZE 30,10 OBJECT oTree CAPTION 'Tree Root' ;
HASLINES ;
HASBUTTONS ;
ITEMSELECTED {|o| cSelected := o:caption, ;
DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}
DCTREEITEM CAPTION 'SubTree 1' PARENT oTree OBJECT oSubTree1
DCTREEITEM CAPTION 'Sub-SubTree 1/1' PARENT oSubTree1
DCTREEITEM CAPTION 'Sub-SubTree 1/2' PARENT oSubTree1
DCTREEITEM CAPTION 'Sub-SubTree 1/3' PARENT oSubTree1
DCTREEITEM CAPTION 'SubTree 2' PARENT oTree OBJECT oSubTree2
DCTREEITEM CAPTION 'Sub-SubTree 2/1' PARENT oSubTree2
DCTREEITEM CAPTION 'Sub-SubTree 2/2' PARENT oSubTree2
DCTREEITEM CAPTION 'Sub-SubTree 2/3' PARENT oSubTree2
DCREAD GUI FIT ADDBUTTONS
DC_MsgBox({'You Selected:',cSelected})
RETURN nil
Source/Library:
DCTREE.CH
See Also:
@ DCTREEROOT
dc_readguimenuaccess()
DCUSEREVENT
Create an action that is tied to a user event
Syntax:
DCUSEREVENT < nEvent > ACTION < bAction >
Arguments:
< nEvent > is the user event. It is usually xbeP_User + offset.
< bAction > is the codeblock to evaluate.
Description:
DCUSEREVENT is used to run an action code block when a user event
is received. This can be handy for refreshing or updating a
window from another thread. See sample program in ..\samples\events.
Source/Library:
dcdialog.ch, dclipx.dll
DCVARGROUP
Create a group of vars in a dynamically-created class
Description:
DCVARGROUP is use to create a group of vars in a dynamically-created
class. This is better than using arrays for passing variables.
Look at the sample program in .\samples\vars.
Source/Library:
_DCFUNCT.PRG, DCDIALOG.CH, DCLIPX.DLL
DCVARS
A command for managing HIDDEN variables in HTML
Syntax:
DCVARS ;
[OBJECT < oVars >] ;
[PARENT < oParent >] ;
[PARENTID < cPID >] ;
[CARGO < xCargo >] ;
[HIDE < bHide >] ;
[INCLUDE < aInclude >] ;
[REPLICATE < aVars >] ;
[EXCLUDE < aExclude >] ;
[PRE,PRETEXT < bcPreText >] ;
[POST,POSTTEXT < bcPostText >] ;
[EVAL < bEval >] ;
[ID < cId >] ;
[GROUP < cGroup >] ;
Arguments:
PARENT < oParent > is the name of the variable that was
assigned to the parent of this 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.
REPLICATE < aVars > is a 2-dimensional array containing all the
system variables passed in to the application from the
HTTP handler.
INCLUDE < aInclude > is a 2-dimensional array containing any
additional vars.
EXCLUDE < aExclude > is a 1-dimensional array containing the
names of vars in < sysVars > to exclude. This array may contain
names with * wildcard characters. Names are case sensitve.
OBJECT < oVars > is the name of the variable to assign as a
storage place for this object.
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:
DCVARS is a command for creating and replicating hidden
variables in HTML forms.
The command DCVARS creates an HTML element 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.
Notes:
DCVARS creates an object of the DC_HtmlVars() class.
Examples:
#include "dcdialog.ch"
#include "dchtml.ch"
FUNCTION Xtest()
LOCAL i, GetList[0], cHtml, aVars, oForm
aVars := { { 'App.Text.1', 'some text' }, ;
{ 'App.Text.2', 'more text' }, ;
{ 'App.Text.3', 'still more text' }, ;
{ 'App.Checkbox', 'on' }, ;
{ 'App.RadioButton', 'Mint' }, ;
{ 'App.Memo', 'lots of text' }, ;
{ 'App.RecordNumber', '12' }, ;
{ 'App.Database', 'CUSTOMER' }, ;
{ 'App.Account', '40055' } }
DCFORM OBJECT oForm
DCVARS ;
PARENT oForm ;
REPLICATE aVars ;
EXCLUDE { 'App.Text.*','App.Memo' } ;
INCLUDE { { 'App.Date', Date() }, ;
{ 'App.Time', Time() } }
DCREAD HTML TO cHtml
MemoWrit('TEST.HTM',cHtml)
RETURN cHtml
Source/Library:
DCHTML.CH
See Also:
DCREAD HTML
dc_html()
dc_readhtml()
dc_htmlvars()
GETSETFUNCTION
Create a Get/Set Function
Syntax:
GETSETFUNCTION < cFuncName > DEFAULT < xDefault >
Arguments:
< cFuncName > is the name of the function to create.
< xDefault > is the default value to return.
Description:
GETSETFUNCTION is a command that is used to create a Get/Set
function for Getting or Setting a value.
Notes:
The value stored is visible in all threads, therefore a value
can be set in one thread and then read in another thread.
Use GETSETTHREADFUNCTION for a thread-safe Get/Set function.
Examples:
GETSETFUNCTION MyTest DEFAULT 0
* -------------
? MyTest()
0
MyTest(12)
? MyTest()
12
Source/Library:
DCDIALOG.CH
See Also:
GETSETTHREADFUNCTION
GETSETTHREADFUNCTION
Create a Get/Set Function that is thread-safe
Syntax:
GETSETTHREADFUNCTION < cFuncName > DEFAULT < xDefault >
Arguments:
< cFuncName > is the name of the function to create.
< xDefault > is the default value to return.
Description:
GETTHREADSETFUNCTION is a command that is used to create a Get/Set
function for Getting or Setting a value.
The value being stored or retrieved is thread-safe.
Notes:
The value retrieved is visible only in the thread in which it was
set, therefore call to the function in one thread will not
affect another thread.
Use GETSETFUNCTION for a global (non-safe) Get/Set function.
Examples:
GETSETTHREADFUNCTION MyTest DEFAULT 0
* -------------
? MyTest()
0
MyTest(12)
? MyTest()
12
Source/Library:
DCDIALOG.CH
See Also:
GETSETFUNCTION
GUI
Set the Dialogue mode to GUI or TEXT
Syntax:
GUI ON | OFF
Arguments:
GUI ON will cause eXPress++ to process Dual-Mode functions as
a GUI dialogue. GUI OFF will cause eXPress++ to process all
Dual-Mode functions as a TEXT dialogue.
Returns:
.TRUE. if any gets were updated, .FALSE. otherwise.
Description:
GUI or DCGUI is used to set Text or Gui mode for Dual-Mode
Functions. The eXPress++ library contains a variety of
functions which operate in "Dual-Mode". When GUI mode is
ON, the function uses a GUI dialogue based on Xbase Parts. When
the GUI mode is OFF the function works in standard text-mode.
Examples:
/*
In this example, DC_ReadBox() and DC_Impl() will only
display and restore the window in Text-Mode. They are
ignored in GUI mode.
*/
#include "dcdialog.ch"
PROCEDURE Xtest( )
LOCAL GetList := {}, GetOptions, aReadArea, cLastName := Space(15), ;
cFirstName := Space(15), cCompany := Space(25), ;
cStreet := Space(25), cCity := Space(25), cState := Space(2), ;
cCountry := Space(25), cPhone := Space(15), cScrn, lOk
lGui := IIF( Valtype(lGui)='L',lGui,.t.)
GUI ON // set GUI mode
cScrn := DC_ReadBox(3,5,15,75,,@aReadArea)
@ 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
@10,10 DCSAY ' State' GET cState
@11,10 DCSAY ' Country' GET cCountry
@13,10 DCSAY ' Phone' GET cPhone PICT '(999)-999-9999'
DCGETOPTIONS SAYWIDTH 70 SAYRIGHTJUST
lOk := DC_ReadGets( GetList,"Enter Data",aReadArea,;
GetOptions )
DC_Impl(cScrn)
RETURN
Source/Library:
DCDIALOG.CH
See Also:
dc_readmodal()
dc_readgui()
dc_gui()
LOG
Write system status to a log file
Syntax:
LOG [TO < cFileName >]
Arguments:
TO < cFileName > is the name of the file to write.
Description:
LOG will log information about the currently running
procedure to a log file including the current status of work
areas and environment variables.
A dialog window will be displayed first for the user to type
in specific information that will be saved in the log file
or to specify the name and location of the log file.
Examples:
. LOG
Source/Library:
_DCLOG.PRG, DCLIP2.DLL
See Also:
dc_log()
dc_setdclip()
SAVE ARRAY
Save a multidimensional array to a binary file
Syntax:
SAVE ARRAY < aArray > ;
[TO < cFileName >]
Arguments:
< aArray > is any multidimensional array.
TO < cFileName > is the name of the binary file to create with
the array contents. If this argument is not passed then the
file will be assigned the name < aArray >.DCA.
Description:
SAVE ARRAY will save the contents of any multi-dimensional
array to a binary file for later restoring with RESTORE ARRAY.
Examples:
. aDir := Directory()
. SAVE ARRAY aDir
. SAVE ARRAY aDir TO junk.ar
Source/Library:
_DCASAVE.PRG/.OBJ, DCLIPX.LIB
See Also:
dc_asave()
WTF
Send debug information to a browse-style debugging window
Syntax:
DCBDEBUG < xExpr1 > [ ; < xExprN > ] ;
[WINDOW < nWindow >] ;
[COLOR < nbFgColor > [,< nBgColor >] ;
[PAUSE < bPause >] ;
[PAUSE] ;
[ALWAYSONTOP] ;
[WHEN < bWhen >]
Arguments:
< xExpr1 > through < xExprN > is any expression.
WINDOW < nWindow > is the debug window to send the information.
If this clause is not used then the information is sent to debug
window # 1.
COLOR < nbFgColor > and < nBgColor > are the foreground and
background
colors of the information to display in the window. If < nbFgColor >
is a code block, then < nBgColor > is ignored. The code block must
return an array of two numeric elements, ie a foreground color
and a background color.
PAUSE will cause the program execution to stop until the "Continue"
button on the debug window is activated.
PAUSE < bPause > will cause the program execution to stop only if
< bPause > evaluates as .TRUE.
ALWAYSONTOP will force the debug window to always display in
front of all other windows.
WHEN < bWhen > is a codeblock that will cause the debug info to be
displayed only when the codeblock returns .t.
Ex: DCBDEBUG i, oInfo WHEN {||i==16}
Description:
DCBDEBUG or DD is used to send data to a browse-style debugging window
when debugging GUI applications.
A list of expressions may be included and the output of each
expression will be displayed in a new row in the browse window.
This is a major improvement over DCQDEBUG because it uses an array
browse rather than a memo to show debug information. Improvements:
a. Updating the window is much faster therefore does not slow
down application.
b. Data is in resizeable and moveable columns
c. Each debug line may have its own color.
d. Supports multiple windows.
e. Double-Clicking on debug item in window displays more info
about that item, such as array browsing, object inspecting,
etc.
f. Information doesn't scroll off the window. No limit to amount
of debugging information.
g. Double-clicking the heading of a column will optimize the
width of that column to display all data.
h. Double-clicking the data area of a column will cause the
editor to go to the associated line of code in the source
file.
Notes:
A shortened command: DD
Use this as a replacement for DCBDEBUG.
DC_DebugQoutAppendBlock() is a get-set function used to setup
additional information to append to each debug line.
Examples:
#include "dcdialog.ch"
USE COLLECT NEW SHARED
DCBDEBUG Alias(), RecCount()
DCBDEBUG RecNo() WINDOW 2 COLOR GRA_CLR_RED
Source/Library:
DCDIALOG.CH
See Also:
dc_debugbrowse()
DCQDEBUG
DCLDEBUG
dc_wtfenable()
USER-DEFINED COMMANDS
Create a User-Defined object for displaying with GUI reader
Syntax:
@ < nRow >,< nCol > MYCOMMAND < bCustom > ;
[SIZE < nWidth > [,< nHeight >]] ;
[VAR < uVar >] ;
[PARENT < oParent >] ;
[CAPTION < cCaption >] ;
[PRESENTATION < aPres >] ;
[TYPE < nType >] ;
[OBJECT < oCustom >] ;
[COLOR < ncFgC > [,< ncBgC >] ] ;
[OPTIONS < aOptions >] ;
[DATALINK < bLink >] ;
[FONT < cFont >] ;
[MESSAGE < cMsg > [INTO < oMsgBox >]] ;
[HIDE < bHide >] ;
[WHEN < bWhen >] ;
[EDITPROTECT < bProtect >] ;
[VALID < bValid >] ;
[HELPCODE < cHelpCode >] ;
[TOOLTIP < cToolTip >] ;
[ACTION < bAction >] ;
[CURSOR < nCursor >] ;
[CARGO < xCargo >] ;
[EVAL < bEval] ;
[PIXEL] ;
[RELATIVE < oRel >] ;
[ID < cId >] ;
[TITLE < cTitle >] ;
[ACCELKEY < nKey >] ;
[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.
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. This is converted to a code-block by
the function DC_GetAnchorCB() and is stored in element
oGETLIST_PARENT.
< 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.
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.
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.
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). The
code block is stored in bGETLIST_PROTECT.
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 < cToolTip > is a character string which will display
as a "Tool Tip" next to the object when the cursor is passed
over the object. The tooltip is stored in element
cGETLIST_TOOLTIP.
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. The cursor is stored
in element nGETLIST_CURSOR.
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 < nKey > is a numeric "hot-key" assignment that will set
focus to the custom 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.
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
EVAL < bEval > is a code block to evaluate after the object is
created. The object is passed to the code block as a parameter.
Description:
User-Defined Commands are similar to the @ DCCUSTOM command with
the exception that the programmer can create his/her own syntax
for the command. The Syntax and Arguments listed below are a
"suggestion" only. The only requirement is that the command
arguments are properly parsed into the GetList array. This is
accomplished by creating a custom command similar to the
"template" provided in DCUDC.CH.
A User-Defined command must add a GetList item of the type
GETLIST_USER (defined in DCDIALOG.CH) plus any numeric offset
from 0 to 1000. This allows for up to 1000 user-defined commands
in an application.
Examples:
/*
In this example, a custom command named @..FILEEDIT can be used
to edit an ASCII file. The command is used with DCREAD GUI and
can be mixed with any other UDC commands or DC* commands.
*/
#define MYGETLIST_FILEEDIT GETLIST_USER + 1
#command @ <nRow>,<nCol> FILEEDIT <(cFile)> ;
[SIZE <nWidth> [,<nHeight>]] ;
[PARENT <oParent>] ;
[PRESENTATION <aPres>] ;
[OBJECT <oCustom>] ;
[COLOR <ncFgC> [,<ncBgC>] ] ;
[FONT <cFont>] ;
[MESSAGE <cMessage>] ;
[HELPCODE <cHelpCode>] ;
[TOOLTIP <cToolTip>] ;
[<p:PIXEL>] ;
[TITLE <cTitle>] ;
[RELATIVE <oRel>] ;
[ID <cId>] ;
[ACCELKEY <nAccel>] ;
[<ro:READONLY>] ;
=> ;
AADD( GetList, ;
{ MYGETLIST_FILEEDIT, /* nGETLIST_TYPE */ ;
nil, /* nGETLIST_SUBTYPE */ ;
nil, /* cGETLIST_CAPTION */ ;
nil, /* bGETLIST_VAR */ ;
<nRow>, /* nGETLIST_STARTROW */ ;
<nCol>, /* nGETLIST_STARTCOL */ ;
nil, /* nGETLIST_ENDROW */ ;
nil, /* nGETLIST_ENDCOL */ ;
<nWidth>, /* nGETLIST_WIDTH */ ;
<nHeight>, /* nGETLIST_HEIGHT */ ;
<cFont>, /* cGETLIST_FONT */ ;
nil, /* cGETLIST_PICTURE */ ;
nil, /* bGETLIST_WHEN */ ;
nil, /* bGETLIST_VALID */ ;
<cToolTip>, /* cGETLIST_TOOLTIP */ ;
nil, /* xGETLIST_CARGO */ ;
<aPres>, /* aGETLIST_PRESENTATION */ ;
nil, /* bGETLIST_ACTION */ ;
nil, /* oGETLIST_OBJECT */ ;
nil, /* xGETLIST_ORIGVALUE */ ;
<.ro.>, /* xGETLIST_OPTIONS */ ;
[{<ncFgC>,<ncBgC>}], /* aGETLIST_COLOR */ ;
<cMessage>, /* cGETLIST_MESSAGE */ ;
<cHelpCode>, /* cGETLIST_HELPCODE */ ;
nil, /* cGETLIST_VARNAME */ ;
nil, /* bGETLIST_READVAR */ ;
nil, /* bGETLIST_DELIMVAR */ ;
[{DC_GetAnchorCB(@<oCustom>,'O'), ;
<(oCustom)>,'O'}], /* bGETLIST_GROUP */ ;
nil, /* nGETLIST_POINTER */ ;
[{DC_GetAnchorCB(@<oParent>,'O'), ;
<(oParent)>,'O'}], /* bGETLIST_PARENT */ ;
{|a|MyFileEditor(a)}, /* bGETLIST_REFVAR */ ;
nil, /* lGETLIST_READONLY */ ;
<.p.>, /* lGETLIST_PIXEL */ ;
nil, /* nGETLIST_CURSOR */ ;
nil, /* bGETLIST_EVAL */ ;
[{DC_GetAnchorCb(@<oRel>,'O'), ;
<(oRel)>,'O'}], /* bGETLIST_RELATIVE */ ;
<(cFile)>, /* xGETLIST_OPTIONS2 */ ;
nil, /* xGETLIST_OPTIONS3 */ ;
nil, /* xGETLIST_OPTIONS4 */ ;
nil, /* xGETLIST_OPTIONS5 */ ;
nil, /* xGETLIST_OPTIONS6 */ ;
nil, /* xGETLIST_OPTIONS7 */ ;
nil, /* xGETLIST_OPTIONS8 */ ;
nil, /* xGETLIST_OPTIONS9 */ ;
nil, /* cGETLIST_LEVEL */ ;
<cTitle>, /* cGETLIST_TITLE */ ;
nil, /* cGETLIST_ACCESS */ ;
nil, /* bGETLIST_COMPILE */ ;
<cId>, /* cGETLIST_ID */ ;
nil, /* dGETLIST_REVDATE */ ;
nil, /* cGETLIST_REVTIME */ ;
nil, /* cGETLIST_REVUSER */ ;
nil, /* bGETLIST_HIDE */ ;
<nAccel>, /* nGETLIST_ACCELKEY */ ;
} )
LOCAL GetList := {}
@ 1,0 DCSAY "This is my README.TXT file"
@ 3,0 FILEEDIT C:\express\readme.txt SIZE 60,10
DCREAD GUI ;
FIT ;
BUTTONS DCGUI_BUTTON_OK + DCGUI_BUTTON_CANCEL
RETURN nil
/* ----------------------- */
STATIC FUNCTION MyFileEditor ( aParams )
LOCAL oXbp, aGetList, nPointer, oParent, aPos, aSize, aPres, lVisible, ;
cFileName, cMemo, bAnchor
aGetList := aParams[1]
nPointer := aParams[2]
oParent := aParams[3]
aPos := aParams[4]
aSize := aParams[5]
aPres := aParams[6]
lVisible := aParams[7]
oXbp := XbpMLE():new( oParent, , aPos, aSize, aPres, lVisible )
cFileName := aGetList[nPointer,xGETLIST_OPTIONS2]
oXbp:editable := !aGetList[nPointer,xGETLIST_OPTIONS]
IF Valtype(cFileName) = 'C' .AND. File(cFileName)
cMemo := MemoRead(cFilename)
aGetList[nPointer,xGETLIST_CARGO] := cMemo
ELSE
cMemo := 'File: ' + cFileName + ' not found.'
oXbp:editable := .f.
ENDIF
bAnchor := AnchorCb(@cMemo)
IF Valtype(aGetList[nPointer,cGETLIST_FONT])='C'
oXbp:SetFontCompoundName(aGetList[nPointer,cGETLIST_FONT])
ENDIF
oXbp:clipSiblings := .T.
oXbp:datalink := bAnchor
oXbp:create()
oXbp:SetData()
IF oXbp:editable
oXbp:killInputFocus := ;
{|a,b,o|o:GetData(),MemoWrit(cFileName,cMemo)}
ENDIF
RETURN oXbp
*
Source/Library:
DCUDC.CH
See Also:
@ DCCUSTOM
DCUDC.CH
dc_printergroupeject()
Preview the next print group
Syntax:
DC_PrinterGroupEject( < oPrinter > ) - > nStatus
Arguments:
< 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.
Returns:
A numeric value based on the key clicked by the user.
The values are defined in "DCPRINT.CH"
RETURN VALUE Description
------------------ -------------------------------------------
DCPRINT_GROUP_FIRST Returned when "Top" button is clicked
DCPRINT_GROUP_PREV Returned when "Prev" button is clicked.
DCPRINT_GROUP_NEXT Returned when "Next" button is clicked.
DCPRINT_GROUP_LAST Returned when "Bottom" button is clicked.
DCPRINT_GROUP_NONE Returned when "Ok" or "Cancel" button is clicked.
Description:
DC_PrinterGroupEject() is used to allow for previewing of print jobs
in "groups" of pages. For example, this can be used to step through a
set of invoices in which each invoice may have a different number of
pages. Each previewed invoice will be a "group" of pages.
Clicking the "Next" group button will exit the preview window and
return a value of DCPRINT_GROUP_NEXT. By testing for this value in
the print loop the record pointer can be moved to the next invoice
for printing.
The "Print" button will print only the pages that are part of the
group and are visible in the preview window. Each time DCPRINT
GROUPEJECT is encountered in the code, control is given to the
preview window. If the user clicks on "Top", "Prev", "Next" or
"Bottom", the preview buffer is cleared and a respective numeric
value is returned to be used for selecting the next group to
preview.
Examples:
#include "dcprint.ch"
PROCEDURE XTest
DCPRINT ON PREVIEW NONSTOP HIDE GROUPBUTTONS TO oPrinter
USE INVOICES
DO WHILE .t.
PrintInvoice(oPrinter) // code to print multiple pages of invoice
nStatus := DC_PrinterGroupEject(oPrinter)
IF nStatus == DCPRINT_GROUP_FIRST
INVOICE->(dbGoTop())
ELSEIF nStatus == DCPRINT_GROUP_PREV
INVOICE->(dbSkip(-1))
ELSEIF nStatus == DCPRINT_GROUP_NEXT
INVOICE->(dbSkip(1))
ELSEIF nStatus == DCPRINT_GROUP_LAST
INVOICE->(dbGoBottom())
ELSEIF nStatus == DCPRINT_GROUP_NONE
EXIT
ENDIF
ENDDO
DC_PrinterOff(oPrinter)
RETURN
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ON
DCPRINT GROUPEJECT
DCAPICK
A dialogue for choosing a item from an array pick list.
Syntax:
@ [ < nTop >, < nLeft > ] DCAPICK < aMenuItems >
;
[SIZE < nWidth >, < nHeight >] ;
[HEADER < acHeader >] ;
[COLWIDTH < anColWidth >] ;
[TITLE < cTitle >] ;
[TAG < anTag > [COLOR < aTagColor >] ] ;
[HANDLER < bHandler >] ;
[START < nStart >] ;
[FONT < cFontName >] ;
[PARENT < oParent >] ;
[OWNER < oOwner >] ;
[CENTER >] ;
[MENU >] ;
[TO < nChoice >] ;
[NOVSCROLL] ;
[NOHSCROLL] ;
[PRESENTATION < aPres >] ;
[AUTOSEEKPICTURE < cAutoSeekPicture >] ;
[NORESTORE]
Arguments:
< nTop >, < nLeft > are the starting coordinates. These are
text-
base coordinates. These parameters are not required if the
< lCenter > parameter is used.
< aMenuItems > is an array of character strings to include
in the pick-list. This may be a single-dimension array or a
multi-dimension array.
SIZE < nWidth > and < nHeight > are the width and height of the
window in text-based coordinates.
HEADER < acHeader > is the heading to place above each column. If
< aMenuItems > is a single-dimension array, then there is only 1
header, so < acHeader > is a character string. If
< aMenuItems >
is a multi-dimension array, then < acHeader > is an array of
character strings, 1 for each column.
COLWIDTH < anColWidth > is the width of the column(s). If
aMenuItems > is a single-dimension array, then there is only 1
width, so < anWidth > is a numeric value. If < aMenuItems > is
a
multi-dimension array, then < anWidth > is an array of numeric
values, 1 for each column.
TITLE < cTitle > is the title to place at the top of the window.
TAG < anTag > is an array of logical elements or a single numeric
value. If < anTag > is an array, it must be the same length as
the array being browsed and must contain logical values. When
the user double-clicks a browse row, the corresponding element
of < anTag > will be toggled. If < anTag > is a numeric value,
then
it is a pointer to the column of < aMenuItems > that contains
logical tags.
COLOR < aTagColor > is used in conjunction with < anTag > to
select
the color for the rows that are tagged. This is a 2-element
array consisting of a foreground and background color. The
default is { GRA_CLR_WHITE, GRA_CLR_BLUE }.
HANDLER < bHandler > is a SPARE.
START < nStart > is a SPARE.
FONT < cFontName > is the font to use for the browse.
PARENT < oParent > is the parent object to create the browse. If
no parameter is passed, a dialog window will be created.
OWNER < oOwner > is the owner object of the browse. If no
parameter is passed, the owner will be the same as the parent.
CENTER will center the browse dialog on the desktop.
MENU will enable "menu mode". This allows the operator to press
keyboard keys that match the first letter of each array item to
select the item.
NOVSCROLL will suppress the vertical scroll bar.
NOHSCROLL will suppress the horizontal scroll bar.
PRESENTATION < aPres > is a presentation array that conforms to
the presentation parameters required for the XbpBrowse() class.
TO < nChoice > is the name of a variable to store the choice
selected by the user.
AUTOSEEKPICTURE < cAutoSeekPicture > if passed will cause an
autoseek GET to be created above the browse window. The value
entered into the get will be passed to DC_BrowseAutoSeek() to
seek to a value. < cAutoSeekPicture > establishes the picture clause
for the Get.
NORESTORE will override DC_AutoRestoreWindow() and insure that
the window coordinates and size are never saved and restored.
Description:
DCAPICK is used to display a browse-style picklist of an
array.
Examples:
FUNCTION XTest()
LOCAL aDir := Directory(), i, aHeaders, aWidths
FOR i := 1 TO Len(aDir)
ASize(aDir[i],5)
aDir[i,5] := .f.
NEXT
aHeaders := { 'File Name', 'File Size', 'File Date', 'File Time' }
aWidths := { 10,10,10,10 }
DCAPICK aDir ;
SIZE 50,10 ;
HEADER aHeaders ;
COLWIDTH aWidths ;
TAG 5 COLOR { GRA_CLR_WHITE, GRA_CLR_RED } ;
FONT '8.Terminal'
TITLE "Disk Directory" ;
CENTER ;
TO nChoice
RETURN nChoice
Source/Library:
DCDIALOG.CH
See Also:
dc_apick()
dc_achoice()
DCREPORT FORM
A Windows compatible replacement for REPORT FORM
Syntax:
DCREPORT FORM < frm > ;
[HEADING < heading >] ;
[PLAIN] ;
[NOEJECT] ;
[SUMMARY] ;
[NOCONSOLE] ;
[TO PRINTER] ;
[TO FILE < (toFile) >] ;
[FOR < for >] ;
[WHILE < while >] ;
[NEXT < next >] ;
[RECORD < rec >] ;
[REST] ;
[ALL] ;
[XBP] ;
[TITLEFONT < titlefont >] ;
[HEADFONT < headfont >] ;
[SIZE < nRows >,< nCols >] ;
[FONT < font >] ;
[PREVIEW] ;
[PRINTER @< oPrinter >] ;
[TEXTONLY] ;
[ACROBAT] ;
[OPTIONS < aDefaultOptions >]
;
Arguments:
< xcReport > is the name of the report form (.frm) file that contains
the definition of the REPORT. If an extension is not specified, (.frm)
is assumed. < xcReport > can be specified as a literal string or as a
character expression enclosed in parentheses.
TO PRINTER echoes output to the printer.
TO FILE < xcFile > echoes output, without formfeed characters (ASCII
12), to a file. If a file extension is not specified, a (.txt) is
added. You can specify < xcFile > as a literal string or as a
character expression enclosed in parentheses.
NOCONSOLE suppresses all REPORT FORM output to the console. If not
specified, output automatically displays to the console unless SET
CONSOLE is OFF.
< scope > is the portion of the current database file to report. The
default scope is ALL.
WHILE < while > specifies the set of records meeting the
condition from the current record until the condition fails.
FOR < for > specifies the conditional set of records to report
within the given scope.
NEXT < next > is the number of records to print.
REST will print the remaining records to the end of file.
ALL will print all records.
RECORD < rec > will print only record number < rec >.
PLAIN suppresses the display of the date and page number, and
causes the report to print without page breaks. In addition, the
report title and column headings display only at the top of the
report.
HEADING places the result of < cHeading > on the first line of each
page. < cHeading > is evaluated only once at the beginning of the
report, before the record pointer is moved. If both PLAIN and
HEADING are specified, PLAIN takes precedence.
NOEJECT suppresses the initial page eject when the TO PRINTER
clause is used.
SUMMARY causes the REPORT FORM to display only group, subgroup,
and grand total lines. Detail lines are suppressed.
XBP causes the form to be printed using the XbpPrinter() class
rather than the standard LPTx device. If option is not specified
then the remaining arguments are ignored and the printed output
follows path established by standard text-based commands like
SET PRINTER TO < cPath >. If XBP is specified, then a printer dialog
will be displayed which gives the user the option of directing the
printed output to a Windows device.
FONT < cFont > is the font to use for the body of the report.
TITLEFONT < cTitleFont > is the font to use for the title of the
report.
HEADFONT < cHeadFont > is the font to use for the column headings.
SIZE < nRows, nCols > is the number of rows and columns on the
printed page. This does not override the settings in the .FRM
file but instead is used to determine establish a pixel resolution
for the page. For example, if the report uses 132-character
columns, it is recommended that you also use 132 columns as the
size. If a large number is used, the report will be more
compressed.
PREVIEW will display the report within a window and allow the
user to preview the output on the screen rather than sending it
to the printer.
PRINTER @< oPrinter > is a printer object created with the DCPRINT ON
command. If this clause is not used or < oPrinter > is initalized
to a NIL then a new printer object will be created an stored in
< oPrinter >.
TEXTONLY will output the report in text-only mode. The user will
be prompted for the name of a text file to create unless the
TO FILE < xcFile > clause is used. Only text commands will be
processed in TEXTONLY mode.
ACROBAT is used to invoke Acrobat Reader as the the print
previewer for a much more WYSIWIG preview of the print job.
To use this clause both the Acrobat Reader 5.0
(http://www.adobe.com) and the Win2PDF driver
(http://daneprarie.com) must be installed. The Acrobat
Reader is free and the Win2PDF driver is $39.00. The demo
version is included. The Win2PDF driver works only on
Windows NT, 2000 and XP.
OPTIONS < aDefaultOptions > is used to establish the default
options for print jobs. < aDefaultOptions > is an array that was
previously created by the DCPRINT OPTIONS command.
Description:
DCREPORT FORM provides the same functionality as the Clipper
REPORT FORM command, in that it uses .FRM files, except that it
allows for printing to any Windows print device like local and
network printers or fax. It also provides the option of
"previewing" the printed output.
Examples:
#include "dcprint.ch"
PROCEDURE XTest( lPreview )
lPreview := IIF( Valtype(lPreview)='L',lPreview,.t.)
USE collect NEW
GO TOP
DCPRINT OPTIONS ;
FONT '8.Courier New' ;
SIZE 60,132 ;
NAME 'Win2PDF' ;
TO aAltOptions
IF lPreview
DCREPORT FORM collect XBP FONT '10.Courier' ;
TITLEFONT '10.Helv.Bold' HEADFONT '10.Courier.Bold' PREVIEW ;
OPTIONS aAltOptions
ELSE
DCREPORT FORM collect XBP FONT '10.Courier' ;
TITLEFONT '10.Helv.Bold' HEADFONT '10.Courier.Bold' ;
OPTIONS aAltOptions
ENDIF
RETURN
Source/Library:
DCPRINT.CH
See Also:
DCPRINT ON
dc_setwindowtransparency()
Sets a Dialog Window to any transparency from 0% to 100%
Syntax:
DC_SetWindowTransparency( < oDlg >, ;
< nPercent > ) - > Nil
Arguments:
< oDlg > is an object that is derived from the XbpDialog class and
is currently hidden with the :hide() method.
< nPercent > is the amount of transparency.
Returns:
Nil.
Description:
DC_SetWindowTransparency() will set a dialog window to any
transparency from 0% to 100%.
Source/Library:
_DCFUNCT.PRG, DCLIPX.DLL
See Also:
dc_zoomtransparent()