Module Data_set.pkg
************************************************************************
Confidential Trade Secret.
Copyright 1987-1997 Data Access Corporation, Miami FL, USA
All Rights reserved
DataFlex is a registered trademark of Data Access Corporation.
************************************************************************/
************************************************************************
File Name: Data_Set.Pkg
Creation Date: January 1, 1991
Modified Date: April 21, 1992
Author(s): Steven A. Lowe
This module contains the Data_Set class definition.
************************************************************************/
4/21/99 JJT Added OnConstrain support
11/26/97 JJT Moved data_set_should_save into class from dfclient.pkg
04/11/97 JJT Added Refind_DD_Records which is just like Refind_records
except it only operates on in_use DDs. Otherwise, non
connected not-in-use DDs clear the buffer (very bad for
sysfiles).
11/05/96 JJT Added Set DDO_Server Message (same as Attach_Server)
08/29/96 JJT Item_Find Fix, where send attach_main_File sent to server
07/23/96 JJT Renamed to DataSet (Maintain Data_Set as well)
************************************************************************/
2/26/2002 JJT - 8.2 clean up (indirect_file, local, self, etc.)
Data_set.pkg (view source)- import declarations
- VdfBase.pkg (view source)
- fndmodes.pkg (view source)
- refmodes.pkg (view source)
- BaseData_Set.pkg (view source)
Description
The Data_Set class is implemented as a subclass of Entry_Client, with
a C language handler providing the majority of new behavior. The
Data_Set class is intended to be a grouping agent for data-entry objects
and a container for subordinate Data_Sets.
Assumptions/Preconditions
None.
Exceptions
None.
Notes
Syntax:
Object <name> is a DataSet <image> {ACTION_BAR <ActionBar>} {POP_UP}
{RING} {MAIN_FILE <Main_File> {BY <Index>} }
{UPDATING <File> | <DataSetID> ... } }
:
End_Object
Data_Sets may be used to group DEOs as well as other Data_Sets.
Note also that a nested (component) Data_Set automatically enforces an
UPDATES visibility and a RELATES TO constraint between its main_file and
its parent's main_file.
_Data_Set class deinition, private class layer. (Extra class layer needed
to augment procedures defined in C class handler.)
_Data_Set class deinition, private class layer. (Extra class layer needed
to augment procedures defined in C class handler.)
Class _Data_Set is an Entry_Client ; //_Data_Set inherits from Entry_Client
STARTMAC dsStart ; //dsStart macro is used to handle syntax
0 0 ; //default colors
Data_Set_Handler //C-function for base class behavior
!A [] $461 U__DATA_SET //register C messages
#IFDEF IS$WINDOWS
- Integer
OPERATION_MODE - Integer
OPERATION_ORIGIN - DataSet : BaseData_Set
Data_Set class definition, public class layer. (Extra class layer needed
to augment C-based (Constrain) procedure(s).)
Construct_Object()
Integer Img#
- integer
Field_Main_Index(integer file integer field)
This may be called by legacy DSO and DDO code
IMPORTANT NOTE of change for 8.2:
DO NOT call or augment this anymore.
for sending: Find all cases of Field_main_index and change it to File_Field_Index
for augmenting: In DSOs - replace Field_main_index with File_field_index
In DDOs - replace Field_main_Index with Field_Index and do not pass
the file parameter.
See DDOs Field_index and File_field_Index for more
- Integer
dataType - Integer
fldNdx - Integer
retval - Integer
ordr
- integer
File_Field_Index(integer iFile integer iField)
This allows packages that still use data-sets instead of DDOs to use this
message syntax.
Note that this will never get here if the DD class is used as
it has its own handler for this. It only is called if DSOs are used in which
case it calls the old message field_main_index above.
DDO based objects will NEVER call this code
Item_Find(integer eFindMode integer iFile integer iField integer bDoEntryUpdate integer bShowFindErr integer bDeferred)
- RowId
riRow - Integer
iIndex - Integer
hoServer - Integer
iSegments - Integer
iSeg - Integer
iSegFld - Integer
iSegFldMainIndex - Boolean
bChanged - Boolean
bDoCheck - Boolean
bOk
- Integer
Exit_Application_Check()
We only care about should_saves of DEOs and not DSOs when
exiting the app. Create a handler for data set class. We still
broadcast in case we've got nested deos in the dso (hopefully not).
- Integer
rVal
Constrain()
- Integer
iFile
OnConstrain()
Set(Handle ObjId)
Less confusing Message for adding Updating servers
Refind_DD_Records()
This is called when a view takes or retakes the
focus. If DD not in use, do nothing.
- integer
Data_Set_Should_Save()
this returns true if the data-set is changed AND there are attached
DEO objects. Without this you can get "changes exist" condition reported
that the user will have no way of saving.
- Integer
Extended_DSO_State()
returns 0 indicating that this is not DD enabled. DataDictionary objects will return 1.
Add DSOs and DDOs must understand this message
- Data_Set
maintain old name for the time being to maximize compatability
between character mode and windows versions. Developers should be
able to move DS classes back and forth without changes.
- BEGIN_CONSTRAINTS
#COMMAND bind_main_file // this should not be used anymore
#IF (!0>1)
#IFSAME !1 MAIN_FILE
#IFDEF !2.RECNUM
#PUSH !u
#SET U$ !2.RECNUM
set main_file to |CI!u
#POP u$
#ELSE
#ERROR DFERR_COMPILE If !2 is a file it is unopened
#ENDIF
#ELSE
bind_main_file !2 !3 !4 !5 !6 !7 !8 !9
#ENDIF
#ENDIF
#ENDCOMMAND
#COMMAND bind_index
#IF (!0>1)
#IFSAME !1 BY
set ordering to !2
#ELSE
bind_index !2 !3 !4 !5 !6 !7 !8 !9
#ENDIF
#ENDIF
#ENDCOMMAND
#COMMAND Bind_Updating
#IF (!0>1)
#IFSAME !1 UPDATING
SetDependents !2 !3 !4 !5 !6 !7 !8 !9
#ELSE
Bind_Updating !2 !3 !4 !5 !6 !7 !8 !9
#ENDIF
#ENDIF
#ENDCOMMAND
#COMMAND SetDependents //<File>|<Server#> [ ... ] ...obsolete
#IF (!0>0)
#IFDEF !1
send Attach_Server !1
#ELSE
#IFDEF !1.OBJ
send attach_Server !1.OBJ
#ELSE
#IFDEF !1.RECNUM
#PUSH !u
#SET U$ !1.RECNUM
send Add_Parent_File |CI!u
#POP U$
#ELSE
#ERROR DFERR_COMPILE If !1 is a file it is unopened
#ENDIF
#ENDIF
#ENDIF
SetDependents !2 !3 !4 !5 !6 !7 !8 !9
#ENDIF
#ENDCOMMAND
- END_CONSTRAINTS
References (4):
Field References (0):
Module | Containing Symbol | Line |
---|