New version of SpkToolbar lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- wp · 2012-06-02 21:43 In the attachment I am posting an extended and corrected version of SpkToolbar (v0.2). These are the changes: * Added TSpkCheckbox and TSpkRadiobutton (unit spkt_Checkboxes.pas). I was missing some checkable buttons in the old version. * Applied ImageIndex when assigning an action * Added a property editor for image index   - use specialized ImageIndexPropertyEditor to link to the imagelist   - assign default values to ImageIndex properties   - use types TImageIndex instead of integer * Make sure that item properties (caption, imageindex etc) are updated when the action changes * Fixed button state to change immediately after mouse-up from pressed to hover, the old version needed a mouse move to change button color * Found bug in ComponentEditor form causing "Class not found" error: tabs, panes, and items were added without names. Assigning a name by FDesigner.UniqueName fixed the issue. * Duplicate components after Cut & Paste because missing destruction of components after deletion from internal list * Naming issue of components added by designer (counter starting at 2, not 1) fixed * Changed default color of the SpkToolbar to clSkyBlue * Added component icon to the package * Changed {$mode delphi} to {$mode objfpc} There are also two more demos: the first one shows how the toolbar can be used at runtime only (without installation), the second one demonstrates the usage of actions. Note that there are still two bugs in design mode: * Add a SpkToolbar, double-click and add tabs, panes and buttons. Compile and run. Lazaraus will complain about missing units that implement the added controls. Either add these units (spkt_Tab, spkt_Pane, spkt_Buttons, spkt_Checkboxes) manually to the uses clause. Simpler: just add any other component to the form, and delete it again, then the missing units are added automatically to the uses clause * Delete the SpkToolbar (having tabs, panes, buttons) from the form. The toolbar disappears, but the added controls, however, are left in the form declaration. So far, I could not find how to delete these controls in design mode without crashing Lararus. It would be nice if somebody with write permission could add these updated units to the CCR. Also, it would be find if someone who speaks polish would translate the polish comments. ---------------------------------------------------------------------- LuizAmérico · 2012-06-02 23:22 Create a patch and post here http://wiki.freepascal.org/Creating_A_Patch ---------------------------------------------------------------------- wp · 2012-06-02 23:37 Here it is ---------------------------------------------------------------------- LuizAmérico · 2012-06-03 01:34 Thanks. The patch needs some cleanups before being applied since it does a lot of thing in one go. Also is giving an error while applying it. 1) The change to mode objfpc does not bring any code benefit, it just creates pollution, it also will make harder to merge changes from original delphi (if any). Please revert with related changes 2) there are some code formatting, this makes harder to review the actual changes. You can send a patch later with only formatting 3) The component icon should go in register unit, this will make the end user executable smaller. See other components source code in Lazarus svn 4) Please send a patch with the demo project separated 5) Avoid double type check like +if AItem is TSpkComponent then +   (AItem as TSpkComponent).FCollection := self; you can do +if AItem is TSpkComponent then +   TSpkComponent(AItem).FCollection := self; ---------------------------------------------------------------------- wp · 2012-06-03 16:25 Ok, here are two patches modified according to your suggestions, one for the component source, the other one for the demos. ---------------------------------------------------------------------- LuizAmérico · 2012-06-04 01:08 Thanks. Applied with minor changes. But there are some problems: - The new components and new icon are not registered in the ide they should go in RegisterSpkToolbar.pas. The files should be added also to the package. - The basic demo was not updated. Please update the svn and create a new patch ---------------------------------------------------------------------- Sternas Stefanos · 2012-06-04 07:38 Try this procedure Register; begin   RegisterComponents('SpkToolbar', [TSpkToolbar]);   //.....   RegisterClasses([TSpkLargeButton, TSpkSmallButton]);   RegisterNoIcon([TSpkLargeButton, TSpkSmallButton]);   RegisterClasses([TSpkPane]);   RegisterNoIcon([TSpkPane]);   RegisterClasses([TSpkTab]);   RegisterNoIcon([TSpkTab]);   //.....   RegisterComponentEditor(TSpkToolbar, TSpkToolbarEditor);   RegisterPropertyEditor(TypeInfo(TSpkToolbarAppearance), TSpkToolbar,                          'Appearance', TSpkToolbarAppearanceEditor);   //todo: register Caption Editor end; ---------------------------------------------------------------------- wp · 2012-06-04 20:59 Here everything is fine, but when I update from the svn the component goes crazy. It looks as if my patch does not update all the necessary files in the repository. It is strange, but the files missing have a mime-type "plain/text", instead of the usual "text/plain". All other files that I checked in my local repository have "text/plain", as well. Could it be that my TortoiseSVN refuses to consider different mime types for patching or updating? I changed their mime-type to text/plain, but I don't know if that helps. Anyway, I'll give it another try. Find in the attachment two zip files: the first one contains the component and demo patches, the other one the full source of TSpkComponent - in case something would go wrong with the patches again. BTW: Since nobody could have used the faulty component so far I took the freedom to change the declaration of the OnTabChanging event (adding an "Allow" parameter) because I need a way to inhibit changing tabs in certain cases. ---------------------------------------------------------------------- LuizAmérico · 2012-06-05 03:00 Thanks. I'll look tomorrow night. ---------------------------------------------------------------------- LuizAmérico · 2012-06-06 01:29 Applied with some modifications ---------------------------------------------------------------------- wp · 2012-06-06 06:51 Tested the version from svn, it is running fine now. Thank you. ---------------------------------------------------------------------- JD · 2012-06-09 09:46 Quote from: wp on June 06, 2012, 08:51:04 amTested the version from svn, it is running fine now. Thank you. Just tried the svn version & I'm sorry but it's not running fine at all! One still has to manually add the necessary pascal files to a project's unit clause before the project can be compiled. I attach a demo project for your review. Keep up the good work. JD ---------------------------------------------------------------------- wp · 2012-06-09 11:06 Maybe the expression "running fine" was too positive, I was referring to the issues with adding to svn. The issues mentioned in the first posting still exist. As a workaround, just add a second SpkToolbar to the form (or any other component) and delete it again. You will have the missing units in the uses clause afterwards. ---------------------------------------------------------------------- JD · 2012-06-09 12:36 Quote from: wp on June 09, 2012, 01:06:09 pmAs a workaround, just add a second SpkToolbar to the form (or any other component) and delete it again. You will have the missing units in the uses clause afterwards. You're right. Adding a second SpkToolbar to the form and then deleting it effectively adds the missing unit clauses. Funny! ---------------------------------------------------------------------- LuizAmérico · 2012-06-09 16:39 I fixed the problem of the unit clause in svn, the missing references i could not fix ---------------------------------------------------------------------- wp · 2012-06-09 17:25 Lazarus crashes now when I create a new project, add a SpkToolbar, doubleclick on it a and add a new Tab. Run-time creation is fine, so the bug must be in the ComponentEditor. (I hate debugging designtime code...) ---------------------------------------------------------------------- LuizAmérico · 2012-06-10 00:48 Fixed ---------------------------------------------------------------------- wp · 2012-06-10 08:04 Thank you. ---------------------------------------------------------------------- BlueIcaro · 2012-06-10 08:43 Hi, Where can I download the Last version of this component? Thanks /BlueIcaro ---------------------------------------------------------------------- wp · 2012-06-10 09:18 http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus- ccr/components/spktoolbar/ ---------------------------------------------------------------------- BlueIcaro · 2012-06-10 12:46 Thanks!! ---------------------------------------------------------------------- BlueIcaro · 2012-06-10 14:01 Is there any way to download it using svn? /BlueIcaro ---------------------------------------------------------------------- wp · 2012-06-10 14:37 You find the checkout commands for svn and some other version control systems at http://sourceforge.net/projects/lazarus-ccr/develop. Note that they checkout the entire repository. If you want SpkToolbar only, use the svn command Code: [Select]svn co https://lazarus- ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/spktoolbar spktoolbar If you are on Windows and use TortoiseSVN create a folder, right-click on it, select svn checkout and enter https://lazarus- ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/spktoolbar in the line for URL of the repository. This will copy the sources of SpkToolbar into the created directory. If you don't have svn download the GNU tarball from the URL in the previous posting and unpack the archive. ---------------------------------------------------------------------- JD · 2012-06-10 16:41 Quote from: BlueIcaro on June 10, 2012, 04:01:46 pmIs there any way to download it using svn? /BlueIcaro Try using Rapid SVN http://rapidsvn.tigris.org/ ---------------------------------------------------------------------- spook · 2013-05-03 06:58 I may translate the comments. Please send me all the sources you want to be translated to wojciechsura at gmail dot com and I'll send you these files with apropriate translations. ---------------------------------------------------------------------- wp · 2013-05-03 18:41 If you're referring to my first posting in this thread, I was thinking of every source file belonging to the spktToolbar package. The "official" ones are in Lazarus-ccr. ---------------------------------------------------------------------- resakator · 2015-01-19 21:47 Hello, I'm testing the SpkToolBar component in a project under linux, and is not allowed to mix large icons and small icons. Specifically LinuxMint 17.1 32bit . I do not know if it will be easy to fix this problem. I try this: - New project, add SpkToolbar, add a tab and some buttons (large and small), add two imagelist, one 32x32px and the other 16x16, add some icons to both imagelist. Assign icons to buttons. Under Windows there is no problem, under linux, only LargeImages can be assigned from object inspector. Lazarus 1.2.6 from official site, SpkToolbar svn version from lazarus- ccr sourceforge. Thanks. ---------------------------------------------------------------------- wp · 2015-03-21 23:24 Sorry, I did not see your posting - it's a shame to keep you waiting for two months to get an answer... I just opened the project in the demos/actions folder of the spktoolbar installation (Mint 17.1, 32 bit, in a VirtualBox). It has 32x32 and 16x16 icons mixed, and they show up correctly, both in qt and gtk2 widgetsets. And I also followed your instructions and did not experience any issue. Did you notice in the SpkToolbar designer that there are separate options for "large" and "small" buttons? You can only assign the corresponding image size to each button type. ---------------------------------------------------------------------- Hansvb · 2015-03-22 10:57 Is, spktool still in development? It works great but does not have all the buttons delphi has in its ribbon. ---------------------------------------------------------------------- wp · 2015-03-22 11:15 It is one of many projects in ccr where the original author has disappeared. I took responsibility of the component, but it is not my highest priority. I know that some control types are missing. At the top of this thread I had added radiobuttons and checkboxes three (!) years ago now. What I am still missing sometimes are grouped buttons, like for font style selection in the Office applications. Is there anything particular that you are missing? ---------------------------------------------------------------------- Hansvb · 2015-03-28 22:27 I miss the main menu like behaviour such as office has. Or in delphi xe there is a round buton which triggers a main menu. ---------------------------------------------------------------------- surfvite · 2015-04-06 13:00 Hello, I have updated the spktoolbar component (Ribbon) I fixed some bugs and I enhanced with new functions. I shall desire to benefit the community and evolve this project http://sourceforge.net/p/lazarus- ccr/svn/HEAD/tree/components/spktoolbar/SpkToolbar/ Is this the last component version? I am registered at sourceforge, but I do not know how Best Regards ---------------------------------------------------------------------- wp · 2015-04-06 13:28 Please create a patch and attach it to a bug report in the bug tracker. I'll check it and add your changes to the sourceforge version. ---------------------------------------------------------------------- wp · 2015-04-20 14:32 If you are not familiar with creating patches you can also pack all modified files into a zip an upload them here. ---------------------------------------------------------------------- Groffy · 2015-04-26 18:13 Hello, today I discovered this toolbar component and I really like it even it has not the full functionality of the windows Ribbon. Waiting for the latest fixes. Best regards - Ulrich