Recent

Author Topic: TToggleBox with glyph?  (Read 2306 times)

Eclipticon

  • Jr. Member
  • **
  • Posts: 51
TToggleBox with glyph?
« on: August 22, 2014, 06:43:28 pm »
Hi,

is there a way to assign a glyph/icon to a TToggleBox? Alternatively, what would be the easiest to draw it myself?

It is kind of important to me to stick to the look and feel of the different Windows versions I am developing for ... I don't want these toggle boxes to look much different than buttons, for example.

Thanks!
Lazarus 1.2.4 on Win XP/7 Virtual Machine

Blaazen

  • Hero Member
  • *****
  • Posts: 3239
  • POKE 54296,15
    • Eye-Candy Controls
Re: TToggleBox with glyph?
« Reply #1 on: August 22, 2014, 07:01:56 pm »
TToggleBox does not support it but you can try my EC-Controls. There is TECSpeedBtn which allows it. It is theme-drawn (just like TSpeedBtn) and you can have different image for pushed and non-pushed state.

You only need to set Delay to -1 (0 is normal button; -1 toggle box; >0 is delay button).
Then you can select from simple built-in glyphs (GlyphDesign and GlyphDesignChecked) or assign Images (TImageList) and set ImageIndex and ImageIndexChecked.

BTW I'm working on new version where multi-line Caption will be allowed. It will be in the next release.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

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

Eclipticon

  • Jr. Member
  • **
  • Posts: 51
Re: TToggleBox with glyph?
« Reply #2 on: August 22, 2014, 09:32:20 pm »
Hi Blazen,

thanks for your suggestions.

Besides license issues (I am planning to use these controls in proprietary, statically linked) software, I have problems compiling: It could not override .GetSpace and .GetSpaceAround, because they are not declared as virtual in Controls.

Best, Eclipticon.
Lazarus 1.2.4 on Win XP/7 Virtual Machine

Blaazen

  • Hero Member
  • *****
  • Posts: 3239
  • POKE 54296,15
    • Eye-Candy Controls
Re: TToggleBox with glyph?
« Reply #3 on: August 22, 2014, 09:48:55 pm »
Quote
Besides license issues ...
LGPL is not enough? After all, licence can be changed.

Quote
I have problems compiling: It could not override ...
It's very easy to fix. It's described in attached README.txt. It is already done in Lazarus trunk, I guess you have some older version.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

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

Eclipticon

  • Jr. Member
  • **
  • Posts: 51
Re: TToggleBox with glyph?
« Reply #4 on: August 22, 2014, 09:51:34 pm »
I would like to add - BEAUTIFUL controls, I particularly like the ECSwitch!
Lazarus 1.2.4 on Win XP/7 Virtual Machine

Blaazen

  • Hero Member
  • *****
  • Posts: 3239
  • POKE 54296,15
    • Eye-Candy Controls
Re: TToggleBox with glyph?
« Reply #5 on: August 22, 2014, 10:04:53 pm »
Quote
I particularly like the ECSwitch!
I saw similar component in Gnome3 (Gnome Shell) so I implemented it for Lazarus too.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

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

 

TinyPortal © 2005-2018