Author Crome969 Unit UOProperty Languange Pascal Script Version Versio

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
(*********************************************************
* Author : Crome969
* Unit : UOProperty
* Languange : Pascal Script
* Version : 1.0
*********************************************************
Version 1.0 : Finished Work for BaseComponents
*********************************************************)
unit UOProperty;
interface
Type
TSuperPropertyEntry = record
ClilocID : Cardinal;
ClilocText : string;
Params : array of Variant;
end;
TSuperProperty = record
Entries: array of TSuperPropertyEntry;
Count: Integer;
Timestamp: TDateTime;
end;
function GetProperty(ObjID: Cardinal; var ToolTip: string): Boolean;
function GetPropertyEx(ObjID: Cardinal; var ToolTip: TClilocRec): Boolean;
function GetSuperProperty(ClilocToolTip: TClilocRec; var ToolTip: TSuperProperty): Boolean;
function GetSuperPropertyEx(ObjID: Cardinal; var ToolTip: TSuperProperty): Boolean;
Function GetEntry(ToolTip: TSuperProperty;ClilocID:Cardinal;var Entry : TSuperPropertyEntry):Boolean;
implementation
function GetProperty(ObjID: Cardinal; var ToolTip: string): Boolean;
begin
ToolTip := GetTooltip(ObjID);
Result := (Trim(ToolTip) <> '');
end;
function GetPropertyEx(ObjID: Cardinal; var ToolTip: TClilocRec): Boolean;
begin
ToolTip := GetToolTipRec(ObjID);
Result := (ToolTip.Count > 0);
end;
function GetSuperProperty(ClilocToolTip: TClilocRec; var ToolTip: TSuperProperty): Boolean;
var
SubProperty: TClilocItemRec;
a: Integer;
b: Integer;
SubEntry: TSuperPropertyEntry;
StubEntry: TSuperPropertyEntry;
begin
ToolTip.Count := ClilocToolTip.Count;
SetLength(ToolTip.Entries, 0);
StubEntry.ClilocID := 0;
StubEntry.ClilocText := '';
SetLength(StubEntry.Params, 0);
SetLength(ToolTip.Entries, ToolTip.Count);
for a := 0 to (ToolTip.Count - 1) do
begin
SubEntry := StubEntry;
SubProperty := ClilocToolTip.Items[a];
SubEntry.ClilocID := SubProperty.ClilocID;
SubEntry.ClilocText := GetClilocByID(SubEntry.ClilocID);
SetLength(SubEntry.Params, Length(SubProperty.Params));
for b := 0 to (Length(SubProperty.Params) - 1) do
begin
SubEntry.Params[b] := SubProperty.Params[b];
end;
ToolTip.Entries[a] := SubEntry;
end;
ToolTip.Timestamp := Now;
Result := (ToolTip.Count > 0);
end;
function GetSuperPropertyEx(ObjID: Cardinal; var ToolTip: TSuperProperty): Boolean;
var
SuperStub: TSuperProperty;
Stub: TClilocRec;
begin
ToolTip := SuperStub;
if (GetPropertyEx(ObjID, Stub)) then
begin
GetSuperProperty(Stub, ToolTip);
end;
Result := (ToolTip.Count > 0);
end;
Function GetEntry(ToolTip: TSuperProperty;ClilocID:Cardinal;var Entry : TSuperPropertyEntry):Boolean;
var
fStub : TSuperPropertyEntry;
fIndex : Integer;
begin
Result := False;
Entry := fStub;
for fIndex := 0 to Length(ToolTip.Entries) - 1 do
begin
if (ToolTip.Entries[fIndex].ClilocID = ClilocID) then
begin
Entry := ToolTip.Entries[fIndex];
Result := True;
Exit;
end;
end;
end;
end.