summaryrefslogtreecommitdiff
path: root/docview/src/docdump/readcontrols.pas
blob: 395a36db3cc27edd6ab14ab2ee1659d3ccf57fe5 (plain)
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
{
  Dump the controls data
}
unit readcontrols;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, filestreamhelper;

procedure ProcessControls(AIn: TFileStream; AOut: TFileTextStream);


implementation

uses
  readheader, IPFFileFormatUnit;

procedure ProcessControls(AIn: TFileStream; AOut: TFileTextStream);
var
  ctrls: TPanelControls;
  i: integer;
begin
  AOut.WriteLn('');
  AOut.WriteLn('Panel Controls (Buttons)');
  if eHdr.CtrlOffset > 0 then
  begin
    AIn.Seek(eHdr.CtrlOffset, soBeginning);
    AIn.Read(ctrls, SizeOf(TControlDef));
    AOut.WriteLn(Format('  PanelControls.ControlCount:  %4.4x (%0:d)', [ctrls.ControlCount]));
    AOut.WriteLn(Format('  PanelControls.GroupCount:    %4.4x (%0:d)', [ctrls.GroupCount]));
    AOut.WriteLn(Format('  PanelControls.GroupIndex:    %4.4x (%0:d)', [ctrls.GroupIndex]));
    AOut.WriteLn(Format('  PanelControls.Reserved:      %4.4x (%0:d)', [ctrls.Reserved]));
    AOut.WriteLn('  *****');
    AOut.WriteLn('  <todo - process CountrolCount and GroupCount data>');
  end
  else
    AOut.WriteLn('  No panel control found');
end;

end.