SpkToolbar features lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- GermanOak · 2023-02-20 16:42 Could someone please tell me, if SkpToolbar supports the following: dropdown menusnested flyouts from dropdown menuscustom themes on 1 and 2icons (next to captions) on 1 and 2open dropdown on mouse-down, then trigger selected command on mouse-uphover from dropdown to dropdown (once clicked, no need to click again and again)Thanks in advance. I really appreciate all information and screenshots. ---------------------------------------------------------------------- BlueIcaro · 2023-02-20 16:53 This may can help you: https://forum.lazarus.freepascal.org/index.php/topic,51552.0.html? /BlueIcaro ---------------------------------------------------------------------- wp · 2023-02-20 17:47 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 · 2023-02-21 00:16 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. Quote from: wp on February 20, 2023, 06:47:47 pm/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. Quote from: wp on February 20, 2023, 06:47:47 pmJust 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 · 2023-02-21 09:24 Quote from: GermanOak on February 21, 2023, 01:16:17 amQuote from: wp on February 20, 2023, 06:47:47 pm/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... Quote from: GermanOak on February 21, 2023, 01:16:17 amQuote from: wp on February 20, 2023, 06:47:47 pmJust 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 · 2023-02-21 16:19 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 · 2023-02-21 17:32 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 · 2023-02-21 21:51 Awesome! Where can I follow the progress of your efforts? Is there a dedicated project page I can bookmark? ---------------------------------------------------------------------- nouzi · 2023-02-21 23:26 Is it possible to support RTL (Right to left)  Thank advanced ---------------------------------------------------------------------- wp · 2023-02-21 23:44 Quote from: nouzi on February 22, 2023, 12:26:04 amIs it possible to support RTL (Right to left) In principle, yes, but it requires to rework all the painting code. Patches are welcome. ---------------------------------------------------------------------- wp · 2023-02-23 09:20 Quote from: GermanOak on February 21, 2023, 10:51:08 pmWhere 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 · 2023-02-23 10:56 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 ---------------------------------------------------------------------- dseligo · 2023-02-23 12:01 Quote from: KodeZwerg on February 23, 2023, 11:56:36 amLooking 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 · 2023-02-23 14:13 Thanks for the link. Bookmarked it. Quote from: wp on February 23, 2023, 10:20:55 amHowever, 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 · 2023-02-24 21:28 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. ---------------------------------------------------------------------- chrv · 2023-02-25 20:37 Hello wp Functionally, it works fine for me. Visually, I can't remove the MenuItem border (attachment). It has something to do with TSpkToolbox.Style:=spkMetroDark (attached demo) (Lazarus 2.0.12 FP 3.2.0 Windows 10) ---------------------------------------------------------------------- wp · 2023-02-25 20:55 I know - that's why I wrote in reply #10 that I know if this activity is worth the effort. TSpkPopupMenu is just an ordinary TPopupMenu which draws its items by itself. But custom-painting is very limited, it is not possible to paint the border (well - at least I don't know one), and even custom-painting of the items works only on Windows. ---------------------------------------------------------------------- chrv · 2023-02-25 21:57 What other issue can we expect with this solution (apart from the one we already observed) ? ---------------------------------------------------------------------- wp · 2023-02-25 22:07 The code is working correctly in Windows for me. But the component is fairly new, and no software is without bugs, in particular when it is only a few days old. ---------------------------------------------------------------------- chrv · 2023-02-25 22:14 Time will tell us ... ---------------------------------------------------------------------- @nton · 2023-03-11 21:51 Thanks for this awesome component! I'm impressed by the example screenshots. I wondered which icons you use. Are they standard with Lazarus, or can I get/buy/find them somewhere else? ---------------------------------------------------------------------- wp · 2023-03-11 22:34 Usually the icons are from the FatCow collection (https://www.fatcow.com/free-icons) or from the  icon8.com/Office collection (https://icons8.com/icons/officel). All of them are free with attribution. But note that now there is also a growing collection of general- purpose icons available in the Lazarus/main installation: https://forum.lazarus.freepascal.org/index.php/topic,59266.0.html, free without restrictions (drawn by Roland Hahn, https://www.rhsoft.de/). ---------------------------------------------------------------------- @nton · 2023-03-12 19:12 Thanks!