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