Skip to content

DEOInformation - cCJCommandBarSystem

Returns data entry information about the focus object

Type: Function
Return Data Type: Boolean

Parameters

Parameter Type Description
ByRef hoServer Handle Returns the focus object's DataDictionary Object (DDO)
ByRef bHasRecord Boolean Returns True if the focus object's DDO has an active record
ByRef bChanged Boolean Returns True if the focus object's DDO is changed
ByRef bHasIndex Boolean Returns True if the focus object's table/column has an index (i.e., if it supports finding)

Syntax

Function DEOInformation ByRef Handle hoServer ByRef Boolean bHasRecord ByRef Boolean bChanged ByRef Boolean bHasIndex Returns Boolean

Call Example

Get DEOInformation hoServer bHasRecord bChanged bHasIndex to BooleanVariable

Description

DEOInformation returns data entry information about the focus object. This is used by menu and toolbar items to determine if the focus object is a DEO (data entry object) and, if so, to return information about this DEO. A cCJMenuItem's cCJAction.IsEnabled may call this to determine if an object should be enabled based on the state of the focus object.

If the focus object is a DEO or it is nested within a DEO object, the function will return a true value. When true, additional DEO information is returned as by reference parameters. The by reference parameters have the following meanings:

By Reference Parameter Description
hoServer This returns the DEO's data-dictionary server (the DEO's Server property). If the focus object is not a DEO but it is nested within a DEO, it returns the value for the parent DEO.
bHasRecord This returns true if the DEO's data-dictionary has an active record (the DataDictionary's HasRecord function). If the focus object is not a DEO but it is nested within a DEO, it returns the value for the parent DEO.
bChanged This returns true if the DEO's Should_Save property is true. If the focus object is not a DEO but it is nested within a DEO, it returns the value for the parent DEO
bHasIndex This returns true if the focus object is a DEO control (e.g. dbForm) and its Data_File and Data_Field properties identify it as being bound to a table/column that has an index. If this object is not a DEO it returns false - even if it is nested within a DEO.

The function returns false if the focus object and none its parents are DEOs. In such a case the other by reference parameters have no defined value and should not be used.

Sample 1

The cCJSaveMenuItem uses the following logic to determine if the focus object is a DEO and if a save is needed.

Function IsEnabled Returns Boolean
    Boolean bIsDEO bHasRecord bChanged bEnabled bHasIndex
    Handle hoServer
    Get DEOInformation (&hoServer) (&bHasRecord) (&bChanged) (&bHasIndex) to bIsDeo
    Function_Return (bIsDEO and hoServer and bChanged)
End_Function

Sample 2

The cCJFindMenuItem uses the following logic to determine if the focus object is a DEO and a find is supported.

Function IsEnabled Returns Boolean
    Boolean bIsDEO bHasRecord bChanged bEnabled bHasIndex bIsFind
    Handle hoServer hoFocus hoCommandBars
    Get DEOInformation (&hoServer) (&bHasRecord) (&bChanged) (&bHasIndex) to bIsDeo
    If (bIsDEO and hoServer and bHasIndex) Begin
        // if it is a candidate for finding we must check if this supports the DEO Find protocol
        Get Focus of desktop to hoFocus
        Get CommandBarSystemObject to hoCommandBars // must exist or a programming bug
        Get Is_Function of hoCommandBars Get_Deo_Find_Object hoFocus True to bIsFind
        Function_Return bIsFind
    End
    Function_Return False
End_Function

Return Value

Returns true if the focus object is a DEO (data entry object) or it is nested within a DEO.Returns