ATButton: 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 | ATButton is OS-independant button component, flat look. Button as usual has Caption, OnClick. | |
| 4 | 4 | ||
| 5 | 5 | - button state can be: usual (default: light gray), mouse-over (light gray), checked (dark gray), disabled (red-gray) | |
| 6 | 6 | - buttons have border of 1..n pixels | |
| 7 | 7 | - prop Caption | |
| 8 | 8 | - prop Checkable means that click toggles Checked | |
| 9 | 9 | - prop Focusable means that button can focus (and paint frame of other color if focused) | |
| 10 | 10 | - prop Flat: passive (not under cursor) button don't paint its backgnd and border | |
| 11 | 11 | - prop Kind: button can have several kinds. | |
| 12 | 12 | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 13 | + |  | |
| 17 | 14 | ||
| 18 | 15 | Author: Alexey Torgashin | |
| 19 | 16 | ||
| 20 | 17 | # Kinds of buttons | |
| 21 | 18 | ||
| 22 | 19 | Buttons can have these Kind values: | |
| 23 | 20 | ||
| 24 | 21 | - abuTextOnly: Show caption only. | |
| 25 | 22 | - abuIconOnly: Show icon only. | |
| 26 | 23 | - abuTextIconHorz: Show icon and caption righter it. | |
| 27 | 24 | - abuTextIconVert: Show icon and caption below it. | |
| 28 | 25 | - abuSeparatorHorz: Show horizontal separator line. | |
| 29 | 26 | - abuSeparatorVert: Show vertical separator line. | |
| 30 | 27 | ||
| 31 | 28 | Icon can be set by 2 ways: | |
| 32 | 29 | ||
| 33 | 30 | - prop Images: TImageList; with prop ImageIndex (used first) | |
| 34 | 31 | - prop Picture: TPicture (used if no Images/ImageIndex is set) | |
| 35 | 32 | ||
| 36 | 33 | To paint also drop-down arrow on the right side, set Arrow=True. To make button with arrow only, set Kind=abuTextOnly and Arrow=True. | |
| 37 | 34 | ||
| 38 | 35 | # Theme | |
| 39 | 36 | ||
| 40 | 37 | Colors/fonts of all buttons defined by global var, of type like this | |
| 41 | 38 | ||
| 42 | 39 | ``` pascal | |
| 43 | 40 | type | |
| 44 | 41 | TATButtonTheme = record | |
| 45 | 42 | FontName: string; | |
| 46 | 43 | FontSize: integer; | |
| 47 | 44 | FontStyles: TFontStyles; | |
| 48 | 45 | ColorFont, | |
| 49 | 46 | ColorFontDisabled, | |
| 50 | 47 | ColorBgPassive, | |
| 51 | 48 | ColorBgOver, | |
| 52 | 49 | ColorBgChecked, | |
| 53 | 50 | ColorBgDisabled, | |
| 54 | 51 | ColorArrow, | |
| 55 | 52 | ColorBorderPassive, | |
| 56 | 53 | ColorBorderOver, | |
| 57 | 54 | ColorBorderFocused: TColor; | |
| 58 | 55 | MouseoverBorderWidth: integer; | |
| 59 | 56 | PressedBorderWidth: integer; | |
| 60 | 57 | PressedCaptionShiftY: integer; | |
| 61 | 58 | PressedCaptionShiftX: integer; | |
| 62 | 59 | end; | |
| 63 | 60 | ||
| 64 | 61 | var | |
| 65 | 62 | ATButtonTheme: TATButtonTheme; | |
| 66 | 63 | ``` | |
| 67 | 64 | ||
| 68 | 65 | # License | |
| 69 | 66 | ||
| 70 | 67 | MPL 2.0 or LGPL. | |
| 71 | 68 | ||
| 72 | 69 | # Download | |
| 73 | 70 | ||
| 74 | 71 | GitHub repository: <https://github.com/Alexey-T/ATFlatControls> | |
| 75 | 72 | ||
| 76 | 73 | --- | |
| 77 | 74 | *From the Free Pascal wiki, page "ATButton", as it stood on 2021-12-16 after a change by Alextp, 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).* | |
| 78 | 75 | Category: Components | |
| 79 | 76 | Category: Lazarus |
