Recent

Author Topic: SpkToolbar custom update  (Read 788 times)

dedisoft

  • Newbie
  • Posts: 3
SpkToolbar custom update
« on: December 10, 2025, 03:30:49 pm »
Hi guys,

I needed to modify spkToolbar by adding a toggle button and a vertical separator to a panel as available items.

I've attached the modification in case anyone is interested.

Regards,

1-berto

  • Newbie
  • Posts: 3
Re: SpkToolbar custom update
« Reply #1 on: December 10, 2025, 03:48:46 pm »
nice

If the case a make a fork for myself of SpkToolbar, i'll apply this. Any new feature is welcome. Thanks for the contrib.

dedisoft

  • Newbie
  • Posts: 3
Re: SpkToolbar custom update
« Reply #2 on: December 10, 2025, 03:53:43 pm »
Hi,

If you want. Just a little correction for the height of the separator here !

Regards

wp

  • Hero Member
  • *****
  • Posts: 13332
Re: SpkToolbar custom update
« Reply #3 on: December 10, 2025, 06:35:40 pm »
Would you allow me to add your divider and toggle button to the "official" SPkToolbar in the CCR repository and later to OPM? Since Delphi has a similar slider named "TToggleSwitch" on its component palette I'd propose to rename the TSpkToggleButton to TSpkToggleSwitch; this would also avoid confusion with the bkToggle ButtonKind of the standard spk buttons.

[EDIT]
I just noticed that the TSpkButton has a separator option in its ButtonKind settings. Therefore, your TSpkSeparator appears to be obsolete.



« Last Edit: December 11, 2025, 12:51:42 am by wp »

dedisoft

  • Newbie
  • Posts: 3
Re: SpkToolbar custom update
« Reply #4 on: December 11, 2025, 09:15:44 am »
Yes, of course, it's kind of you to ask, even if it's unnecessary. I really appreciate your work on SpkToolbar and it's a pleasure to share my improvements with you...

Regarding the separator in TSpkButton, I confess I hadn't seen that option :-\.

After checking, I personally prefer having a separate component; it's simpler to find and maintain, IMHO.

I'll probably need to add other components, and I won't hesitate to share them with you!

wp

  • Hero Member
  • *****
  • Posts: 13332
Re: SpkToolbar custom update
« Reply #5 on: December 11, 2025, 01:48:16 pm »
I added a TSpkSeparator to the ccr version. It is based on TSpkLargeButton specialized such that ButtonKind is bkSeparator (an intermediate TSpkCustomLargeButton class had to be introduced to keep some button-specific properties out of TSpkSeparator).
« Last Edit: December 14, 2025, 11:56:51 pm by wp »

wp

  • Hero Member
  • *****
  • Posts: 13332
Re: SpkToolbar custom update
« Reply #6 on: December 14, 2025, 11:55:55 pm »
Now I also added a TSpkToggleSwitch based on your idea. I changed the color selection so that it better fits into the Appearance template system. When Appearance.Element.KnobAsGradient is true the knob of the switch is drawn in the gradient colors used also for the buttons. For the other case two new colors, TrackColor and KnobColor, were introduced which give a bit more freedom but results only in a flat control.

 

TinyPortal © 2005-2018