Rollover Component version 1.1
Since 4th Dimension 6.5, picture buttons can be used as rollover buttons, but creating the pictures needed can be an arduous task. Four frames are needed in each image, and if pictures ever need changing, it can be extremely annoying. If the rollovers contain text as well as or instead of an icon, it can be even more difficult as multiple versions of each picture must be created for each language the application supports. Changing the font of the buttons means recreating all of them.
Using the picture operators in 4D it is possible to create pictures dynamically, and using Jean-Pierre Ribreau's Text2Pict routine, Tony Pollard's (of Another Dimension) incredible PICT manipulation routines and the free TextProperties plug-in from Zanzarita it is possible to create fairly attractive rollover buttons with minimal effort.
This open-source component allows developers to dynamically create rollover buttons for their applications, which are then stored in a RAM cache so that reusing them is fast, but so that they're also garbage collected if they don't get used a lot. Only the icon needs to be provided
The component only contains code. A dialog for experimenting with the module parameters and the sample images are shipped in a separate 4D Insider library and in the demo database.
Documentation
Most of the documentation for this component is currently contained in the component itself in the method comments. Full documentation should be produced at a later stage.
Download
Planet 4D
A complete article about creating rollovers in 4D has been published in issue #1 of the popular magazine for 4D developers, Planet 4D.
|