Subversion Repositories fastphp

Compare Revisions

Regard whitespace Rev 40 → Rev 39

/trunk/FastPHPTreeView.pas
42,9 → 42,9
class function Read(var ptr: PChar; len: integer): string; inline;
procedure Rec100(tn: TTreeNode; var ptr: PChar);
protected
function DoFillWithFastPHPData(ptr: PChar): boolean;
procedure DoFillWithFastPHPData(ptr: PChar);
public
function FillWithFastPHPData(data: string): boolean;
procedure FillWithFastPHPData(data: string);
end;
 
EFastNodeException = class(Exception);
68,7 → 68,7
Result := StrToInt('$' + HexNum);
end;
 
function TTreeViewFastPHP.DoFillWithFastPHPData(ptr: PChar): boolean;
procedure TTreeViewFastPHP.DoFillWithFastPHPData(ptr: PChar);
 
function _NodeID(tn: TTreeNode): string;
var
92,17 → 92,22
selected, magic: string;
horPos, verPos: integer;
i: integer;
crc32: string;
begin
// No update if the user is dragging the scrollbar
// (otherwise the program will somehow lock up)
result := GetCapture <> Handle;
if not result then exit;
if GetCapture = Handle then exit;
 
// Don't rebuild the treeview if nothing has changed (use the Tag property to store the CRC32)
crc32 := Read(ptr, 8);
if crc32 = IntToHex(Tag, 8) then exit;
Tag := HexToInt(crc32);
 
selected := '';
expanded := TStringList.Create;
horPos := GetScrollPos(Handle, SB_HORZ);
verPos := GetScrollPos(Handle, SB_VERT);
LockWindowUpdate(Handle); // Parent is better choice for FastPHP... but for other applications it might be wrong?
LockWindowUpdate(Parent.Handle); // Parent is better choice for FastPHP... but for other applications it might be wrong?
Self.Items.BeginUpdate;
try
{$REGION 'Remember our current state (selected and expanded flags)'}
154,12 → 159,12
end;
end;
 
function TTreeViewFastPHP.FillWithFastPHPData(data: string): boolean;
procedure TTreeViewFastPHP.FillWithFastPHPData(data: string);
begin
data := Trim(data);
if not EndsStr('X', data) then raise EFastNodeException.Create('FastNode string must end with "X"');
 
result := DoFillWithFastPHPData(PChar(data));
DoFillWithFastPHPData(PChar(data));
end;
 
class function TTreeViewFastPHP.Read(var ptr: PChar; len: integer): string;