ATTabs: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: ATTabs
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## About | |
| 2 | + | ||
| 3 | + | *ATTabs* is a tab-control component for Delphi and Lazarus. It's not replacement for standard tab control, but is alternative one, it has different API. It paints tabs OS-indenendant, using custom drawing on canvas. | |
| 4 | + | ||
| 5 | + | Screenshot: | |
| 6 | + | ||
| 7 | + | <figure> | |
| 8 | + | <img src="ATTabs_demo.png" title="ATTabs_demo.png" /> | |
| 9 | + | <figcaption>ATTabs_demo.png</figcaption> | |
| 10 | + | </figure> | |
| 11 | + | ||
| 12 | + | Author: Alexey Torgashin | |
| 13 | + | ||
| 14 | + | ## History | |
| 15 | + | ||
| 16 | + | GitHub repo has the [history.txt file](https://github.com/Alexey-T/ATFlatControls/blob/master/history.txt) which lists all major changes. | |
| 17 | + | ||
| 18 | + | ## Requirements | |
| 19 | + | ||
| 20 | + | - Lazarus: 1.8+. | |
| 21 | + | - Tested on: Windows, Linux GTK2/Qt, macOS. | |
| 22 | + | ||
| 23 | + | ## How to use it like TPageControl | |
| 24 | + | ||
| 25 | + | Make some new panel, which will be like TPageControl. Place ATTabs on it, make Align=alTop. Now you create several Forms or Frames onto this panel (they have Parent:=Panel1; Align:=alClient;). How to switch these frames on changing tabs? | |
| 26 | + | ||
| 27 | + | - Add tabs OnChange event handler. | |
| 28 | + | - In this event handler: a) hide all frames, b) show frame, which is assigned to current TabIndex. | |
| 29 | + | ||
| 30 | + | When you create a new tab, you can set its TabObject property. Set TabObject to a frame. When OnChange is called, get TabIndex, call GetTabData() for this index, and read TabObject for this tab. Show the frame, which is stored in this TabObject, hide all others. | |
| 31 | + | ||
| 32 | + | ``` Pascal | |
| 33 | + | var | |
| 34 | + | d: TATTabData; | |
| 35 | + | begin | |
| 36 | + | d:= t.GetTabData(t.TabIndex); | |
| 37 | + | if Assigned(d) then | |
| 38 | + | (d.TabObject as TMyFrame).Show; | |
| 39 | + | end; | |
| 40 | + | ``` | |
| 41 | + | ||
| 42 | + | ## License | |
| 43 | + | ||
| 44 | + | License: MPL 2.0. Also you can use it under LGPL. | |
| 45 | + | ||
| 46 | + | ## Download | |
| 47 | + | ||
| 48 | + | ATTabs is merged into ATFlatControls repo: <https://github.com/Alexey-T/ATFlatControls/> . Some wiki documentation is in the "wiki" subfolder of that repo. | |
| 49 | + | ||
| 50 | + | --- | |
| 51 | + | *From the Free Pascal wiki, page "ATTabs", as it stood on 2021-03-26 after a change by Alextpp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
