unit dgui_dump;

interface

uses
  dstrnum,
  DEng,
  dgui3;

procedure GuiDump(Gui: PWidget);

implementation

procedure GuiDump(Gui: PWidget);
var
  Ident: AnsiString;
  procedure Dump(Widget: PWidget);
  var
    It: PWidget;
  begin
    Log(Ident + Widget^.WidgetName +
        ' ' + IntToStr(Widget^.RelativePos.X) +
        ' ' + IntToStr(Widget^.RelativePos.Y) +
        ' ' + IntToStr(Widget^.Size.X) +
        ' ' + IntToStr(Widget^.Size.Y));
    Ident := Ident + '|- ';
    It := Widget^.SubFirst;
    while It <> nil do begin
      Dump(It);
      It := It^.Next;
    end;
    SetLength(Ident, Length(Ident) - 3);
  end;
begin
  Ident := '';
  Dump(Gui);
end;

end.
