ATTabs: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## About | |
| 2 | 2 | ||
| 3 | 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 | 4 | ||
| 5 | 5 | Screenshot: | |
| 6 | 6 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 7 | + |  | |
| 11 | 8 | ||
| 12 | 9 | Author: Alexey Torgashin | |
| 13 | 10 | ||
| 14 | 11 | ## History | |
| 15 | 12 | ||
| 16 | 13 | GitHub repo has the [history.txt file](https://github.com/Alexey-T/ATFlatControls/blob/master/history.txt) which lists all major changes. | |
| 17 | 14 | ||
| 18 | 15 | ## Requirements | |
| 19 | 16 | ||
| 20 | 17 | - Lazarus: 1.8+. | |
| 21 | 18 | - Tested on: Windows, Linux GTK2/Qt, macOS. | |
| 22 | 19 | ||
| 23 | 20 | ## How to use it like TPageControl | |
| 24 | 21 | ||
| 25 | 22 | 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 | 23 | ||
| 27 | 24 | - Add tabs OnChange event handler. | |
| 28 | 25 | - In this event handler: a) hide all frames, b) show frame, which is assigned to current TabIndex. | |
| 29 | 26 | ||
| 30 | 27 | 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 | 28 | ||
| 32 | 29 | ``` Pascal | |
| 33 | 30 | var | |
| 34 | 31 | d: TATTabData; | |
| 35 | 32 | begin | |
| 36 | 33 | d:= t.GetTabData(t.TabIndex); | |
| 37 | 34 | if Assigned(d) then | |
| 38 | 35 | (d.TabObject as TMyFrame).Show; | |
| 39 | 36 | end; | |
| 40 | 37 | ``` | |
| 41 | 38 | ||
| 42 | 39 | ## License | |
| 43 | 40 | ||
| 44 | 41 | License: MPL 2.0. Also you can use it under LGPL. | |
| 45 | 42 | ||
| 46 | 43 | ## Download | |
| 47 | 44 | ||
| 48 | 45 | ATTabs is merged into ATFlatControls repo: <https://github.com/Alexey-T/ATFlatControls/> . Some wiki documentation is in the "wiki" subfolder of that repo. | |
| 49 | 46 | ||
| 50 | 47 | --- | |
| 51 | 48 | *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).* |
