* * *

Author Topic: TATTabs - center tab caption  (Read 116 times)

tudi_x

  • Sr. Member
  • ****
  • Posts: 400
TATTabs - center tab caption
« on: December 07, 2017, 04:11:47 pm »
hi All,
please advise if it is possible to center the tab caption through a method/property.

Code: Pascal  [Select]
  1. procedure TForm1.FormShow(Sender: TObject);
  2. begin
  3.   _T := TATTabs.Create(Panel1);
  4.   _T.Parent := Panel1;
  5.   _T.Align := alTop;
  6.  
  7.   _T.AddTab(-1, 'xxxxxxxxxxxxx');
  8.   _T.AddTab(-1, 'yyy yyyyyyyy', nil, False);
  9.  
  10.   _T.ColorBg := clWhite;
  11.   _T.OptShowPlusTab := False;
  12.   _T.OptShowXButtons := atbxShowNone;
  13.  
  14.   _T.OptArrowSize := 0;
  15.   _T.OptSpaceBetweenTabs := 0;
  16.   _T.OptColoredBandSize := 0;
  17.   _T.ColorTabActive := clWhite;
  18.   _T.ColorTabPassive := clWhite;
  19.   _T.ColorTabOver := clWhite;
  20.  
  21.   _E := TEdit.Create(Panel1);
  22.   _E.Parent := Panel1;
  23.   _E.BorderStyle:= bsNone;
  24.   _E.Align := alClient;
  25. end;      

thank you Lazarus 1.8
« Last Edit: December 07, 2017, 04:17:17 pm by tudi_x »

taazz

  • Hero Member
  • *****
  • Posts: 4485
Re: TATTabs - center tab caption
« Reply #1 on: December 07, 2017, 05:04:24 pm »
hi All,
please advise if it is possible to center the tab caption through a method/property.


Code: Pascal  [Select]
  1. var
  2.   vtabData:TATTabData;
  3. begin
  4.   vTabData := _T.GetTabData(0);//FirstTab.
  5.   vTabData.TabCaption := 'My Caption';
  6. end;
  7.  
ATTab is a 3rd party control.


PS
  oops, center, not change lost me eyes as it seems. sorry. But the version I have is a bit old and it only has autosized tabs so can't help at the moment.
« Last Edit: December 07, 2017, 05:14:35 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

tudi_x

  • Sr. Member
  • ****
  • Posts: 400
Re: TATTabs - center tab caption
« Reply #2 on: December 07, 2017, 05:14:49 pm »
thank you

i was also adding captions on lines 7,8.
i added the caption as per your example and the caption is not centered to the tab - i do not see any method on top of caption to center.
should i use the padding?
please advise

saw your update only after i posted.
« Last Edit: December 07, 2017, 05:16:22 pm by tudi_x »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus