Recent

Author Topic: Anyone using ATTabs control?  (Read 3404 times)

snorkel

  • Hero Member
  • *****
  • Posts: 817
Anyone using ATTabs control?
« on: November 05, 2015, 12:27:01 am »
I guess I am used to using the tpagecontrol

how do you have each tab have for instance a tmemo or a form?
Can ATTabs be used for a tab based MDI type interface?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

parcel

  • Full Member
  • ***
  • Posts: 141
Re: Anyone using ATTabs control?
« Reply #1 on: November 05, 2015, 06:05:25 am »
It is possible.
I'm using TStringGrid with TExtendedNotebook control.


fred

  • Full Member
  • ***
  • Posts: 201
Re: Anyone using ATTabs control?
« Reply #2 on: November 05, 2015, 08:50:29 am »
You have to create a TMemo at runtime, you can take a look at ATGroups, there is a demo using TMemo.

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using ATTabs control?
« Reply #3 on: November 05, 2015, 07:12:38 pm »
Thanks Fred,
I see in ATGroups there is a ATPages that can be used as a single page control.
I tested it with a borderless form and it worked fine.

Only thing it seems to be missing is a property to add a tab icon like in Firefox.

has anyone added a tab icon property to the tab data object so the icon could be set like the caption is?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

fred

  • Full Member
  • ***
  • Posts: 201
Re: Anyone using ATTabs control?
« Reply #4 on: November 06, 2015, 11:40:28 am »
I tried something like this:
ImageList1.Add the image/icons ( I used 16x16 )
Set TabIndentLeft: Integer - space between text and tab left edge like 30 or so
And in OnTabDrawAfter: TATTabDrawEvent - called after painting a tab on canvas
use something like ImageList1.Draw(ACanvas, ARect.Left+6, ARect.Top+4, ATabIndex); to show the image
Looks nice, one day I will use it too :)
But like most programmers, time, time... :(
My test code looks bad, but I can clean it up if it helps you.

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: Anyone using ATTabs control?
« Reply #5 on: November 18, 2015, 07:59:09 pm »
Just a follow up.
I was able to convert two of my apps from the standard tpagecontrol to Attabs. 
Wow does it work great.  Best tabs/page control ever and it's super easy to extend the TATTabData object to add things like a image index that can then be drawn in the aftertabdraw event.  Super easy to even change the tabs icon based on conditions like if the form attached to the tab is doing something like uploading a file in a thread etc etc.

I just included  a copy of the units in my project so my modifications stay local to the project.



***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

 

TinyPortal © 2005-2018