---------------------------------------------------
Class : cSigCJPropertyGridComboFormItem
Superclass : cSigCJPropertyGridItem
Package : cSigCJPropertyGrid.pkg
Mixins : cSigCJPropertyGridItemButton_Mixin
Description : Property Grid Item with Drop Down ComboForm
Properties : psLabel (String)
psHelpText (String)
psToolTip (String)
pbCreateExpanded (Boolean)
pbLabelEmboldened (Boolean)
peItemType (Integer)
pvValue (Variant)
pbDefaultAsInitialValue (Boolean)
pvDefaultValue (Variant)
pvInitialValue (Variant)
pvTag (Variant)
pbHidden (Boolean)
pbReadOnly (Boolean)
pbPassword_State (Boolean)
pbCapslock_State (Boolean)
piForm_Margin (Integer)
piValueBackgroundColor (Integer)
psButtonCaption (String)
pbButtonEnabled (Boolean)
psButtonImage (String)
piButtonWidth (Integer)
psButtonTooltip (String)
Events : OnClick
OnChange
OnEditAfter
OnMoveItemDataIn
OnMoveItemDataOut
OnAddLookupItems
Methods : Procedure Set PropertyItemMask (String llMask String llLiteral Variant llPrompt)
Procedure Set LookupItemImage (Integer iItemIndex String sImage)
Procedure Set LookupItemData (Integer iItemIndex Integer iItemData)
Procedure AddLookupItem (String sDescription Integer iItemData String sImage Variant vCode)
Function CodeFromDescription (String sDescription Boolean ByRef bFound Returns Variant)
Function ItemDataFromDescription (String sDescription Boolean ByRef bFound Returns Integer)
Function DescriptionFromCode (Variant vCode Boolean ByRef bFound Returns String)
Procedure ComboDeleteItems
Notes :
To Do :
---------------------------------------------------
Construct_Object()
- tdGridItemSelectionValue[]
ptaGridItemSelectionValue
End_Construct_Object()
OnAddLookupItems()
---------------------------------------------------
Procedure : OnAddLookupItems
Scope : Public Event
Paramaters : None
Returns : None
Purpose : Intended that you would call "Send AddLookupItem" from this event to populate the combo
Notes : If the item is bound to a data field that has a Field_Table_Object the combo will automatically
be populated. If you want to add images you should forward Send OnAddLookupItems and then add the images
---------------------------------------------------
ComboDeleteItems()
---------------------------------------------------
Procedure : ComboDeleteItems
Scope : Public Method
Paramaters : None
Returns : None
Purpose : Can be used to clear all of a comboforms data items
Notes :
---------------------------------------------------
- Integer
hoConstraint_s - Variant
vConstraint_s - tdGridItemSelectionValue[]
taGridItemSelectionValues
DoAddLookupItems()
---------------------------------------------------
Procedure : DoAddLookupItems
Scope : Private
Paramaters : None
Returns : None
Purpose : Called from Private.Create. Adds any lookup items to the list of constraints
Notes : Called internally. Developer does not need to concern themself with this
---------------------------------------------------
- Integer
hoConstraint_s - Integer
hoConstraint - Variant
vConstraint_s - Variant
vConstraint - Integer
iItems - Integer
iItemIndex - tdGridItemSelectionValue[]
taGridItemSelectionValues
AddLookupItem(String sDescription Integer iItemData String sImage Variant vCode)
---------------------------------------------------
Procedure : AddLookupItem
Scope : Public
Paramaters : sCaption, iData, sImage, vCode
Returns : None
Purpose : 'Registers' an item for inclusion in list of item constraints (lookup values)
Notes : vCode is added because it could be that the developer wants to display a descriptive value
whilst mapping to a code value in the background (the code being the value that ultimately
will be saved to the database)
---------------------------------------------------
- tdGridItemSelectionValue[]
taGridItemSelectionValue - Integer
iItems - Integer
iIconIndex
Set(Integer iItemIndex String sImage)
---------------------------------------------------
Procedure : Set LookupItemImage
Scope : Public
Paramaters : Integer iItemIndex String sImage
Returns : None
Purpose : Sets icon index for specified lookup item.
Notes : MUST be called AFTER AddLookupItem
---------------------------------------------------
- tdGridItemSelectionValue[]
taGridItemSelectionValue - Integer
iImageIndex
Set(Integer iItemIndex Integer iItemData)
---------------------------------------------------
Procedure : Set LookupItemData
Scope : Public
Paramaters : Integer iItemIndex Integer iItemData
Returns : None
Purpose : Sets item data for specified lookup item.
Notes : MUST be called AFTER AddLookupItem
---------------------------------------------------
- tdGridItemSelectionValue[]
taGridItemSelectionValue
- Integer
ConstraintDescriptionComparison(tdGridItemSelectionValue tDesc1 tdGridItemSelectionValue tDesc2)
---------------------------------------------------
Function : ConstraintDescriptionComparison
Scope : Private
Paramaters : tdGridItemSelectionValue x2 (for comparison)
Returns : Integer
Purpose : To compare the Description elements of 2 structs.
Notes : Used internally from CodeFromDescription and ItemDataFromDescription
---------------------------------------------------
- Integer
iRetVal
- Variant
CodeFromDescription(String sDescription Boolean ByRef bFound)
---------------------------------------------------
Function : CodeFromDescription
Scope : Public
Paramaters : sDescription, bFound (byref)
Returns : Variant (vCode)
Purpose : If you have the current value of an property item and you know this is one of a list of constraints
you can call this function to return the 'Code' value that is associated with this 'Description' value
Notes : bFound is passed by reference and tells the developer if the value that they were looking for was found or not.
You can't rely on a return value of 0 (or blank) as an indication of whether it was found because these may be valid values
---------------------------------------------------
- Integer
iSearchIndex - Variant
vRetVal - tdGridItemSelectionValue[]
taGridItemSelectionValues - tdGridItemSelectionValue
tGridItemSelectionValue
- Integer
ItemDataFromDescription(String sDescription Boolean ByRef bFound)
---------------------------------------------------
Function : ItemDataFromDescription
Scope : Public
Paramaters : sDescription, bFound (byref)
Returns : Integer (iItemData)
Purpose : If you have the current value of an property item and you know this is one of a list of constraints
you can call this function to return the iItemData value that is associated with this 'Description' value
Notes : bFound is passed by reference and tells the developer if the value that they were looking for was found or not.
You can't rely on a return value of 0 (or blank) as an indication of whether it was found because these may be valid values
---------------------------------------------------
- Integer
iRetVal - Integer
iSearchIndex - tdGridItemSelectionValue[]
taGridItemSelectionValues - tdGridItemSelectionValue
tGridItemSelectionValue
- Integer
ConstraintCodeComparison(tdGridItemSelectionValue tCode1 tdGridItemSelectionValue tCode2)
---------------------------------------------------
Function : ConstraintCodeComparison
Scope : Private
Paramaters : tdGridItemSelectionValue x2 (for comparison)
Returns : Integer
Purpose : To compare the Code elements of 2 structs.
Notes : Used internally from DescriptionFromCode
---------------------------------------------------
- Integer
iRetVal
- String
DescriptionFromCode(Variant vCode Boolean ByRef bFound)
---------------------------------------------------
Function : DescriptionFromCode
Scope : Public
Paramaters : vCode, bFound (byref)
Returns : sDescription
Purpose : If a property grid item has a combo form with descriptions and associated code values then you can call this
function to determine the description value for a specified code. This is most useful when populating the grid
from a database where the raw data is a code value but you wish to show a descriptive value in the control (think dbcomforms)
Notes : bFound is passed by reference and tells the developer if the value that they were looking for was found or not.
You can't rely on a return value of 0 (or blank) as an indication of whether it was found because these may be valid values
---------------------------------------------------
- String
sRetVal - Integer
iSearchIndex - tdGridItemSelectionValue[]
taGridItemSelectionValues - tdGridItemSelectionValue
tGridItemSelectionValue
BindToDataBase(Integer hFile Integer iField)
---------------------------------------------------
Function : BindToDataBase
Scope : Public
Paramaters : Integer hFile Integer iField
Returns : None
Purpose : Forward Send, but then because this is a combo item, see if there is a validation table for this field
If so, set the lookup items with the values from the validation table
Notes : Set pbCapslock_State to False if there is a codevalidation table. It may be a capslock field, but this will
be for the code, not the description (that we will be displaying)
---------------------------------------------------
- Variant[][]
vTableData - Integer
iTableObject - Integer
iItem - Integer
hoDD
ReadItemFromDatabase()
---------------------------------------------------
Function : ReadItemFromDatabase
Scope : Public
Paramaters : None
Returns : None
Purpose : Forward Send, but then because this is a combo item, see if we have a description that matches our value
If so, display this instead
---------------------------------------------------
- Integer
hoDD - Integer
iField - Variant
vValue - Boolean
bFound - String
sDescription
MoveItemDataToDatabase()
- Integer
hoDD - Integer
iField - Variant
vValue - Variant
vCode - Boolean
bFound
Private.Create(Handle hoParent Boolean bRecursive)
- Variant
vButton - Integer
hoButtons