Skip to content

Commit

Permalink
Mod to VCL Headers demo. Custom header
Browse files Browse the repository at this point in the history
  • Loading branch information
mogmem committed Sep 19, 2024
1 parent 4b6983f commit f10fc71
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
Binary file modified demos/VCL/Header_Footer/TeeGrid_Header_Footer.res
Binary file not shown.
12 changes: 9 additions & 3 deletions demos/VCL/Header_Footer/Unit_Header_Footer.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ object FormHeaderFooter: TFormHeaderFooter
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poOwnerFormCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object TeeGrid1: TTeeGrid
Left = 0
Top = 41
Width = 1042
Height = 679
Columns = <>
ReadOnly = False
Align = alClient
UseDockManager = False
ParentBackground = False
Expand Down Expand Up @@ -68,5 +65,14 @@ object FormHeaderFooter: TFormHeaderFooter
TabOrder = 2
OnClick = Button3Click
end
object Button4: TButton
Left = 936
Top = 10
Width = 91
Height = 25
Caption = 'New custom...'
TabOrder = 3
OnClick = Button4Click
end
end
end
18 changes: 17 additions & 1 deletion demos/VCL/Header_Footer/Unit_Header_Footer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ TFormHeaderFooter = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
Expand All @@ -34,7 +36,7 @@ implementation
uses
UITypes,
Tee.Grid.Bands, Tee.Painter, VCLTee.Editor.Grid.Bands,
Tee.Format, Tee.GridData.Rtti;
Tee.Format, Tee.GridData.Rtti, Tee.Grid.Bands.Columns;

procedure TFormHeaderFooter.Button1Click(Sender: TObject);
var tmp : TTeeGrid;
Expand Down Expand Up @@ -65,6 +67,20 @@ procedure TFormHeaderFooter.Button3Click(Sender: TObject);
TGridBandsEditor.Edit(Self,TeeGrid1.Footer)
end;

procedure TFormHeaderFooter.Button4Click(Sender: TObject);
var hdrBand : TColumnsBand;
begin
TeeGrid1.Headers.Clear;

TeeGrid1.Grid.Root.Header.Visible := False;

hdrBand := TColumnsBand.Create(TeeGrid1.Headers);

hdrBand.Texts[0] := 'Street';
hdrBand.Texts[1] := 'Level';

end;

procedure TFormHeaderFooter.FormCreate(Sender: TObject);
//var tmp : TBandGroup;
var tmpBand : TGridBand;
Expand Down

0 comments on commit f10fc71

Please sign in to comment.