Recent

Author Topic: SpkToolbar features  (Read 7917 times)

GermanOak

  • Newbie
  • Posts: 5
SpkToolbar features
« on: February 20, 2023, 05:42:32 pm »
Could someone please tell me, if SkpToolbar supports the following:
  • dropdown menus
  • nested flyouts from dropdown menus
  • custom themes on 1 and 2
  • icons (next to captions) on 1 and 2
  • open dropdown on mouse-down, then trigger selected command on mouse-up
  • hover from dropdown to dropdown (once clicked, no need to click again and again)
Thanks in advance. I really appreciate all information and screenshots.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Re: SpkToolbar features
« Reply #1 on: February 20, 2023, 05:53:18 pm »

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: SpkToolbar features
« Reply #2 on: February 20, 2023, 06:47:47 pm »
In the attachment you see a screenshot of one of the demo programs coming with the package. It shows the built-in styles and hopefully answers most of your questions. But let me add:

/3/ Dropdown menus just are the system popup menus, they are not painted by the SpkToolbar - which may lead to an inconsistent GUI.

Just check it out. The package is available on Online-Package-Manager, its installation is just a single-click effort.


GermanOak

  • Newbie
  • Posts: 5
Re: SpkToolbar features
« Reply #3 on: February 21, 2023, 01:16:17 am »
Thanks a ton, you helped me both. I read up on the linked topic, and judging from the screenshots, this is mainly a ribbon interface. But if I understand correctly, the style-tab also offers a radio button that switches to Classical. Which is what I am looking for.

/3/ Dropdown menus just are the system popup menus, they are not painted by the SpkToolbar - which may lead to an inconsistent GUI.
That's a downer. However, in the topic BlueIcaro linked me to, one of the screenshots shows an appearance editor. But I guess that does not apply to the dropdown menus, as wp pointed out.

Just check it out. The package is available on Online-Package-Manager, its installation is just a single-click effort.
I am a total noob. Downloaded Lazarus and also the SpkToolbar package, but never got to the point, where I could see anything else but code, let alone play with the SpkToolbar GUI and try it out.

FYI, a very helpful developer referred me over here to this site, to check out SpkToolbar and decide whether or not it fits my needs. From what I gathered, it does offer classical dropdowns, but only in standard Windows system styles. They cannot be themed and styled by the target application. Is that correct?

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: SpkToolbar features
« Reply #4 on: February 21, 2023, 10:24:19 am »
/3/ Dropdown menus just are the system popup menus, they are not painted by the SpkToolbar - which may lead to an inconsistent GUI.
That's a downer. However, in the topic BlueIcaro linked me to, one of the screenshots shows an appearance editor. But I guess that does not apply to the dropdown menus, as wp pointed out.
Of course not. How could it? It's necessary to write a "TSpkPopupMenu" which links to the TSpkToolbar, gets the style data from it and paints itself accordingly. However, "somebody" has to write it...

Just check it out. The package is available on Online-Package-Manager, its installation is just a single-click effort.
I am a total noob. Downloaded Lazarus and also the SpkToolbar package, but never got to the point, where I could see anything else but code, let alone play with the SpkToolbar GUI and try it out.
I strongly advise that you do the first steps at first and try to understand the Lazarus way of writing an application. There are lots of tutorials and videos about this, but nothing about SpkToolbar.

To install SpkToolbar, open "Package" > "Online Package Manager", check the SpkToolbar entry and click "Install". Confirm the question to rebuild the IDE, and after a while the IDE restarts and has the component in the component palette tab "SpkToolbar"

To use the component go to the new "SpkToolbar" tab, click on the component icon (the only one on this tab) and then on the form. This adds an empty instance of the TSpkToolbar to the top of the form. Double-click on the SpkToolbar to open the TSpkToolbar contents editor. At first click on the left-most button ("Add tab") (and repeat if you need more tabs). Select the tab in the tree view of the contents editor and click the next button after the divider line ("Add pane") (and repeat for further panes). Make sure that the pane is selected, then click on the dropdown button of the first button in the next group. Select the kind of button from the dropdown, e.g. "Small button". Repeat for another button. The two buttons are placed side-by-side. If you want them to be arranged vertically, select the second button in the tree; go to the object inspector (the narrow table at the left of the IDE) and find the property "TableBehaviour" and select "tbBeginsRow".

