* * *

Author Topic: ATButton/ATButtonsToolbar  (Read 4155 times)

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
ATButton/ATButtonsToolbar
« on: April 13, 2015, 03:10:02 am »
Button which paints as rectangle with 1pix frame, colors customizable via global vairable "theme like" (colors for passive, mouseover, checked, borders).
Button can be "Checkable" so it's Checked after click, unchecked after next click.

Also, ATButtonsToolbar is n buttons, which are aligned horiz/vertically.

http://wiki.freepascal.org/ATButton
http://wiki.freepascal.org/ATButtonsToolbar

Buttons have kinds:

- btn with text
- btn with text/icon
- icon only
- separator line
- text/icon with "v" arrow
- only "v" arrow

« Last Edit: March 17, 2017, 02:03:01 am by Alextp »

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATSimpleButton
« Reply #1 on: April 13, 2015, 05:15:06 pm »
Colors/fontname are inside "theme" now for all btns:

Code: [Select]
var
  BtnTheme: TATButtonTheme;

type
  TATButtonTheme = record
    FontName: string;
    FontSize: integer;
    FontStyles: TFontStyles;
    ColorFont,
    ColorBgPassive,
    ColorBgOver,
    ColorBgChecked,
    ColorBorderPassive,
    ColorBorderOver: TColor;
    MouseoverBorderWidth: integer;
    PressedBorderWidth: integer;
    PressedCaptionLower: integer;
  end;

Blaazen

  • Hero Member
  • *****
  • Posts: 2371
  • POKE 54296,15
    • Eye-Candy Controls
Re: ATSimpleButton
« Reply #2 on: April 13, 2015, 05:48:12 pm »
You can use TPersistent instead of record. It has one adventage: record cannot be published but subclass TPersistent can, and it will appear in OI.
Lazarus 1.9 r54603M FPC 3.0.2 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.9.4
Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64 Wine 2.4










Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Artie

  • Jr. Member
  • **
  • Posts: 95
Re: ATSimpleButton
« Reply #3 on: April 13, 2015, 07:03:24 pm »
This looks like building interfaces on old QuickBASIC with User Defined Types (structures).  :)
Lazarus 1.6 - openSUSE Tumbleweed-i586 - Windows 7-x64

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATSimpleButton
« Reply #4 on: April 13, 2015, 08:46:52 pm »
Blaazen
Hm, TPersistent not needed, I have *global var* (record), not a class member.

Blaazen

  • Hero Member
  • *****
  • Posts: 2371
  • POKE 54296,15
    • Eye-Candy Controls
Re: ATSimpleButton
« Reply #5 on: April 13, 2015, 09:04:39 pm »
You are not planning to make some set of your visual components (*.lpk) which should be installed to Lazarus component palette?
Lazarus 1.9 r54603M FPC 3.0.2 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.9.4
Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64 Wine 2.4










Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATSimpleButton
« Reply #6 on: April 13, 2015, 09:16:03 pm »
Added LPK file now. It 's ok in IDE, OnClick can be set

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATSimpleButton
« Reply #7 on: July 31, 2015, 02:43:23 pm »
Button code update.
+ colors "font/bg disabled"
- fix: OnClick must call after Checked change

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATButton
« Reply #8 on: July 21, 2016, 01:35:54 am »
ATButton update:

- prop Flat (set False to make look like toolbar btn)
- prop ImageList
- prop ImageIndex

demo look, flat buttons at rgt - see file.
« Last Edit: July 21, 2016, 01:37:33 am by Alextp »

Handoko

  • Hero Member
  • *****
  • Posts: 1327
  • My goal: build my own game engine using Lazarus
Re: ATButton
« Reply #9 on: July 21, 2016, 09:37:27 am »
+1 like

Downloaded and tested. Nice!

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATButton
« Reply #10 on: July 21, 2016, 04:29:42 pm »
Added ATButtonsToolbar, it can paint | and "v"




Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATButton
« Reply #11 on: January 04, 2017, 04:53:17 am »
Now ATButtonToolbar items have styles

-usual btn
-button with icon
-only arrow down
-text + arrow down
-separator


lainz

  • Hero Member
  • *****
  • Posts: 1889
  • Nace una flor, todos los días sale el sol...
    • BGRABitmap
Re: ATButton
« Reply #12 on: January 04, 2017, 05:43:40 am »
Nice components!

Alextp

  • Sr. Member
  • ****
  • Posts: 413
    • UVViewSoft
Re: ATButton
« Reply #13 on: March 17, 2017, 01:54:57 am »
Update

ATButtonsToolbar has property KindVertical, to paint/align buttons in vertical row
Screenshot of demo:


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus