Recent

Author Topic: [Solved] Can ATTabs show multiple lines  (Read 4122 times)

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
[Solved] Can ATTabs show multiple lines
« on: September 05, 2017, 04:17:51 pm »
I'm using the ATTabs component which has many neat features. Since I want 15 different tabs, I really need two or maybe three lines of tabs. How can this be done?  Also, it is forcing each tab to be the same width. Can I have variable width tabs.
« Last Edit: September 07, 2017, 01:20:43 am by bobonwhidbey »
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

Noodly

  • Jr. Member
  • **
  • Posts: 70
Re: Can ATTabs show multiple lines
« Reply #1 on: September 07, 2017, 12:35:16 am »
ATTabs doesn't appear to support multi lines or variable tab widths.

You can simulate multi lines by adding a component per line and aligning (stacking) them by either:

1) Setting them all to alTop and creating them in reverse order

2) Or setting the first to alTop and using anchors to align each subsequent line to the previous component

You would need to modify the component to allow  variable tab widths.
« Last Edit: September 07, 2017, 12:36:47 am by Noodly »
Windows 10 Home, Lazarus 2.02 (svn 60954), FPC 3.04

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
Re: Can ATTabs show multiple lines
« Reply #2 on: September 07, 2017, 01:20:27 am »
Thank you Noodly. I'm going with two components, one on top of the other. I decided that variable width tabs would not look as good as the fixed width tabs.
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: [Solved] Can ATTabs show multiple lines
« Reply #3 on: November 19, 2017, 08:45:23 pm »
ATTabs doesn't appear to support multi lines or variable tab widths.
You can simulate multi lines by adding a component 

Now it is solved. Already for week or two. Multiline added (see history.txt file) and var-width added too.
AFAIK props OptVarWidth and OptMultiline.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
Re: [Solved] Can ATTabs show multiple lines
« Reply #4 on: November 19, 2017, 11:41:46 pm »
The TATTabs component installed easily and seems to work perfectly, with LOTS of options. Nice work.

An option I had in Delphi, which I would like to see, automatically adjusts the width of each tab (subject to the minimum and maximum widths) to fill the width of the component. With this option there is no empty space between the rightmost tab and the end of the component. I think the extra space padded to the width of each tab is about the same.

Most importantly, when the user shrinks the size of the screen so that a 2nd or 3rd line of tabs is now needed, more than one tab "flops" over to the 2nd line so that the extra space (width) in each tab is about the same. I've attached a look from an old Delphi program. Maybe you already have this feature but I didn't see it.
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 592
    • Double Dummy Solver - free download
Re: [Solved] Can ATTabs show multiple lines
« Reply #6 on: November 20, 2017, 05:21:36 pm »
Almost. It will look better if the space added (padding) is about the same in each tab on every line. Therefore, when a 2nd line is required you have to flop over to the 2nd line about half of the tabs so that all the tabs on all lines have roughly the same padding. As you can see from the attachment, the bottom tab has a large amount of padding while the top line tabs each have a small amount of padding.
Lazarus 3.0RC2, FPC 3.2.2 x86_64-win64-win32/win64

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: [Solved] Can ATTabs show multiple lines
« Reply #7 on: November 20, 2017, 06:38:42 pm »
Pls see method DoUpdateTabRects. the addition of deltas (to fill size) is made in "if FOptFillWidth....."
I don't know how to do it, maybe you know?

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: [Solved] Can ATTabs show multiple lines
« Reply #8 on: November 20, 2017, 08:19:32 pm »
Now I suggest to change OptFillWidthLastToo to false, to make nice took with ur test.

 

TinyPortal © 2005-2018