To change the caption of tab/pane/button select the corresponding object in the tree of the contents editor, go to the object inspector again and enter the text in the "Caption" property.

To add icons you must add imagelists to the form. You need two of them - one for the LargeImages property of the SpkToolbar (use 32x32 images here), and one for the Images property (16x16 images). In the contents editor, select the button to which you want to assign an image, and then, in the object inspector, pick the requested image from the dropdown list of the ImageIndex property.

Etc. - I don't want to give a complete tutorial here. Just play with it and learn by doing.

GermanOak

  • Newbie
  • Posts: 5
Re: SpkToolbar features
« Reply #5 on: February 21, 2023, 05:19:36 pm »
Thanks a million. NOW I am getting somewhere.
I really do appreciate your helpfulness. Very well written, concise instructions that I was able to follow and arrive at a point where I can experiment and test it by myself.

SpkToolbar looks very promising. Will follow your advice and wise up on the necessary basics before bugging you again.

Thank you for taking the time to explain it so well. Exactly the information I needed to get me going.  :)

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: SpkToolbar features
« Reply #6 on: February 21, 2023, 06:32:03 pm »
Wanted to tell you that I began writing a TSpkPopupMenu component which takes the appearance parameters of the SpkToolbar and paints itself accordingly. Still a lot to do, but here is a teaser:

GermanOak

  • Newbie
  • Posts: 5
Re: SpkToolbar features
« Reply #7 on: February 21, 2023, 10:51:08 pm »
Awesome! 8-)
Where can I follow the progress of your efforts? Is there a dedicated project page I can bookmark?

nouzi

  • Sr. Member
  • ****
  • Posts: 329
Re: SpkToolbar features
« Reply #8 on: February 22, 2023, 12:26:04 am »
Is it possible to support RTL (Right to left)
 Thank advanced
My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: SpkToolbar features
« Reply #9 on: February 22, 2023, 12:44:18 am »
Is it possible to support RTL (Right to left)
In principle, yes, but it requires to rework all the painting code. Patches are welcome.

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: SpkToolbar features
« Reply #10 on: February 23, 2023, 10:20:55 am »
Where can I follow the progress of your efforts? Is there a dedicated project page I can bookmark?
As usual, the development code of SpkToolbar is hosted on https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/spktoolbar/, from which you can get the current version by svn or by downloading the zip snapshot.

However, I have reached a point which makes me wonder if this work is worth the effort: the problem is that custom-drawn menus only seem to be supported by Windows, in Linux gtk2/qt and in cocoa, always the native menu is shown. And even on Windows there is no way to suppress the menu border which results in an ugly "Metro Dark" menu if Windows runs in bright mode.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: SpkToolbar features
« Reply #11 on: February 23, 2023, 11:56:36 am »
Looking cool @wp! Since I am on Windows, I do love your appearance integration and would really appreciate that it be included in later OPM releases  :-*
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

dseligo

  • Hero Member
  • *****
  • Posts: 1686
Re: SpkToolbar features
« Reply #12 on: February 23, 2023, 01:01:21 pm »
Looking cool @wp! Since I am on Windows, I do love your appearance integration and would really appreciate that it be included in later OPM releases  :-*

+1

GermanOak

  • Newbie
  • Posts: 5
Re: SpkToolbar features
« Reply #13 on: February 23, 2023, 03:13:50 pm »
Thanks for the link. Bookmarked it.

However, I have reached a point which makes me wonder if this work is worth the effort: the problem is that custom-drawn menus only seem to be supported by Windows, in Linux gtk2/qt and in cocoa, always the native menu is shown. And even on Windows there is no way to suppress the menu border which results in an ugly "Metro Dark" menu if Windows runs in bright mode.
I can only talk from my narrow Windows perspective. And I'd be happy with a few inconsistencies. Overall, it still beats the boring standard Windows look I would have to put up with without your work.

wp

  • Hero Member
  • *****
  • Posts: 13622
Re: SpkToolbar features
« Reply #14 on: February 24, 2023, 10:28:28 pm »
The sample projects in the spktoolbar installation folder apply the TSpkPopupMenu now. And the Appearance Editor has been extended to have access to its style elements.

 

TinyPortal © 2005-2018