Hack! - The toolbar Help! ------------------------------------------------------------------------------- [ This is NOT valid on the current HEAD ooo-build. I had based this on the 1.1.3 build and then moved to HEAD and the menu and toolbar settings have been changed on HEAD and I am yet to figure them out. Till then, this is just a placeholder/feeler for directions on where to look for :-) Mathias Bauer helps with: In OOo2.0 all toolbar related things are provided by xml based configuration files. You can read everything (and more) in http://specs.openoffice.org/ui_in_general/api/ProgrammaticControlOfMenuAndToolbarItems.sxw Especially chapter 6.7 of the specification should be of interest for you. ] The toolbars and menus across the different projects are stored in the resource files and have headers and sources. So I guess that's how the names of the hrc [header resource] and src [source resource] files originated. The toolbars are held in the source resources with the keywords ToolBox and ToolBoxItem for the individual items. Now what would be interesting is if we could add in a toolbar item of our own and since the About Dialog is an easy target, we'll do just that :-) We'll try to add in a toolbar item to launch the About Dialog. We would like this button to exist across all the applications and not just one particular application - so we have to check out the common top-level projects to see which one has the common toolbar that we're interested in hacking! sfx2/source/appl/app.src has the toolbar we're interested in: the common toolbar that is shared across all the applications and we'll try to add in our cute little icon for the About Dialog on that toolbar. In fact, we're taking the shortcut to demo this because the icon/strings/resources for the About Dialog are already available and extra work is not needed to add in this icon apart from the patch below: --- sfx2/source/appl/app.src 2004-12-16 17:28:29.000000000 +0530 +++ sfx2/source/appl/app.src 2004-12-21 13:14:18.943812188 +0530 @@ -4928,6 +4928,10 @@ ToolBox RID_ENVTOOLBOX Identifier = SID_CLOSEDOC; Hide = TRUE; }; + ToolBoxItem + { + Identifier = SID_ABOUT; + }; }; }; Now rebuild svx, and launch - The about Dialog icon should be available and ready to go! :-) The SID can be changed to point to some of the other existing SIDs and then the ToolBox has options to hide the button by default, so you can try out the other options and see what happens. Two tips: While playing around with the customise toolbar, if you make changes and cannot see them reflected, try the Reset option in the menu that pops up on right-clicking the toolbar. Also, when the resources are being modified, they are rebuilt in all the languages known to man [:-D] so poking into the LinuxIntelEnvSet.sh and commenting out the languages you do not need except the en-US helps to get the build/hacking run faster. ------------------------------------------------------------------------------- add-about-toolbar.diff Next: about