From f10fc71ad7927e6b0976ebcfe3c021d590c7eff1 Mon Sep 17 00:00:00 2001 From: Marc Meumann Date: Thu, 19 Sep 2024 12:30:15 +0200 Subject: [PATCH] Mod to VCL Headers demo. Custom header --- .../Header_Footer/TeeGrid_Header_Footer.res | Bin 154864 -> 154864 bytes .../VCL/Header_Footer/Unit_Header_Footer.dfm | 12 +++++++++--- .../VCL/Header_Footer/Unit_Header_Footer.pas | 18 +++++++++++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/demos/VCL/Header_Footer/TeeGrid_Header_Footer.res b/demos/VCL/Header_Footer/TeeGrid_Header_Footer.res index 00f623e28041dc888e27c24db6b0fd82ca63afe3..88b616008ac1e333f6203cfc44901de614c3e005 100644 GIT binary patch delta 20 ccmeyclk>w)&W0AoEle9?7+I!ojA60|0AmFR761SM delta 20 ccmeyclk>w)&W0AoEle9?7@4MTjA60|0Al$F6aWAK diff --git a/demos/VCL/Header_Footer/Unit_Header_Footer.dfm b/demos/VCL/Header_Footer/Unit_Header_Footer.dfm index a4dafa8..b04a87e 100644 --- a/demos/VCL/Header_Footer/Unit_Header_Footer.dfm +++ b/demos/VCL/Header_Footer/Unit_Header_Footer.dfm @@ -10,10 +10,8 @@ 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 @@ -21,7 +19,6 @@ object FormHeaderFooter: TFormHeaderFooter Width = 1042 Height = 679 Columns = <> - ReadOnly = False Align = alClient UseDockManager = False ParentBackground = False @@ -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 diff --git a/demos/VCL/Header_Footer/Unit_Header_Footer.pas b/demos/VCL/Header_Footer/Unit_Header_Footer.pas index 748b36a..9d1654c 100644 --- a/demos/VCL/Header_Footer/Unit_Header_Footer.pas +++ b/demos/VCL/Header_Footer/Unit_Header_Footer.pas @@ -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 @@ -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; @@ -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;