DUAL-Mode functions 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.).
Functions in the DCLIPX.DLL dynamic-link library all start
with the prefix DC_. The DCLIPX.DLL file is one of the
libraries that are included with the dCLIP++ Application
Development System, and your eXPress++ system is fully
compatible with dCLIP++ in the event that at some time you
wish to upgrade and utilize the dCLIP++ design tools.
General functions are those which have been designed to work
identically in either TEXT mode or GUI mode. These functions
do not create any output to the screen in either mode,
therefore they can be used freely without regard to the
screen mode, DC_GUI().
Functions in the DCLIPX.DLL dynamic-link library all start
with the prefix DC_. The DCLIPX.DLL file is one of the
libraries that are included with the dCLIP++ Application
Development System, and your eXPress++ system is fully
compatible with dCLIP++ in the event that at some time you
wish to upgrade and utilize the dCLIP++ design tools.
GUI functions are designed to work only in GUI mode. When any of
these functions are used they ignore the setting of the DC_Gui()
flag.
Text-Mode functions are designed to work only in TEXT mode.
When any of these functions are used they ignore the setting of
the DC_Gui() flag and require that the SetAppWindow() be a CRT
window (XbpCrt Class).
DC_ABigElem ( < aArray >, ;
[@< nLength >] ) - > nElement
< aArray > is the name of any single-dimensional array that is fill with character strings. @< nLength > is the name of a variable to place the length of the item returned.
A number equivalent to the element of the array with the
longest string.
DC_ABIGELEM() will return the element number of the longest
string in a single-dimensional array.
. nLength := 0
. aTest := { 'abc','abcdef','abcde','abcd' }
. ? DC_ABIGELEM( aTest, @nLength )
2
. ? nLength
6
_DCARRAY.PRG, DCLIP1.DLL
DC_AChoice ( < nTop >, < nLeft >, < nBottom >, < nRight >, ;
< aMenuItems >, ;
[< aSelItems >], ;
[< cUserFunc > | < bUserFunc >], ;
[< nInitialItem >], ;
[< nWindowRow >], ;
[< aButtons >], ;
[< aOptions >], ;
[< aHelpCodes >], ;
[< aMenu >], ;
[< lAttachMenu >] ) - > nPosition
< nTop >, < nLeft >, < nBottom >, < nRight > are the screen
coordinates.
< aMenuItems > is an array of character strings to include
in the pick-list.
< aSelItems > is an array of logical values. There is one
element in this optional array for each element in
< aMenuItems >. Each element in < aSelItems > that is a
.TRUE. will make the item in the window a "selectable"
item, otherwise it will be a non-selectable item and will
be displayed in "grayed" form.
< cUserFunc > | < bUserFunc > is the name of an optional User-Defined
function to call on exception keystrokes. See the Clipper
documentation of ACHOICE() for more information on how to use
a UDF. If the parameter is passed as a character string then
the function must be a PUBLIC, not STATIC function.
< nInitialItem > is the item to high-light in the window on
startup.
< nWindowRow > is the item to display as the first item in
the pick-list.
< aButtons > is an array of mouse-keys that conforms to the
specification for DC_MOUSEKEY(). See DC_MOUSEKEY() for
more information.
< aOptions > is a multi-dimensional array of the following
options:
Element Type Description
------- ---- ----------------------------------------------
[1] L If .TRUE. will display a scrollbar and box
around the menu items.
[2] A A sub-array of colors to use if element [1] is
.FALSE. If passed as a NIL then the Clipper
default colors will be used.
Element Type Description
------- ---- ----------------------------
[1] C Menu items color
[2] C Select bar color
[3] C Frame/scrollbar color
[4] C Spare
[5] C Unselectable items color
[3] C Title on top of box. Default is none.
[4] L If .TRUE. then the operator will be allowed to
drag the box with the mouse. Default is .FALSE.
[5] L If .TRUE. then the display will be restored
upon exit, otherwise it will remain.
[6] L If .TRUE. then the frame, scroll-bar and title
will be painted, otherwise only the items will
be painted.
[7] L If .TRUE. then after painting the scroll-bar,
items and frame, DC_ACHOICE() will exit without
waiting for a key or mouse-click.
< aHelpCodes > is an array of character string HELP CODES.
There is one element in this optional array for each element in
< aMenuItems >. The HELP CODE will be passed on to the
DC_HelpF1() function for context-specific help if the operator
presses F1 on a selected item.
< aMenu > is an array defining a Top-Bar/Pull-Down menu. This
array must conform to the specification for the array passed
to the DC_MENUMAIN() function. This Top-Bar menu will be
painted at the screen coordinates defined in the menu if
< lAttachMenu > is .FALSE. or directly attached to the top of
the pick-list window if < lAttachMenu > is .FALSE. (default).
The menu will be energized if the operator presses a key
matching one of the hightlighted characters in the menu, or
if the mouse is clicked on one of the top-bar menu items.
The menu array must contain code-blocks for each menu item
to execute functions based on the menu selection. See
DC_MENUMAIN() for more information.
DC_ACHOICE() is a Dual-mode replacement for AChoice(). When
the GUI flag is ON, DC_ACHOICE() functions similiar to
AChoice() except that it is displayed in GUI mode. When the
GUI flag is OFF, DC_ACHOICE() functions identical to ACHOICE()
except it is also activated by a mouse. The left button of the
mouse is used to select the item in the window. The right button
or double-clicking works identical to the ENTER key.
In TEXT mode, Hot keys can be activated by passing an array of
screen coordinates (mouse-buttons) and key definitions.
In TEXT mode, an options array is used to define scroll-bars,
colors, exit options, title, drag options, etc.
An optional array of Help-Codes may be passed for context-
specific help on any selected item with the F1 key.
local nChoice
local aButtons := { { 17,13,17,18,'C'},;
{ 18,13,18,18,'D'},;
{ 19,13,19,18,'M'} }
local aDir := directory()
set key asc('C') to myfunc
set key asc('D') to myfunc
set key asc('M') to myfunc
cls
@5,10 to 20,30
@16,11 to 16,29
@17,13 say 'Copy'
@18,13 say 'Delete'
@19,13 say 'Move'
aDir := dc_aconvert( aDir )
nChoice := DC_ACHOICE( 6,11,15,29,aDir[1],,,,,aButtons )
set key asc('C') to
set key asc('D') to
set key asc('M') to
return
function myfunc
@ 22,10 say ''
do case
case lastkey() = asc('C')
?? 'C button pressed'
case lastkey() = asc('D')
?? 'D button pressed'
case lastkey() = asc('M')
?? 'M button pressed'
endcase
return nil
_DCACHOI.PRG/.OBJ, DCLIPX.LIB
dc_dbchoice() dc_readapick() dc_apick()
DC_ACompare ( < aArray1 >, ;
< aArray2 > ) - > lStatus
< aArray1 > and < aArray2 > are the arrays to compare.
A logical .TRUE. if the arrays are identical, .FALSE. otherwise.
DC_ACOMPARE() is used to test the contents of two arrays to
determine if they are identical.
PROCEDURE Xtest()
LOCAL aArray1, aArray2, aArray3
aArray1 := { 1,2,3 }
aArray2 := { '1',2,3, }
aArray3 := { 1,2,3 }
DC_Gui(.t.)
DC_MsgBox( { 'Is aArray1 equal to aArray2?', ;
'',;
DC_ACOMPARE(aArray1,aArray2) } )
DC_MsgBox( { 'Is aArray1 equal to aArray3?', ;
'',;
DC_ACOMPARE(aArray1,aArray3) } )
RETURN
_DCARRAY.PRG/.OBJ, DCLIPX.LIB
DC_AConvert ( < aInput > ) - > aOutput
< aInput > is a Parallel Symmetrical array or Ragged Symmetrical
array.
Example of a "Parallel Symmetrical array":
Type Contents
aStru[1] A
aStru[1,1] C CUST_NAME
aStru[1,2] C SHIP_DATE
aStru[1,3] C BALANCE
aStru[1,4] C PRINT_FLAG
aStru[2] A
aStru[2,1] C C
aStru[2,2] C D
aStru[2,3] C N
aStru[2,4] C L
aStru[3] A
aStru[3,1] C 25
aStru[3,2] C 8
aStru[3,3] C 9
aStru[3,4] C 1
aStru[4] A
aStru[4,1] N 0
aStru[4,2] N 0
aStru[4,3] N 2
aStru[4,4] N 0
Example of a "Ragged Symmetrical array":
Type Contents
aStru[1] A
aStru[1,1] C CUST_NAME
aStru[1,2] C C
aStru[1,3] C 25
aStru[1,4] N 0
aStru[2] A
aStru[2,1] C SHIP_DATE
aStru[2,2] C D
aStru[2,3] C 8
aStru[2,4] N 0
aStru[3] A
aStru[3,1] C BALANCE
aStru[3,2] C N
aStru[3,3] C 9
aStru[3,4] N 2
aStru[4] A
aStru[4,1] C PRINT_FLAG
aStru[4,2] C L
aStru[4,3] C 1
aStru[4, ] N 0
An array whose elements contain the same information as the
input array but are in "inverted" order.
DC_ACONVERT() is used to changed the format of a symmetrical
array from "Ragged" to "Parallel" or vice-versa. This function
is handy when information in an array may not be stored in a
required format. For example, it is not easy to perform
"pick-list" operations from "Ragged" arrays or to AEVAL()
"Parallel" arrays.
PROCEDURE XTest()
LOCAL aRaggedDir, aParallelDir, nChoice
// Converting a Ragged array to a Parallel array
aRaggedDir := Directory()
aParallelDir := DC_ACONVERT( aRaggedDir )
DC_Gui(.t.)
nChoice := DC_Achoice( 10,10,20,40, aParallelDir[1] )
DC_MsgBox( 'The size of ' + aParallelDir[1,nChoice] + ' is ' + ;
Str( aParallelDir[2,nChoice] ) )
RETURN
_DCARRAY.PRG/.OBJ, DCLIPX.LIB
dc_areverse()
DC_AddCargo ( < GetList >, ;
< xCargo > ) - > GetList
< GetList > is the GetList array.
< xCargo > can be one of several numeric values or an array.
xCargo Description
------ ----------------------------------------
101 Force this GET to validate
102 Display Pick-list pointer icon (arrow)
{103,bBlock} Pre-Evaluate Code-Block
{104,bBlock} Post-Evaluate Code-Block
{105,aMsg} Message to display on screen
106 Protect this GET from editing
107 Capitalize first character of each word
{108,aData} SAY prompt and coordinates
A pointer to the <þGetListþ> passed to DC_ADDCARGO().
DC_ADDCARGO() is used to add cargo to the an array that
is contained in the CARGO instance variable of the last
GET in a GetList array.
DC_READMODAL() automatically looks at the information in
CARGO to give added functionality to the GET system.
CARGO is used to store array pointers, screen SAY
information and other GET options.
#include "dcget.ch"
LOCAL GetList := {}, aData, i
use
aData := Array(Fcount())
FOR i := 1 TO LEN( aData )
aData[i] := FieldGet(i)
NEXT
DC_ReadWindow( { 10, 10, 20, 60 } )
FOR i := 1 TO LEN(aData)
DC_GetDevOut( i, 12, PadL(Field(i),10), )
SetPos( Row(), Col()+1 )
AAdd( GetList,_GET_(aData[i],"aData[i]",,,) )
DC_GetDisplay( GetList )
/* -- Add array element pointer -- */
GetList := DC_ADDCARGO(GetList,-1*i)
/* -- Add SAY Prompt and location -- */
GetList := ;
DC_ADDCARGO(GetList,{ 108, { i, 12, PadL(Field(i),10) }})
/* -- Add CAPFIRST flag -- */
GetList := DC_ADDCARGO(GetList,107)
NEXT
DC_ReadModal( GetList,,aReadArea )
RETURN nil
_DCGETSY.PRG/.OBJ, DCLIPX.LIB
dc_readmodal() dc_readbox()
DC_AddRec ( [< nWaitTime >], ;
[< lDisplayError >], ;
[< nAppendMode >] ) - > lStatus
< nWaitTime > is the number of seconds to wait for the system to return a lock before returning the status or the error message. (0 = wait forever). < lDisplayError > if .true. will display an operator error message if the record cannot be locked. (default) or if .false. will not display an error message to the operator. < nAppendMode > is a number from 0 to 2 (0 is the default) to establish the mode for reusing deleted or blank records, if they exist, or appending a new record. See DC_APPENDMODE().
A logical .TRUE. if the record is successfully locked.
The function of DC_ADDREC() is dependent on the APPEND MODE of
operation that was previously selected by the DC_APPENDMODE()
function.
If the Append Mode is 0 (default), then DC_ADDREC() will always
append a Blank record.
If the Append Mode is 1, then DC_ADDREC() will first try to
locate any existing Blank record in the database. If a Blank
record is found, the record pointer will be set to the found
record and the record will be locked. This mode functions
differently based on whether or not the current work area
has an index selected. If an index is selected, then it is
assumed that blank records will always appear at the TOP of
the database so only the first record is tested, otherwise
the entire database will be search for a blank record.
If the Append Mode is 2, then DC_ADDREC() will first try to
locate any existing record that is marked for deletion. If
a deleted record is found, the record pointer will be set
to the found record, the record will be recalled (undeleted),
all fields will be blanked, and the record will be locked.
dc_appendmode(1) // reuse blank records
use sales
if DC_ADDREC()
replace date with date()
else
break
endif
_DCLOCK.PRG, DCLIP1.DLL
dc_reclock() dc_filock() dc_appendmode() APPEND LOCK UNLOCK
DC_AddSetKeys( < aGetList > ) - > aGetList
< aGetList > is the GetList array that will be passed to DC_ReadGUI().
A GetList array with all hotkeys added.
DC_ADDSETKEYS is used to read the current SET KEYS and add them
to the GetList as DCHOTKEY commands.
FUNCTION XTest()
LOCAL GetList := {}, dDate := Date(), nNumber := 0
SET KEY -2 TO DC_PopDate()
SET KEY -3 TO DC_PopCalc()
@ 1,1 DCSAY ' Enter a Date' GET dDate
@ 3,1 DCSAY 'Enter a Number' Get nNumber
@ 5,1 DCSAY 'Press F3 for a Calendar' SAYSIZE 30
@ 6,1 DCSAY 'Press F4 for a Calculator' SAYSIZE 30
DC_ADDSETKEYS(GetList)
DCREAD GUI FIT ADDBUTTONS
RETURN nil
_DCFUNCT.PRG/.OBJ, DCLIPX.LIB
dc_readgui() DCHOTKEY
DC_Alert ( < cText >, ;
< aMenuItems >, ;
[< cColorString >], ;
[< lJustify >], ;
[< aMenuId >], ;
[< cMenuName >], ;
[< nChoice >], ;
[< aFonts >] ) - > nChoice
< cText > is the message to place in the alert box. Use
semicolons in the text to separate lines of text.
< aMenuItems > is an array of menu choices. The character
following the '~' character will be highlighted.
< cColorString > is an optional color string containing
exactly 4 colors separated by commas:
(1) box and message.
(2) unselected menu items.
(3) hot-key character of each unselected menu item
(4) selected menu item
< lJustify > if .TRUE. will left-justify the message items.
Default is .FALSE.
< aMenuId > - An optional array of unique Menu ID codes (up to 8
characters) for each menu item in < aItems >. This array is
needed to enable the PERSISTENT MENU SELECTION feature. See
DC_MenuPull() for more information.
< cMenuName > - An optional parameter with a "unique" name for
this menu. This name is needed to enable the PERSISTENT MENU
SELECTION feature. See DC_MenuPull() for more information.
< nChoice > is the default menu selection.
< aFonts > is a 2-element array containing the Font Compound Name
for the buttons and the text. Element 1 is the button font and
element 2 is the text font. This parameter is used in GUI mode
only.
A number equal to the menu choice. Returns 0 if user
presses ESCape.
DC_ALERT() is a Dual-mode replacement for Alert(). When
the GUI flag is ON, DC_ALERT() functions similiar to
Alert() except that it is displayed in GUI mode. When the
GUI flag is OFF, DC_ALERT() functions identical to Alert()
except it is also activated by a mouse. The left button of the
mouse is used to select the item in the window.
The foreground and background color of the GUI alert box is preset by the function DC_AlertColor().
PROCEDURE XTest()
LOCAL nChoice
DC_Gui(.t.)
nChoice := DC_ALERT( "The printer is not ready",;
{ 'Retry','Abort','Output to a file' } )
DC_MsgBox( 'You chose ' + Str(nChoice) )
RETURN
_DCMENU2.PRG/.OBJ, DCLIPX.LIB
dc_msgbox() dc_guialert()
DC_AndBits( < nNum1 >, ;
< nNum2 > ) - >nResult
< nNum1 > and < nNum2 > are numeric values from 0 to 255.
A numeric value from 0 - 255
DC_ANDBITS() will produce the result of logically ANDing two bytes.
_DCAND.PRG/.OBJ, DCLIPX.LIB
dc_bittest() dc_xorbits()
DC_APick ( [< nTop >], [< nLeft >], < nWidth >, < nHeight >, ;
< aMenuItems >, ;
[< acHeader >], ;
[< anWidth >], ;
[< cTitle >], ;
[< anTag >], ;
[< aTagColor >], ;
[< bHandler >], ;
[< nStart >], ;
[< cFontName >], ;
[< oParent >], ;
[< oOwner >], ;
[< lCenter >], ;
[< lMenu >], ;
[< lNoVScroll >], ;
[< lNoHScroll >], ;
[< aPres >] ) - > nChoice
< nTop >, < nLeft > are the starting coordinates. These are text-
base coordinates. These parameters are not required if the
< lCenter > parameter is used.
< nWidth > and < nHeight > are the width and height of the window
in text-based coordinates.
< 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.
< 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.
< anWidth > 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.
< cTitle > is the title to place at the top of the window.
< 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.
< 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 }.
< bHandler > is a SPARE.
< nStart > is the starting element in the browse.
< cFontName > is the font to use for the browse.
< oParent > is the parent object to create the browse. If no
parameter is passed, a dialog window will be created.
< oOwner > is the owner object of the browse. If no parameter is
passed, the owner will be the same as the parent.
< lCenter > if .TRUE. will center the browse dialog on the desktop.
< lMenu > if .TRUE. 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.
< lNoVScroll > if .TRUE. will suppress the vertical scroll bar.
The default is .FALSE.
< lNoHScroll > if .TRUE. will suppress the horizontal scroll bar.
The default is .FALSE.
< aPres > is an array of presentation parameters that must conform
to the presParam specifications for the XbpBrowse() class.
A Numeric Value equivalent to the selected row.
DC_APick() is used to display a browse-style picklist of an array.
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 }
nChoice := DC_APick ( , , 50, 10, aDir, ;
aHeaders, aWidths, 'Disk Directory', 5, ;
{ GRA_CLR_WHITE, GRA_CLR_RED }, ;
nil, nil, '8.Terminal', nil, nil, .t. )
RETURN nChoice
_DCACHOI.PRG/.OBJ, DCLIPX.LIB
DCAPICK dc_achoice()
DC_AppendMode ( < nMode > ) - > nOldMode
< nMode > is a number designating the desired append mode. If the Append Mode is 0 (default), then DC_ADDREC() will always append a Blank record. If the Append Mode is 1, then DC_ADDREC() will first try to locate any existing Blank record in the database. If a Blank record is found, the record pointer will be set to the found record and the record will be locked. This mode functions differently based on whether or not the current work area has an index selected. If an index is selected, then it is assumed that blank records will always appear at the TOP of the database so only the first record is tested, otherwise the entire database will be search for a blank record. If the Append Mode is 2, then DC_ADDREC() will first try to locate any existing record that is marked for deletion. If a deleted record is found, the record pointer will be set to the found record, the record will be recalled (undeleted), all fields will be blanked, and the record will be locked.
A numeric value representing the current append mode.
DC_APPENDMODE() is used to establish the default operation of
the DC_ADDREC() function. Depending on the mode selected
DC_ADDREC() will attempt to reuse blank records or deleted
before appending a new, blank record.
use sales
set index to month
DC_APPENDMODE(1) // re-use blank records
if dc_addrec()
replace date with date()
else
break
endif
_DCLOCK.PRG, DCLIP1.DLL
dc_addrec()
DC_AppEvent( @< lOk >, ;
< nExitEvent >, ;
< nDelay > ) - > nLastEvent
@< lOk > is an optional logical value (passed by reference). DC_AppEvent() will exit and return when this value is set to .FALSE. < nExitEvent > is an optional numeric value. DC_AppEvent() will exit and return when the next event in the event queue is equal to this value. < nExitEvent > defaults to 0, meaning that the loop will exit when no more events are in the event queue. < nDelay > is the amount of delay to use when DC_AppEvent() calls the AppEvent() function. This defaults to 0, meaning that event loop will not exit until an event occurs. If < nDelay > is any value greater than 0, then this is amount of delay before the AppEvent() function exits. < nDelay > should usually be set to a value of .01 when using DC_AppEvent() to process events while still processing other code. See the example.
A numeric value equal to the last event processed in the loop.
DC_APPEVENT() is a handy function that creates an event loop for
processing events. Unlike the Xbase++ AppEvent() function,
DC_APPEVENT() contains a DO..WHILE loop that processes events as
a single function call.
/*
This example uses DC_APPEVENT() to abort a COPY TO process.
*/
#include 'dcdialog.ch'
FUNCTION XTest()
LOCAL Getlist := {}, oProgress, oDialog, lOk := .t., oButton, ;
nEvent, mp1, mp2, oXbp
USE COLLECT VIA DBFNTX NEW SHARED
@ 2,5 DCSAY 'Exporting Data to JUNK.DBF'
@ 4,5 DCPROGRESS oProgress ;
SIZE 55,1.5 ;
MAXCOUNT RecCount() COLOR GRA_CLR_BLUE
@ 4,65 DCPUSHBUTTON CAPTION '&Cancel' ;
ACTION {||lOk:=.f.} OBJECT oButton ;
SIZE 8,1.5
DCREAD GUI TITLE 'My Test Dialog' ;
PARENT @oDialog ;
FIT ;
EXIT
oDialog:show()
COPY TO junk WHILE _Progress( oProgress, @lOk )
oButton:SetCaption('&Ok')
DC_APPEVENT( @lOk )
oDialog:Destroy()
CLOSE ALL
RETURN nil
/* ----------------- */
STATIC FUNCTION _Progress ( oProgress, lOk )
DC_GetProgress( oProgress, COLLECT->(RecNo()) )
DC_Pause(.3)
DC_APPEVENT( @lOk, 0, .01 )
RETURN lOk
_DCGETBX.PRG/.OBJ, DCLIPX.LIB
DC_AppEventDefine( < nEvent > ) - > cDefinition
< nEvent > is the AppEvent() to translate.
A Character string.
DC_APPEVENTDEFINE() returns a character string that contains
the DEFINITION name for the AppEvent() value. These defines are
contained in APPEVENT.CH.
This is a handy debugging function that can be used in event
loops to display events as they are occurring like so:
DO WHILE nEvent # xbeP_None
nEvent := AppEvent( @mp1, @mp2, @oXbp )
? DC_APPEVENTDEFINE( nEvent )
oXbp:HandleEvent( nEvent, mp1, mp2 )
ENDDO
#include 'appevent.ch'
PROCEDURE XTest()
DC_Gui(.t.)
DC_MsgBox( { DC_APPEVENTDEFINE( xbeP_Close ), ;
DC_APPEVENTDEFINE( xbeP_Resize ), ;
DC_APPEVENTDEFINE( xbeP_Activate ) } )
RETURN
_DCPUTK.PRG/.OBJ, DCLIPX.LIB
dc_keytran() dc_appkeydefine()
DC_AppKeyDefine( < nKey > ) - > cDefinition
< nKey > is the AppEvent() value of the key to translate.
A Character string.
DC_APPKEYDEFINE() returns a character string that contains the
DEFINITION name for the AppEvent() a keyboard value. These
defines are contained in APPEVENT.CH.
This is a handy debugging function that can be used in event
loops to display events as they are occurring like so:
DO WHILE nEvent # xbeP_None
nEvent := AppEvent( @mp1, @mp2, @oXbp )
IF nEvent = xbeP_Keyboard
? DC_APPKEYDEFINE( mp1 )
ENDIF
oXbp:HandleEvent( nEvent, mp1, mp2 )
ENDDO
#include 'appevent.ch'
PROCEDURE XTest()
DC_Gui(.t.)
DC_MsgBox( { DC_APPKEYDEFINE( xbeK_ALT_M ), ;
DC_APPKEYDEFINE( xbeK_ENTER ), ;
DC_APPKEYDEFINE( xbeK_INS ) } )
RETURN
_DCPUTK.PRG/.OBJ, DCLIPX.LIB
dc_keytran() dc_appeventdefine()
DC_Ar2Str ( < aArray > ) - > cString
< aArray > is any multidimenstional array.
A character string.
DC_Ar2Str() will convert the contents of any multi-dimensional
array to a string for later restoring with DC_Str2Ar(). The
string may then be saved to a file or to a character or memo
type database field. This set of functions is an alternative
to using the Xbase++ functions Var2Bin() and Bin2Var() because
they will create a runtime error if the array contains code
blocks with non-persistent data.
If the array contains code blocks, the code blocks will be
saved and restored provide that they contain persistent data.
Any code block that contains non-persistent data will be
saved as a NIL.
If the array contains pointers to objects, they pointers will
be saved as a NIL.
PROCEDURE XTest()
LOCAL aDir
aDir := Directory()
USE dirs
APPEND BLANK
REPL DIRS->array WITH DC_Ar2Str(aDir)
aDir := DC_Str2Ar(DIRS->array)
DC_ArrayView(aDir)
RETURN
_DCASAVE.PRG/.OBJ, DCLIPX.LIB
dc_str2ar() dc_asave()
DC_ARestore ( < cFileName > ) - > aArray
< cFileName > is the name of the binary file that was previously created with DC_ASAVE().
A multidimensional array if the array file was a valid file,
otherwise returns a NIL.
DC_ARESTORE() will create an multidimensional array from the
contents of a binary file that was created with DC_ASAVE().
If the array contains code blocks, the code blocks will be
saved and restored provide that they contain persistent data.
Any code block that contains non-persistent data will be
restored as a NIL.
If the array contains pointers to objects, they pointers will
be restored as a NIL.
PROCEDURE XTest()
LOCAL aDir1, aDir2
DC_Gui(.t.)
aDir1 := Directory()
dc_asave( aDir1, 'ADIR.ARX' )
aDir2 := DC_ARESTORE( 'ADIR.ARX' )
DC_Achoice( 5,10,20,30, DC_AConvert( aDir2 )[1] )
RETURN
_DCASAVE.PRG/.OBJ, DCLIPX.LIB
dc_asave() RESTORE ARRAY
DC_AReverse ( < aArray > ) - > aNewArray
< aArray > is the name of the array to reverse.
An array of the same length as the original array.
DC_AREVERSE() is used to sort all the elements of an array
in reverse order from the original array.
myArray := { 1, 2, 'test', .t. }
outArray := DC_AREVERSE( myArray )
// contents of outArray : { .t., 'test', 2, 1 }
_DCARRAY.PRG, DCLIP1.DLL
dc_aconvert()
DC_Array_Read ( < cArrayFile > ) - > aArray
< cArrayFile > is the name of the array text file to read.
A multi-dimensional array built from the contents of <þcArrayFileþ>.
DC_ARRAY_R() is used to create a multi-dimensional array
from the contents of an array text file. Only elements of the
type L (logical), N (numeric), C (character), D (date), A
(array) can be saved and restored.
PROCEDURE XTest()
LOCAL aDir1, aDir2, cScrn
DC_Gui(.t.)
cScrn := DC_WaitOn()
aDir1 := directory()
dc_array_w( aDir1, "DIR.AR" )
aDir2 := DC_ARRAY_R( "DIR.AR" )
DC_Impl(cScrn)
DC_Achoice( 5,10,20,30, DC_AConvert( aDir2 )[1] )
RETURN
_DCARRAY.PRG/.OBJ, DCLIPX.LIB
RESTORE ARRAY dc_array_w()
DC_Array_Write ( < aArray >, ;
< cArrayFile > ) - > lStatus
< aArray > is the name of the multi-dimensional array to save. < cArrayFile > is the name of the array text file to write.
.TRUE. if the array file was created, .FALSE. otherwise.
DC_ARRAY_W() is used to save a multi-dimensional array to
an array text file for later restoring with the DC_ARRAY_R()
function for RESTORE ARRAY command. Only elements of the type
L (logical), N (numeric), C (character), D (date), A (array)
can be saved and restored.
PROCEDURE XTest()
LOCAL aDir1, aDir2, cScrn
DC_Gui(.t.)
cScrn := DC_WaitOn()
aDir1 := directory()
DC_ARRAY_W( aDir1, "DIR.AR" )
aDir2 := dc_array_r( "DIR.AR" )
DC_Impl(cScrn)
DC_Achoice( 5,10,20,30, DC_AConvert( aDir2 )[1] )
RETURN
_DCARRAY.PRG/.OBJ, DCLIPX.LIB
dc_array_r()
DC_Array2Prg ( < aArray >, ;
< cFileName >, ;
[< cFunction >], ;
[< cComments >], ;
[< cCode >] ) - > lStatus
< aArray > is the name of the array to write. < cFileName > is the name of the file to create. < cFunction > is the name of the function to call that will return the array contents. If this parameter is not passed then the function will be given the same name as the file. < cComments > is any comment heading to place at the top of the file. < cCode > is any source code that should be executed at the beginning of the function before returning the array contents.
A logical .t. if the file was created.
DC_ARRAY2PRG() is used to create a .PRG file from the contents
of a multi-dimensional array. This allows the programmer
to capture the contents of any array to a source code file
that can be compiled and run to rebuild the array.
If the file being created already exists, then the user
will be prompted to Append, Overwrite or Abort the
operation.
-- Example 1 --
. aMyArray := directory()
. DC_ARRAY2PRG( aMyArray, "MYDIR" )
. clip mydir // compile mydir.prg
. obj mydir // load mydir.obj
. aNewArray := MYDIR()
-- Example 2 --
. use all like cust*
. browse tile // configure browse windows
. DC_ARRAY2PRG( DCBROWSE, 'MYBROWSE' )
. clip mybrowse // compile mbrowse.prg
. obj mybrowse // load mybrowse.obj
. release dcbrowse // kill old browse array
. dcbrowse := MYBROWSE()
_DCARRAY.PRG, DCLIP1.DLL
dc_asave()
DC_ArrayView( < aArray > | < oObject >, ;
[< lExpand >] ) - > nil
< aArray > is any type of array. < oObject > is any type of object. < lExpand > if .TRUE. will expand the tree. The default is .FALSE.
NIL.
DC_ARRAYVIEW() is used to browse multidimensional arrays
and/or objects using a Tree-View style browser.
The array can be any type of array with any dimensions and may
contain any type of data. When expanding the array tree, the
user has the option of opening a new window to display the
contents of the sub-tree. When expanding an object, the user
has the option of displaying the properties of the object
using DC_InspectObject().
PROCEDURE XTest()
LOCAL aDir
aDir := directory()
DC_ArrayView( aDir )
RETURN
_DCARRAY.PRG/.OBJ, DCLIPX.LIB
dc_inspectobject()
DC_ASave ( < aArray >, ;
< cFileName > ) - > lStatus
< aArray > is any multidimenstional array. < cFileName > is the name of the binary file to create with the array contents.
A logical .TRUE. if the array file was created, .FALSE.
otherwise.
DC_ASAVE() will save the contents of any multi-dimensional
array to a binary file for later restoring with DC_ARESTORE().
If the array contains code blocks, the code blocks will be
saved and restored provide that they contain persistent data.
Any code block that contains non-persistent data will be
saved as a NIL.
If the array contains pointers to objects, they pointers will
be saved as a NIL.
PROCEDURE XTest()
LOCAL aDir1, aDir2
DC_Gui(.t.)
aDir1 := Directory()
DC_ASAVE( aDir1, 'ADIR.ARX' )
aDir2 := DC_Arestore( 'ADIR.ARX' )
DC_Achoice( 5,10,20,30, DC_AConvert( aDir2 )[1] )
RETURN
_DCASAVE.PRG/.OBJ, DCLIPX.LIB
dc_arestore() SAVE ARRAY
DC_At_Clear() - > nil
None
NIL
DC_AT_CLEAR() is used to clear the array that holds the
menu prompts created with DC_AT_PROMPT(). This array
is automatically cleared after calling DC_MENU_TO() so
it is not necessary to call this function unless you
wish to simply display menu prompts and not call the
DC_MENU_TO() function to get a user selection.
dc_at_prompt( 10, 10, "Open a File", "Use a new database" )
DC_AT_CLEAR() // changed my mind
_DCMENU2.PRG/.OBJ, DCLIPX.LIB
dc_at_prompt() dc_menu_to()
DC_At_Prompt( < nRow >, ;
< nCol >, ;
< cPrompt >, ;
[< cMessage >] ) - > nil
< nRow > is the screen row to display the prompt. < nCol > is the screen column to display the prompt. < cPrompt > is the prompt to display on the screen. < cMessage > is an optional message to display at the coordinates defined by the SET MESSAGE environment variable or by the message coordinates passed to DC_MENU_TO().
NIL
DC_AT_PROMPT() is used with DC_MENU_TO() to replace Clipper
@..PROMPT / MENU TO commands with a "mouseable" menu prompt
system. The prompts and menu will behave exactly like the
Clipper MENU TO system except the left button of the mouse will
high-light the selected prompt, and the right button performs
the same function as the <þENTERþ> key.
// display prompts
DC_AT_PROMPT( 10, 10, "Open a File", "Use a new database" )
DC_AT_PROMPT( 12, 10, "Open an Index", "Use an Index file" )
DC_AT_PROMPT( 14, 10, "Edit database", "Browse all records" )
// get a user selection and display message at row 20, col 25
nChoice := dc_menu_to( 1, 20, 25 )
_DCMENU2.PRG/.OBJ, DCLIPX.LIB
dc_at_clear() dc_menu_to()
DC_AtNext ( < cCharacter >, ;
< cString >, ;
< nOccurrence > ) - > nPosition
< cCharacter > is the character or substring to search. < cString > is the string to search. < nOccurrence > is the occurrence of < cCharacter > in < cString > to find.
The numeric location of the <þnOccurenceþ> of <þcCharacterþ> in
<þcStringþ>. If not found then 0 is returned.
DC_ATNEXT() is used to return the location of the nth occurence
of a substring within a string.
PROCEDURE XTest()
LOCAL cString
DC_Gui(.t.)
cString := 'this is a test'
DC_MsgBox( { cString, ;
DC_ATNEXT( 'is', cString, 1 ), ;
DC_ATNEXT( 'is', cString, 2 ) } )
RETURN
_DCATNXT.PRG/.OBJ, DCLIPX.LIB
DC_AtoAttr ( < cColorString > ) - > nColor
< cColorString > is a valid Clipper color string.
A character string.
DC_ATOATTR() is used to convert a Clipper color string to
a numeric screen attribute. Screen attributes are represented
as a number from 0 to 255 for a total of 256 colors. Clipper
functions require that a color string be used for setting
colors rather than a number.
PROCEDURE XTest()
DC_Gui(.t.)
DC_MsgBox( { DC_ATOATTR( 'R/GR' ), ;
DC_ATOATTR( 'N/N' ), ;
DC_ATOATTR( 'W+*/W' ) } )
RETURN
_DCCOLOR.PRG/.OBJ, DCLIPX.LIB
dc_attrtoa()
DC_AttrtoA ( < nColor > ) - > cColorString
< nColor > is a number from 0 to 256.
A character string.
DC_ATTRTOA() is used to convert a screen attribute to a
color string. Screen attributes are represented as a
number from 0 to 255 for a total of 256 colors. Clipper
functions require that a color string be used for setting
colors rather than a number.
PROCEDURE XTest()
DC_Gui(.t.)
DC_MsgBox( { DC_ATOATTR( 'R/GR' ), ;
DC_ATOATTR( 'N/N' ), ;
DC_ATOATTR( 'W+*/W' ) } )
RETURN
_DCCOLOR.PRG/.OBJ, DCLIPX.LIB
dc_atoattr()
DC_AutoReSize( < aOldSize >, ;
< aNewSize >, ;
< oParent >, ;
< aGetList >, ;
< lToolBars > ) - > nil
< aOldSize > is a 2 element array containing the width and height in pixels of the dialog window before resize. < aNewSize > is a 2 element array containing the widht and height in pixels of the dialog window after resize. < oParent > is the parent object. < aGetList > is the GetList array that was passed to DC_ReadGui(). < lToolBars > if .FALSE. will not resize DCTOOLBAR or XbpPushButton objects. These objects, if using bitmaps can truncate the image when resized. The position of the ToolBar or PushButton will change accordingly but the size will not change. The default is .TRUE. (resize all toolbars and pushbuttons).
NIL.
DC_AutoReSize() is used to automatically resize and reposition all child objects so they use the real estate of the parent in the same proportions as the child objects before the parent was resized. DC_AutoReSize() is designed to be placed in a code block that is attached to the :resize callback slot of the parent object. The complete childlist tree is resized.
DC_AutoReSize() will not resize or reposition anything on a dialog that was painted with a Gra*() function or a DCGRA* command. Due to a bug in Xbase++ 1.3 make sure to add o:hide() and o:show() to your resize code block or the screen may leave some undesirable side effects after resizing objects.
FUNCTION XTest()
LOCAL GetList := {}, oDesc, oBrowse
USE COLLECT VIA DBFNTX
@ 12,0 DCSAY COLLECT->descrip SAYSIZE 50 ;
SAYOBJECT oDesc COLOR GRA_CLR_BLUE FONT '12.Courier Bold'
@ .5,.5 DCBROWSE oBrowse ALIAS 'COLLECT' SIZE 49,9 ;
EVAL {|o|o:itemMarked := {||oDesc:setCaption(COLLECT->descrip)} } ;
HEADLINES 2 DELIMITER CHR(13)+CHR(10)
DCBROWSECOL FIELD COLLECT->descrip HEADER "Description"+CHR(13)+CHR(10)+"Line
2" ;
PARENT oBrowse WIDTH 50
DCREAD GUI FIT ADDBUTTONS ;
EVAL {|o| o:resize := ;
{|a,b,o|DC_AUTORESIZE(a,b,o,GetList),o:hide(),o:show()} }
RETURN nil
_DCFUNCT.PRG, DCLIPX.DLL
DCGETOPTIONS
DC_Average() - > lStatus
None.
A logical .TRUE. if the average was not aborted.
DC_Average() is used to average numeric fields from the currently
selected database based on a set of conditions. As GUI dialog
window is displayed for the user to select the conditions.
. USE COLLECT
. DC_Average()
_DCSUM.PRG, DCLIP2.DLL
SUM
dc_batch ( < cFileName >, ;
[< c1 >], ;
[< c2 >], ;
[< c3 >], ;
[< c4 >], ;
[< c5 >] ) - > nil
< cFileName > is the name of the batch file to run. If the extension is not given then .DCB is assumed. < c1 > , < c2 >, < c3 >, < c4 >, < c5 > are optional parameters that are subsituted by %1 - %5 respectively in the batch file commands.
Nil.
DC_Batch() will execute all commands in a .DCB batch file in
sequential order. A batch file can include any commands which
can be entered at the dot-prompt and executed by the eXPress++
interpreter other than structural commands, like DO WHILE, DO CASE
IF..ENDIF or FOR..NEXT. All commands in DCSTD.CH, DCDIALOG.CH,
or DCCUSTOM.CH may be used in batch files.DC_BATCH() is used to open and
execute a .DCB batch file. A
"batch" file can contain any commands that can be interpreted
at the dot prompt, including commands in .CH files which
have been loaded with the INCLUDE command or DC_PREINCLUDE()
function.
DC_Dot() will automatically execute an AUTOEXEC.DCB batch file
found in the directory containing the executable program or
the or the directory named by the dos SET DCLIP=<þdirectoryþ>
environment setting.
DC_BATCH('test.dcb') // run TEST.DCB file
_dcbatch.prg, DCLIP1.DLL
BATCH INTERPRET dc_batchnewthread()
DC_BatchNewThread ( < cFileName >, ;
[< c1 >], ;
[< c2 >], ;
[< c3 >], ;
[< c4 >], ;
[< c5 >] ) - > nil
< cFileName > is the name of the batch file to run. If the extension is not given then .DCB is assumed. < c1 > , < c2 >, < c3 >, < c4 >, < c5 > are optional parameters that are subsituted by %1 - %5 respectively in the batch file commands.
Nil.
DC_BatchNewThread() functions identically to DC_Batch() except
it will execute in a new thread.
DC_Dot() will automatically execute an AUTOEXEC.DCB batch file
found in the directory containing the executable program or
the or the directory named by the dos SET DCLIP=<þdirectoryþ>
environment setting.
. DC_BatchNewThread('test.dcb') // run TEST.DCB file
_dcbatch.prg, DCLIP1.DLL
BATCH INTERPRET dc_batch()
DC_Bin2Num( < cBinary > ) - > nDecimal
< cBinary > is a string of up to eight 1's and 0's.
A numeric value from 0 - 255
DC_BIN2NUM() will convert a binary string to a numeric value.
_DCAND.PRG/.OBJ, DCLIPX.LIB
dc_bittest() dc_xorbits()
DC_BitMapDraw ( < oParent >, ;
< ncbResource > ) - > nil
< oParent > is the Static object that contains the presentation space for the bitmap. < ncbResource > is either the number of a resource that has been linked to the .EXE, a character string with the name of a *.BMP file, or a code block which, when evaluated, returns a number or character string.
Nil.
DC_BITMAPDRAW() is used to redraw a Bitmap object that was created
with the DCBITMAP command and painted on a dialog screen with
DC_READGUI().
This function is used to load a new *.BMP file into the
presentation space previously created from the DCBITMAP object
in the GetList.
#include 'dcdialog.ch'
PROCEDURE XTest()
LOCAL GetList := {}, cBitMap1, cBitMap2, oPhoto1, oPhoto2
USE COLLECT NEW SHARED
SKIP 2
cBitMap1 := COLLECT->bitmap1
cBitMap2 := COLLECT->bitmap2
@ 2,2 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 33,10 ;
OBJECT oPhoto1
@ 2,37 DCSTATIC XBPSTATIC_TYPE_RAISEDBOX SIZE 33,10 ;
OBJECT oPhoto2
DCBITMAP cBitMap1 PARENT oPhoto1 AUTOSCALE
DCBITMAP cBitMap2 PARENT oPhoto2 AUTOSCALE
@ 1,3 DCSAY 'Photo 1' GET cBitMap1 ;
SAYRIGHT SAYSIZE 10 ;
DATALINK {||DC_BitMapDraw(oPhoto1,cBitMap1)}
@ 1,38 DCSAY 'Photo 2' GET cBitMap2 ;
SAYRIGHT SAYSIZE 10 ;
DATALINK {||DC_BitMapDraw(oPhoto2,cBitMap2)}
DCREAD GUI ;
FIT ;
ADDBUTTONS
RETURN
_DCFUNCT.PRG/.OBJ, DCLIPX.LIB
DCBITMAP dc_readgui() DIALOG GETLIST
DC_BitmapTransparentColor( [< anColor >] ) - > nOldColor
< anColor > is a 3-element array containing numeric RGB values or an numeric equivalent of an RGB color.
A numeric value.
DC_BitmapTransparentColor() is a Get-Set function that is used to set the RGB value of the transparent color used with Bitmaps that are placed on DCPUSHBUTTON objects.
// set the transparent color to medium gray (the background
// color of the bitmaps)
aColor := { 192, 192, 192 }
DC_BitmapTransparentColor( aColor )
@ 0,0 DCPUSHBUTTON CAPTION DCBITMAP_FIND_1 SIZE 10,2
DCREAD GUI FIT
_DCGETBX.PRG, DCLIPX.DLL
@ DCPUSHBUTTON dc_getbitmap()
DC_BitTest( < nDecimal >, ;
< nBit > ) - > lStatus
< nDecimal > is a numeric value from 0 to 255. < nBit > is the bit to test. This is a value from 1 to 8.
A logical .TRUE. if the bit is a 1 and a logical .FALSE. if
the bit is a 0.
DC_BITTEST() will test for a specified bit in a number.
_DCAND.PRG/.OBJ, DCLIPX.LIB
dc_andbits()
DC_Blank( [< lCommit >] ) - > lStatus
< lCommit > if .TRUE. (default) will commit the changes to disk.
A logical .TRUE. if the record was blanked.
DC_BLANK() is used to blank the contents of all fields in the
current record of the current work area. It is not necessary
to lock the record because DC_BLANK() will also lock and unlock
the record before blanking the contents.
. USE COLLECT
. GO 5
. DC_Blank()
_dcblank.prg, DCLIP1.DLL
BLANK dc_isblank()
DC_Bof() - > lStatus
None.
A logical value.
DC_BOF() is used to test whether or not DC_DbSkip() attempted
to move the record pointer past the top record in a "scoped"
set of records when using a negative skip value. If no scope
is set or the ADSDBE is being used as the data driver for the
current work area this function simply calls Bof() therefore
it can be used as a replacement for Bof().
DC_SetScope(0,'12001')
DC_SetScope(1,'12001')
DC_DbGoBottom()
DO WHILE !DC_Bof()
DC_DbSkip(-1)
ENDDO
_DCSCOPE.PRG/.OBJ, DCLIPX.LIB
dc_setscope() dc_eof() dc_dbskip() dc_dbgotop() dc_dbgobottom()
DC_BrowCellEdit( < oBrowse >, ;
[< nRow >], ;
[< nCol >], ;
[< nEditMode >], ;
[< lArray >], ;
[< abDefault >], ;
[< bEval >] ) - > nil
< oBrowse > is the browse object to edit, insert or delete. This
must be an object of the XbpBrowse class.
< nRow > is the starting row. If this argument is not passed,
then the currently selected row is the default. < nRow > must
be a numeric value within the currently visible number of rows.
< nCol > is the starting column. If this argument is not passed,
then the currently selected column is the default. < nCol > must
be a numeric value between 1 and the total number of columns in
the browse object.
< nEditMode > is the editing and/or navigation mode.
< nEditMode > Description
----------- ---------------------------------------
DCGUI_BROWSE_EDITEXIT Edit - Exit cell editing after ENTER key
DCGUI_BROWSE_EDITACROSS Edit - Move to next column after ENTER key
DCGUI_BROWSE_EDITDOWN Edit - Move to next row after ENTER key
DCGUI_BROWSE_INSERT Insert an element or a record
DCGUI_BROWSE_DELETE Delete current element or record
< lArray > is a logical value determining if the browsed data is an
array or a database. If .TRUE., then it is an array. If this
argument is not passed and the browse object was created via the
DCBROWSE command then this is determined automatically. If an
array is being browsed, then the :cargo iVar of the browse object
must contain an array of at least 5 elements. Element 5 is a
pointer to the array being browsed. Element 4 is a numeric
value containing a pointer to the currently selected array
element.
< abDefault > is used only when inserting an array element, ie
< nMode > is DCGUI_BROWSE_INSERT. This parameter contains either
an array or a code block which returns an array. The array
contains the default data for the inserted element. Note: array
browsers always browse multi-dimensional, symmetrical arrays, so
this array must contain the same number of sub-elements as each
array element.
< bEval > is an optional code block to evaluate before inserting,
deleting, or editing a cell row.
DC_BrowCellEdit() is used to edit the cells of any browse object.
Navigation modes allow for moving up and down within the browse
via the UP, DOWN keys or automatically moving DOWN or ACROSS
with the ENTER key.
DC_BrowCellEdit() supports WHEN code blocks for each column to
prevent the editing of a cell and VALID code blocks for each
column to validate user input.
DC_BrowCellEdit() also is used to delete an element from the
array being browsed or to insert and edit a new element.
The :dataLink iVar of each XbpColumn object in the XbpBrowse
object is used to store the GET/SET code block for editing the
cell. If the XbpColumn objects were created by the DCBROWSECOL
command using the FIELD <þcFieldþ> clause, then it will automatically
be created as a GET/SET code block.
The :cargo iVar of each XbpColumn object in the XbpBrowse object
may be used to store WHEN clause and VALID clause information.
If the column objects were created by the DCBROWSECOL command
then the code blocks for these clauses are automatically stored
in XbpColumn:cargo. If the XbpColumn objects are NOT created by
DCBROWSECOL, then you must store an array at least 7 elements in
length into the XbpColumn:cargo instance variable.
XbpColumn:cargo[6] is used to store the VALID codeblock. This
code block is used to validate the input for each column object.
The value in the editing buffer of the cell is passed to the
code block, therefore the code block should look like so:
{ |c| !Empty(c) }
The value passed is always the same type as the value of the
field. The code block must return a logical value. If a .TRUE.
is returned or the value stored in XbpColumn:cargo is not an
array or the value stored in XbpColumn:cargo[6] is not a code
block, then the value entered will be stored. If a .FALSE. is
returned, then the editing window cannot be exited until a
.TRUE. is returned or the ESCape key is pressed.
XbpColumn:cargo[7] is used to store the WHEN codeblock. This
code block is used to prevent editing of a cell. It must always
return a logical value. If a .TRUE. is returned or the value
stored in XbpColumn:cargo is not an array or the value stored
in XbpColumn:cargo[7] is not a code block, then the cell can be
edited. If a .FALSE. is returned, then the cell will be skipped.
#include 'dcdialog.ch'
PROCEDURE XTest()
LOCAL GetList := {}, oBrowBox, oBrowse, oToolBar, GetOptions
USE COLLECT NEW SHARED
@ 3,0 DCSTATIC XBPSTATIC_TYPE_RECESSEDBOX SIZE 78,12 ;
OBJECT oBrowBox
@ .1,.5 DCBROWSE oBrowse PARENT oBrowBox ALIAS 'COLLECT' ;
SIZE 77,11.8
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 FIELD COLLECT->date_orig ;
HEADER "Orig Date" PARENT oBrowse
DCBROWSECOL FIELD COLLECT->date_acqu ;
HEADER "Acqu Date" PARENT oBrowse
DCTOOLBAR oToolBar
DCADDBUTTON CAPTION 'Edit Down' ;
SIZE 10 ;
PARENT oToolBar ;
ACTION {||DC_BrowCellEdit( oBrowse,,,DCGUI_BROWSE_EDITDOWN ) }
DCADDBUTTON CAPTION 'Edit Across' ;
PARENT oToolBar ;
SIZE 10 ;
ACTION {||DC_BrowCellEdit( oBrowse,,1,DCGUI_BROWSE_EDITACROSS ) }
DCGETOPTIONS ;
WINDOW WIDTH 560 ;
WINDOW HEIGHT 350
DCREAD GUI ;
OPTIONS GetOptions ;
ADDBUTTONS ;
EVAL {||oBrowse:hide(), oBrowse:show()}
RETURN
_DCGETBX.PRG, DCLIPX.LIB
@ DCBROWSE
DC_BrowCellEditExit( [< nMode >] ) - > nOldMode
< nMode > is the value to return from the Cell Editor event handler. This should be either DCGUI_EXIT_ABORT or DCGUI_EXIT_OK. DCGUI_EXIT_ABORT is the same as pressing the ESCAPE key. DCGUI_EXIT_OK is the same as pressing the ENTER key.
A numeric value.
DC_BrowCellEditExit() is used in a cell editor validation clause
to force an exit of the cell editor.
_DCGETBX.PRG, DCLIPX.LIB
@ DCBROWSE dc_browcelledit()
DC_BrowPres([< aPres >]) - > aPres
< aPres > is an array of browse presentation parameters that conforms to the specification of parameters described in the Xbase++ documentation for XbpBrowse().
A presentation parameters array.
DC_BrowPres() is a Get/Set function that is used to Get or Set a presentation parameters array for browse windows. DC_BrowPres() returns a default set of browse paramaters if a user-defined set of parameters is not set.
aBrowPres := ;
{ { XBP_PP_COL_HA_FGCLR, GRA_CLR_WHITE }, /* Header FG Color */
;
{ XBP_PP_COL_HA_BGCLR, GRA_CLR_DARKGRAY }, /* Header BG Color */
;
{ XBP_PP_COL_DA_ROWSEPARATOR, XBPCOL_SEP_DOTTED }, /* Row Sep */
;
{ XBP_PP_COL_DA_COLSEPARATOR, XBPCOL_SEP_DOTTED }, /* Col Sep */
;
{ XBP_PP_COL_DA_FGCLR, GRA_CLR_BLACK }, /* Row FG Color */
;
{ XBP_PP_COL_DA_BGCLR, GRA_CLR_WHITE }, /* Row BG Color */
;
{ XBP_PP_COL_DA_ROWHEIGHT, 16 }, /* Row Height */
;
{ XBP_PP_COL_HA_HEIGHT, 10 }, /* Header Height */
;
{ XBP_PP_HILITE_FGCLR, GRA_CLR_WHITE }, /* Hilite FG color */
;
{ XBP_PP_HILITE_BGCLR, GRA_CLR_DARKBLUE }, /* Hilite BG color */
;
{ XBP_PP_COL_FA_FGCLR, GRA_CLR_WHITE }, /* Footer FG Color */
;
{ XBP_PP_COL_FA_BGCLR, GRA_CLR_DARKGRAY }, /* Footer BG Color */
;
{ XBP_PP_COL_FA_HEIGHT, 10 } /* Footer Height */
;
}
DC_BrowPres(aBrowPres)
@ 1,1 DCBROWSE oBrowse PRESENTATION DC_BrowPres()
_dcpres.prg
@ DCBROWSE
DC_BrowseAutoSeek( < nKey >, ;
< oGET >, ;
< oBrowse >, ;
[< aData >], ;
[< nColumn >], ;
[< bcPrefix >], ;
[< bFormat >], ;
[< nSeekDelay >], ;
[< bSeek >], ;
[@< nPointer >] ) - > NIL
< nKey > is the numeric value of the key pressed.
< oGET > is the DCGET object that is being used to enter the seek
string.
< oBrowse > is the @..DCBROWSE object that will be refreshed.
< aData > is the array being browsed. If this parameter is not
used then it is assumed that a database is being browsed.
< nColumn > is the column element of the array to scan for a
match. This parameter is used only with < aData > and is a
required parameter when browsing an array.
< bcPrefix > is the a value to insert at the beginning of the
seek string. If a code block, then it must return a string.
< bFormat > is a seek string code block. The user input buffer
passed to this code block and the return value of code block
is used for the seek.
ex: {|c|Right(Space(7)+Alltrim(cString),7)}
< 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.
< bSeek > is a code block to use to do the actual seek. If this
argument is not used then the function DC_DbSeek() will be used.
The code block will receive the keyboard buffer as an argument.
The code block must return a logical value - .TRUE. if record
was found, .FALSE. if not found.
@< 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. This value will be stored only when
using an array.
NIL.
When browsing a database, DC_BrowseAutoSeek() is used to automatically seek to a record in a database that matches the text entered into a GET and refresh an associated browse object. When browsing an array, DC_BrowseAutoSeek() is used to automatically seek to an element of the array that matches the text entered into a GET and refresh an associated browse object. DC_BrowseAutoSeek() is intended to be used in a codeblock that is assigned to the :keyboard callback slot of a DCGET object or the GET portion of an @..DCSAY..GET object. It is also intended to be used with an @..DCBROWSE object.
When browsing a database, an index must be in focus and the key of the index must match whatever is being entered by the user into the GET. The seek is a SOFTSEEK, meaning that the record that closely matches the entered data will be selected. When browsing an array the <þnColumnþ> element of the array must match whatever is being entered by the user into the GET.
FUNCTION XTest
LOCAL GetList := {}, cSeek := Space(20), oBrowse
SET DEFA TO ..\XDOC
USE EXPRESS VIA FOXCDX EXCLUSIVE ALIAS 'XDOC'
SET INDEX TO EXPRESS.CDX
OrdSetFocus('COMMAND')
SET DEFA TO
@ 1,1 DCSAY 'Seek' GET cSeek SAYRIGHT PICT '@!' ;
KEYBLOCK {|a,b,o|DC_BrowseAutoSeek(a,o,oBrowse)}
@ 3,1 DCBROWSE oBrowse ALIAS 'XDOC' SIZE 77,11.8
DCBROWSECOL FIELD XDOC->command HEADER "Command" PARENT oBrowse ;
WIDTH 7
DCBROWSECOL FIELD XDOC->type HEADER "Type" PARENT oBrowse ;
WIDTH 6
DCBROWSECOL FIELD XDOC->category HEADER "Category" PARENT oBrowse ;
WIDTH 6
DCBROWSECOL FIELD XDOC->short HEADER "Short Description" PARENT oBrowse
DCBROWSECOL FIELD XDOC->module HEADER "Module" PARENT oBrowse ;
DCBROWSECOL FIELD XDOC->see_also HEADER "See Also" PARENT oBrowse
DCBROWSECOL DATA {||XDOC->(recno())} HEADER "Record" PARENT oBrowse ;
WIDTH 4
DCREAD GUI ;
TITLE 'DC_BrowseAutoSeek() Demo' ;
FIT ;
ADDBUTTONS
RETURN nil
_DCFINDX.PRG, DCLIPX.DLL
@ DCBROWSE dc_findbrowse()
DC_BrowseDb ( [< aOptions >], ;
[< aFields >], ;
[< cUdfName >], ;
[< lExit >], ;
[< lReSize >], ;
[< lRestoreScreen >], ;
[< cConfigFile >], ;
[< lEditDb >], ;
[< lProtect >], ;
[< aMenu >], ;
[< aKeys >], ;
[< aMouse >], ;
[< lBackGround >] ) - > Nil
< aOptions > is an array of parameters to define the size and
style of the browse window.
Element Type Description
------- ---- ---------------------------------------------
[ 1] L .t. - Pick-list operation. Will only display
menu options for window configuration and
searching for a record. Use this mode
when you want the user to choose a field
and/or record and exit with the RETURN key.
.f. - Normal operation. (default).
[ 2] L .t. - Protect data from being changed by user
.f. - Allow data modification ( Default )
[ 3] N Start Display Row ( 0 is default )
[ 4] N Start Display Column ( 0 is default )
[ 5] N End Display Row ( 24 is default )
[ 6] N End Display Column ( 79 is default )
[ 7] L .t. - Display File Data at bottom of window
.f. - Don't Display File Data ( Default )
[ 8] L .t. - Don't display a shadow around the window
.f. - Display a shadow around window ( Default )
[ 9] L .t. - Display a record number column ( Default )
.f. - Don't display record numbers
[10] L .t. - Set the TAB for this window ( Default )
.f. - Don't set the TAB
[11] L .t. - Automatic update of Relational Windows
.f. - Don't update Relational Windows ( Default )
[12] L .t. - One-To-Many Browse configuration
.f. - Standard configuration ( Default )
[13] L .t. - Sticky-Browse mode ON
.f. - Sticky-Browse mode OFF ( Default )
[14] L .t. - Display all child relational fields (Default)
.f. - Don't display child fields
[15] L .t. - Automatic update of Full-screen edit window
.f. - Don't update Edit window (Default)
[16] L .t. - Display a Record Tagging Column.
[17] N Inkey value of keyboard key to use for record
tagging with [16] is .TRUE. Default is SPACE BAR
(32)
[18] L .t. - Fast Paint option. Paints browse screens
faster if they contain long memo fields. This
option will not display memo fields with the
capitalized "MEMO" when they are not empty.
.f. - Display "MEMO" when memo fields are not empty
otherwise display "memo". (Default)
[19] L .t. - Display totals at the bottom of all numeric
columns. This option can take a long time to
start-up the browse while totals are being
calculated.
.f. - Don't display totals. (Default)
[20] L .t. - Display menu bar at the top of the physical
screen (Row 0, Column 0)
.f. - Display menu bar at the top of the browse
window (Default).
[21] L .t. - PICK-EDIT mode. In this mode, pressing the
ENTER key will exit the browse with the record
pointer at the selected record. This is
different than PICK-LIST mode above, however,
because this option still allows editing by
selecting ADD or EDIT from the menus.
.f. - ENTER key will edit currently selected field.
[22] L .t. - AUTOSEEK mode. Overrides setting of Autoseek
that was saved in Browse configuration.
[23] C Description of the Browse
[24] C A list of relational browse windows separated by
commas.
< aFields > is a 2-dimensional array of field names and headings.
If this argument is not passed, then all fields will appear in
the display with the field name used as the heading. There
should be one element in the second array for each element in
the first array.
Example:
{ { 'CUST_NAME','CUST_NMBR','STREET1','CITY','STATE','ZIP' }, ;
{ 'Customer;Name','Number','Street','City','State','Zip' } }
Note: Use semicolon (;) character(s) in the heading to break the
heading display into multiple rows.
< cUdfName > is the name of a User-Defined Function to call
after each keystroke.
< lExit > if .TRUE. will paint the display and items on the
screen then return. .FALSE. is Default.
< lReSize > if .TRUE. will simply resize the browse window to
the new coordinates passed in < aOptions > and not affect the
previous browse configuration.
< lRestoreScreen > if .TRUE. (default) will restore the screen
upon exiting the browse, otherwise all the browse screens
will remain on the display.
< cConfigFile > is the name of a *.DBR file to use as the
browse configuration. A *.DBR file is created by the
"Save Configuration to a File" selection from the FILES
menu after configuring the browse screen as desired. If no
path is included in the file name, then the file must exist
in the same directory as the currently selected database.
< lEditDb > if .TRUE. will automatically paint a full-screen
EDIT window and update it every time the record pointer
changes in the browse window. Use this parameter when you
want to see both a full-screen edit view and a browse view
at the same time. Using this parameter is the same as
selecting "Automatic Update of Edit Window ON" from the
VIEW menu. The default is .FALSE. or OFF.
< lProtect > if .TRUE. will protect the database from being
modified by the user. The default is .FALSE.
< aMenu > is an optional array which is used to replace the
default Browse pull-down menus. The menu array must conform
to the specification of the array returned by the
function DC_MENUEDIT() or DC_MENULOAD(). If < aMenu > is
a character string, then the string must contain the
NAME of the menu as contained in the menu dictionary file
(DCMENU.DBF).
< aKeys > is an optional array which is used to replace, add
or delete hot-keys from the Browse defaults. The key array
must conform to the specification of the array returned by
the function DC_KEYEDIT() or DC_KEYLOAD(). If < aKeys > is
a character string, then the string must contain the
NAME of the key-set as contained in the key dictionary file
(DCKEY.DBF).
< aMouse > is an optional array which is used to add to the
default mouse-actions. The mouse array must conform
to the specification of the array defined for use by the
function DC_MOUSEKEYS() or returned by the function
DC_MOUSEEDIT() or DC_MOUSELOAD(). If < aMouse > is a
character string, then the string must contain the
NAME of the mouse-set as contained in the mouse dictionary
file (DCMOUSE.DBF).
< lBackGround > if .TRUE. (default) will paint a default
background and all browse screens for all work areas. If
.FALSE., then only the browse screen for the current work
area will be displayed over the existing screen.
Nil
DC_BROWSEDB() is a Multi-Window database browsing system that
can be used as a complete menu-driven DBMS. DC_BROWSEDB() is
the base system for all Text-Based browsing features. This is an
array-driven system, ie, a multi-dimensional array ( DCBROWSE )
object is used to store all the parameters for all work areas.
DC_BROWSEDB() supports a complete set of menus and options:
Edit, View, File, Search, Print, Utilities, etc. The text-based
browse system supports the following features:
1. Cut and Paste
2. Keyboard Macros
3. User-configuration
4. Multi-window browsing
5. Relational browsing
6. Sticky browsing
7. Pick-list operation
See the section titled BROWSE for a complete description of how
to use the DC_BROWSEDB() function.
use customer
DC_BROWSEDB()
use invoice new
DC_BROWSEDB( { , , 0, 0, 24, 39 } )
use invitems new
set relation to inv_nmbr into invoice
DC_BROWSEDB( { , , 0, 40, 24, 79, , , .t., .f., , .t., .t. } )
_DCBROW.PRG
BROWSE
DC_BrowseRow( < oBrowse >, ;
[< nRow >] ) - > nRow
< oBrowse > is the browse object. < nRow > is the element in the browse to select.
The numeric value of the current row (array element).
DC_BrowseRow() is used to Get or Set the row of a browse object which was created by the @ DCBROWSE command. This function is used only when browsing arrays. DC_BrowseRow() is used when it is necessary to seek an element of the array being browsed, then update the row pointer and refresh the browse.
#include 'dcdialog.ch'
FUNCTION XTest()
LOCAL GetList := {}, aDir := Directory(), oBrowse, aRef[2]
@ 0,0 DCBROWSE oBrowse SIZE 50,10 DATA aDir ;
PRESENTATION DC_BrowPres() NOHSCROLL
DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 15 PARENT oBrowse
DCBROWSECOL ELEMENT 2 HEADER 'File Size' WIDTH 13 PARENT oBrowse
DCREAD GUI FIT ADDBUTTONS ;
HANDLER MyHandler REFERENCE aRef ;
EVAL {|| aRef[1]:=oBrowse, aRef[2]:=aDir, ;
SetAppFocus(oBrowse:getColumn(1)) }
RETURN nil
* -----------------
STATIC FUNCTION MyHandler( nEvent, mp1, mp2, oXbp, ;
oDlg, GetList, aRef )
LOCAL oBrowse := aRef[1], aDir := aRef[2], nFound
IF nEvent == xbeP_Keyboard
nFound := ;
AScan( aDir, {|a|Upper(Substr(a[1],1,1))==Upper(Chr(mp1))} )
IF nFound > 0
DC_BrowseRow( oBrowse, nFound )
oBrowse:refreshAll()
ENDIF
ENDIF
RETURN DCGUI_NONE
_DCGETBX.PRG, DCLIPX.LIB
@ DCBROWSE dc_getcolarray()
DC_BrowseSort( [< aSortOptions >] ) - > aOldOptions
< aSortOptions > is an array of 6 elements.
Element Description
------- -------------------------------------------------------
1 / 2 Used to set the foreground and background color of the
column heading that is chosen as the controlling sort
order when clicking the mouse in the column heading.
See the SORT clause of DCBROWSECOL.
3 / 4 Used to set the foreground and background color of the
column headings that are not the controlling sort order.
5 / 6 Use to set the UP arrow and DOWN arrow bitmaps that are
used in the column header of the sorted column when
the order is "ascending" or "descending" respectively.
An array containing the old sort options.
DC_BROWSESORT() is used to set the column heading options for @..DCBROWSE when using the sort feature that is activated by clicking in the header column.
aSort := Array(6) aSort[1] := GRA_CLR_WHITE // Sort Selected Color (Foreground) aSort[2] := GRA_CLR_RED // Sort Selected Color (Background) aSort[3] := GRA_CLR_WHITE // Sort Unselected Color (Foreground) aSort[4] := GRA_CLR_DARKGRAY // Sort Unselected Color (Background) aSort[5] := BITMAP_RD_UP_RED // Sort UP Bitmap aSort[6] := BITMAP_RD_DOWN_RED // Sort DOWN Bitmap aSaveSort := DC_BrowseSort(aSort) @ 10,1 DCBROWSE oBrowse DCREAD GUI DC_BrowseSort(aSaveSort)
_DCXBROW.PRG, DCLIPX.DLL
@ DCBROWSE
DC_ByteShift( < cChar >, ;
[< nShift >] ) - > cChar
< cChar > is any character (byte). < nShift > is the number of bits to shift from -7 to +7.
A character (byte).
DC_ByteShift() is used to shift the bits in a byte a specified amount.
_DCAND.PRG/.OBJ, DCLIPX.LIB
dc_bin2num() dc_num2word()
DC_CalcAbsolutePosition( [< aPos >], < oXbp > ) - > aCoords
< aPos > is a two-element array containing the offset from the
object for the resultant output. The default is {0,0}.
< oXbp > is the object whose absolute coordinates are being
calcualated.
A two element array containing two numeric values: 1. The absolute COLUMN position. 2. The absolute ROW position.
DC_CalcAbsolutePosition() returns the coordinates of an object with respect to coordinate 0,0 of the desktop. This is needed to get coordinates for tooltips and modal popup windows that must be displayed adjecent to another object.
// This function will center an object on the screen over any
// relative object.
FUNCTION DC_CenterObject( oXbp, oRel )
LOCAL nRelWidth, nRelHeight, nWidth, nHeight, nCol, nRow, aPos
DEFAULT oRel := oXbp:setParent()
nWidth := oXbp:currentSize()[1]
nHeight := oXbp:currentSize()[2]
nRelWidth := oRel:currentSize()[1]
nRelHeight := oRel:currentSize()[2]
nCol := (nRelWidth-nWidth)/2
nRow := (nRelHeight-nHeight)/2
IF oRel == oXbp:setParent()
oXbp:setPos( {nCol,nRow} )
ELSE
aPos := DC_CALCABSOLUTEPOSITION({0,0},oRel)
oXbp:setPos( {aPos[1]+nCol,aPos[2]+nRow} )
ENDIF
RETURN nil
_DCFUNCT.PRG, DCLIPX.DLL
DC_CallStack() - > Nil
None.
Nil.
DC_CallStack() is used to display a GUI dialog listing the
current call stack and line numbers.
Clicking on an item in the list will scan the list of .OBJs
in the ODIR path to find the source of the function. If
the same named function exists in more than one .OBJ, then
all .OBJs will be listed. Clicking on the selected .OBJ will
call the default editor and pass the name and line number of
the selected source file to editor for editing.
. DC_SetKeyActive(.t.)
. SetKey( K_ALT_S, {||DC_CallStack()} )
_DCOFIND.PRG, DCLIP2.DLL
STACK dc_editprg() SET ODIR dc_objpublic()
DC_CapFirst( < cString >, ;
[< lLower >] ) - > cString
< cString > is any string. < lLower > if .TRUE. will force all characters except the first character in each word to lower case. The default is .FALSE.
A Character String.
DC_CapFirst() capitalizes the first letter of all words in a string and leaves all other letters lowercase.
. ? DC_CapFirst('DONNAY SOFTWARE DESIGNS',.t.)
Donnay Software Designs
. ? DC_CapFirst('donnay SoftWare')
Donnay SoftWare
_DCCAPF.PRG, DCLIP1.DLL
DC_CascadeCoords( [< oParent >], ;
[< lTextBased >], ;
[< aDefault >], ;
[< lTranslate >], ;
[< oExclude >] ) - > aCoords
< oParent > is the dialog window to scan. If no parameter is passed the AppDeskTop() is the default. < lTextBased > will return text-based coordinates if .TRUE. otherwise it will return pixel-based coordinates (default). < aDefault > is an array of two coordinates to return if no siblings were found. < lTranslate > if .TRUE. (default) will return coordinates translated with 0,0 at the top of the parent window. If .FALSE. the coordinates will be relative to 0,0 at the bottom of the parent window. < oExclude > is a sibling object (an object in the childlist) to ignore when scanning the childlist.
An array of two numeric coordinates:
Element 1 is the row.
Element 2 is the column.
DC_CASCADECOORD() returns an array of two coordinates. These coordinates are calculated by scanning the childlist of an object and finding the object with the lowest coordinates. This allows for cascading of dialog windows.
/*
This example will set the coordinates of a dialog window to
cascaded coordinates relative to the lowest sibling on the
desktop. If there are no siblings, the current coordinates
will be used.
*/
FUNCTION Xtest( oDlg )
LOCAL aCoords, nRow, nCol
nRow := oDlg:currentPos()[2]
nCol := oDlg:currentPos()[1]
aCoords := ;
DC_CascadeCoords(AppDesktop(),.f.,{nRow,nCol},.f.,oDlg)
oDlg:setPos( { nCol, nRow } )
RETURN nil
_DCFUNCT.PRG, DCLIPX.LIB
DC_CDow( < dDate > ) - > cDayOfWeek
< dDate > is any valid date type.
A character string.
DC_CDow() is used to get the name of the day of the week for a specified date. The name is translated to the language previously selected by DC_LangSel().
DC_LangSet( DCLANG_GERMAN ) ? DC_CDow( Date() ) Mittwoch
_DCCALEN.PRG, DCLIPX.DLL
dc_cmonth() dc_langset() dc_langmsg()
DC_CellEditTimeOut( [< nSeconds >] ) - > nOldTimeOut
< nSeconds > is the amount of time, in seconds, to allow cell- editing with no user activity. The default is 0 (no time out).
A numerical value equivalent to the previous timeout setting.
DC_CellEditTimeOut() is used to establish a timeout to exit the
cell editor if there is no user activity after a specified amount
of time.
The Cell Editor automatically locks the record and holds the lock
until it exits or until a new record is selected. If the user
enters the cell-editor and walks away from the computer, a lock
on the record for a long period of time may be undesirable.
_DCGETBX.PRG, DCLIPX.LIB
dc_browcelledit()
DC_CenterObject ( < oXbp >, ;
[< oReference >] ) - > nil
< oXbp > is the object to center. < oReference > is the reference object to center < oXbp > in. If < oReference > is not passed, < oXbp > will be centered within it's parent.
nil
DC_CENTEROBJECT() will center any object within the viewing area
of it's parent object or any other object.
-- Example 1 --
* Center the CRT window on the Desktop
DC_CenterObject(SetAppWindow(),AppDeskTop())
_DCFUNCT.PRG/.OBJ, DCLIPX.LIB
DC_CGIGetEnvVal( < nEnvName > ) - > cValue
< nEnvName > is the numeric value defined in DCCGI.CH. The following names are available. AUTH_TYPE CONTENT_LENGTH CONTENT_TYPE GATEWAY_INTERFACE HTTP_USER_AGENT HTTP_ACCEPT HTTP_FROM PATH_INFO PATH_TRANSLATED QUERY_STRING REFERER_URL REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER REQUEST_METHOD SCRIPT_NAME SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE SERVER_ADMIN GMT_OFFSET HTTP_REFERRER HTTP_COOKIE _FROM AUTH_NAME DATE_LOCAL CONTENT_STRING REQUEST_PROTOCOL EXECUTABLE_PATH KEEP_ALIVE DOC_ROOT AUTH_PASSWORD AUTH_METHOD AUTH_REALM DEBUG_MODE X_SERIAL_NUMBER PRAGMA ACCEPT_LANGUAGE HOST UA_PIXELS UA_COLOR UA_OS UA_CPU EXTENSION CGI_VERSION NT_USERNAME OUTPUT_FILE CONTENT_FILE
A character string.
DC_CGIGetEnvVal() is used to get the value of an environment
variable that has been passed by an HTML form to a CGI
application. When a CGI application starts, DC_CGIInit()
stores all the passed environment variables to a static array
which is accessed by DC_CGIGetEnvVal().
DC_CGIInit() must be called before using this function.
Variables passed to a CGI program are always character strings.