Subversion Repositories fastphp

Rev

Rev 31 | Rev 34 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 33
Line 16... Line 16...
16
<LeafNode>       ::= "N" <Icon(8)> <LineNo(8)> <DescLen(4)> <Desc(Utf8)> .
16
<LeafNode>       ::= "N" <Icon(8)> <LineNo(8)> <DescLen(4)> <Desc(Utf8)> .
17
<IncreaseLevel>  ::= "I" .
17
<IncreaseLevel>  ::= "I" .
18
<DecreaseLevel>  ::= "D" .
18
<DecreaseLevel>  ::= "D" .
19
<Exit>           ::= "X" .
19
<Exit>           ::= "X" .
20
 
20
 
-
 
21
<Icon(8)>        ::= <Type(4)> <Attr(4)> .
-
 
22
 
21
*)
23
*)
22
 
24
 
23
type
25
type
24
  TTreeViewFastPHP = class helper for TTreeView
26
  TTreeViewFastPHP = class helper for TTreeView
25
  private
27
  private
Line 140... Line 142...
140
        caption := Utf8Decode(Read(ptr, StrToInt(len)));
142
        caption := Utf8Decode(Read(ptr, StrToInt(len)));
141
        if tn = nil then
143
        if tn = nil then
142
          lastTn := Self.Items.Add(nil, caption)
144
          lastTn := Self.Items.Add(nil, caption)
143
        else
145
        else
144
          lastTn := Self.Items.AddChild(tn, caption);
146
          lastTn := Self.Items.AddChild(tn, caption);
-
 
147
        // lastTn.ImageIndex := // TODO
145
        lastTn.Data := Pointer(StrToInt(lineno)); // TODO: is this good?
148
        lastTn.Data := Pointer(StrToInt(lineno)); // TODO: is this good?
146
      end
149
      end
147
      else if typ = 'I' then // increase level
150
      else if typ = 'I' then // increase level
148
      begin
151
      begin
149
        if LastTn = nil then raise EFastNodeException.Create('Fast100: Increase command requires previous node');
152
        if LastTn = nil then raise EFastNodeException.Create('Fast100: Increase command requires previous node');
Line 153... Line 156...
153
      else if typ = 'X' then Abort // exit
156
      else if typ = 'X' then Abort // exit
154
      else raise EFastNodeException.CreateFmt('Fast100: Command "%s" unknown', [typ]);
157
      else raise EFastNodeException.CreateFmt('Fast100: Command "%s" unknown', [typ]);
155
    end;
158
    end;
156
  except
159
  except
157
    on E: EAbort do
160
    on E: EAbort do
-
 
161
      if tn = nil then
158
      exit
162
        exit
159
    else
163
      else
160
      raise;
164
        raise;
-
 
165
    else
-
 
166
      raise;
161
  end;
167
  end;
162
end;
168
end;
163
 
169
 
164
end.
170
end.