BpcSMScriptLibrary 5

From RiskWiki

Jump to: navigation, search

Value List Editor Utility routines

Language: Delphi 7 - 2007


//////////////////////////////////////////////////////////////////////////////////////////
//////// Value List Editor Utility routines
//////////////////////////////////////////////////////////////////////////////////////////

interface
uses Classes, Grids, ValEdit;
type
   TbpcSimplProc = procedure of object;
   TbpcOnValidateEvent = procedure(Sender: TObject; ACol, ARow: Longint; const KeyName, KeyValue: string) of object;

// Create and return a property item owned by a VLE with editstyle and editmask as provided.
// myEditStyle = esSimple, esEllipsis, esPickList
// myEditMask = '' or something like '999;9; '
function bpcVLEPropCreate( OwnerValueListEditor : TValueListEditor; myEditStyle: TEditStyle; myEditMask : string  ) : TItemProp;
// Create, Assign to key (as name string) and return a property item owned by a VLE with editstyle and editmask as provided.
function bpcVLEPropAssign( OwnerValueListEditor : TValueListEditor; key : string; myEditStyle: TEditStyle; myEditMask : string  ) : TItemProp; overload;
// Create, Assign to key (as an index position) and return a property item owned by a VLE with editstyle and editmask as provided.
function bpcVLEPropAssign( OwnerValueListEditor : TValueListEditor; key : integer; myEditStyle: TEditStyle; myEditMask : string  ) : TItemProp; overload;
// Initialise (by creating) all the propertied for keys in a VLE with the ordered list of editstyles and editmasks
procedure bpcVLESetPropItems( OwnerValueListEditor : TValueListEditor; myEditStyles : array of TEditStyle;  myEditMasks : array of string ); overload;
// Initialise (by creating) the properties for named keys (in myKeys) in a VLE with the ordered list of editstyles and editmasks
procedure bpcVLESetPropKeyedItems( OwnerValueListEditor : TValueListEditor; myKeys : array of string; myEditStyles : array of TEditStyle;  myEditMasks : array of string ); overload;
// Initialise the VLE properties to esSimple, excepte for those defined in the SpecialFormats stringlist
// SpecialFormats strings should have the form:
// <visible keyname>=ellipsis|picklist;<mask>
// where <mask> can be a delphi format string of the form '999;9;_'  (Note a '_' as the final mask part is changed to a ' ' in the created property)
// Example:
// 'Company Number=picklist;999;9;_'
procedure bpcVLEInitPropItems( OwnerValueListEditor : TObject; SpecialFormats : TStrings );
// Get the current Value of a VLE based on its current row
function bpcVLECurrentValue( OwnerValueListEditor : TObject ) : string;
// Set the current Value of a VLE based on its current row (returns the newly assigned value as now stored (not necessaryily as provided)
function bpcVLESetCurrentValue( OwnerValueListEditor : TObject; ToValue : string ) : string;
// Get the current Key of a VLE based on its current row
function bpcVLECurrentKey( OwnerValueListEditor : TObject ) : string;
// Get the trimmed value of a VLE based on a Key
function bpcVLETrimmedValue( OwnerValueListEditor : TObject; Key : string ) : string; overload;
// Get the trimmed value of a VLE based on an Index
function bpcVLETrimmedValue( OwnerValueListEditor : TObject; Index : integer ) : string; overload;
// Get the key of a VLE based on an Index
function bpcVLEName( OwnerValueListEditor : TObject; Index : integer ) : string;
// Set the current Value of a VLE based on its current row (returns the newly assigned value as now stored (not necessaryily as provided)
function bpcVLESetKeyedValue( OwnerValueListEditor : TObject; Key : string; ToValue : string ) : string;
// Get the row count of the current VLE
function bpcVLERowCount( OwnerValueListEditor : TObject ) : integer;
// Set the VLE's Strings Content
function bpcVLESetStrings( OwnerValueListEditor : TObject; Text : string ) : string ;  overload;
// Set the VLE's Strings (Key/Value) using a stringlist
function bpcVLESetStrings( OwnerValueListEditor : TObject; myStrings : tstrings ) : tstrings ; overload;
// Set the VLE's ValidateEvent
function bpcVLESetOnValidate( OwnerValueListEditor : TObject; Value : TbpcOnValidateEvent ) : TbpcOnValidateEvent ;
// Get the VLE's ValidateEvent
function bpcVLEGetOnValidate( OwnerValueListEditor : TObject ) : TbpcSimplProc ;
// Get the VLE's Keys List
function bpcVLEGetKeys( OwnerValueListEditor : TObject ) : tstrings ;


BackLinks



CopyRight Bishop Phillips Consulting Pty Ltd 1997-2012 ( BpcSMScriptLibrary 5 )
Personal tools