Ignore:
Timestamp:
Jun 28, 2007, 11:24:08 AM (17 years ago)
Author:
alloc
Message:
 
Location:
oup/current/FileClasses
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oup/current/FileClasses/TXMP.pas

    r215 r232  
    1010    public
    1111      procedure InitDataFields; override;
     12      procedure InitEditor; override;
    1213  end;
    1314
     
    1516
    1617uses
    17   ConnectionManager, Math, Classes, TypeDefs, _DataTypes;
     18  ConnectionManager, Math, Classes, TypeDefs, _DataTypes, ExtCtrls, StdCtrls,
     19  Controls, Forms;
    1820
    1921{ TFile_TXMP }
     
    106108
    107109
     110procedure TFile_TXMP.InitEditor;
     111var
     112  group: TGroupBox;
     113  splitter: TSplitter;
     114begin
     115  inherited;
     116  FEditor := TFrame.Create(nil);
     117  group := TGroupBox.Create(FEditor);
     118  group.Align := alTop;
     119  group.Height := 150;
     120  group.Caption := '1. ';
     121  group.Parent := FEditor;
     122
     123  splitter := TSplitter.Create(FEditor);
     124  splitter.Align := alTop;
     125  splitter.Top := group.Height + 10;
     126  splitter.AutoSnap := False;
     127  splitter.MinSize := 100;
     128  splitter.Beveled := True;
     129  splitter.Height := 8;
     130  splitter.Parent := FEditor;
     131
     132  group := TGroupBox.Create(FEditor);
     133  group.Align := alClient;
     134  group.Caption := '2. ';
     135  group.Parent := FEditor;
     136end;
     137
    108138end.
    109139
  • oup/current/FileClasses/_FileTypes.pas

    r231 r232  
    3434      function GetRawPartByIndex(ID: Integer): TRawDataInfo;
    3535      function GetChildCount: Integer;
     36      function GetRawCount: Integer;
    3637    public
    3738      constructor Create(ConnectionID, FileID: Integer); virtual;
     
    5859      property FieldByIndex[ID: Integer]: TDataField read GetFieldByIndex;
    5960
     61      property RawCount: Integer read GetRawCount;
    6062      property RawPartByOffset[Offset: Integer]: TRawDataInfo read GetRawPartByOffset;
    6163      property RawPartByIndex[ID: Integer]: TRawDataInfo read GetRawPartByIndex;
     
    177179end;
    178180
     181function TFile.GetRawCount: Integer;
     182var
     183  i: Integer;
     184begin
     185  Result := Length(FRawParts);
     186  if Result > 0 then
     187  begin
     188    Result := 0;
     189    for i := 0 to High(FRawParts) do
     190      if FRawParts[i].RawSize > 0 then
     191        Inc(Result);
     192  end;
     193end;
     194
    179195function TFile.GetRawPartByIndex(ID: Integer): TRawDataInfo;
    180 begin
    181   if ID < Length(FRawParts) then
    182     Result := FRawParts[ID]
     196var
     197  i: Integer;
     198  valids: Integer;
     199begin
     200  if ID < GetRawCount then
     201  begin
     202    valids := 0;
     203    i := 0;
     204    repeat
     205      if FRawParts[i].RawSize > 0 then
     206      begin
     207        Inc(valids);
     208      end;
     209      Inc(i);
     210    until valids > ID;
     211    Result := FRawParts[i - 1];
     212  end
    183213  else
    184214    with Result do
Note: See TracChangeset for help on using the changeset viewer.