Welcome to Foxite.COM Community Weblog Sign in | Join | Help

Bernard Bout

May the Fox be with you...




Zoombar with Reflections

Adding reflections to the bbZoombar class.

Over the holidays, I have done some additional enhancements to the bbZoombar class. Wouldn’t it be nice to have the icons reflected on the bar, with the reflections moving and zooming as well? Well this class now has them.

 

Also the class has been revamped to allow for more than 9 buttons. Now you can have up to 99 but that would be overkill.

I have also added a builder to the class. To use the new class, just drop it on a form, resize the container and arrange the grey bar centrally with the proper height and top. (see note below)

 

Next add code to the init as before:

 

* sample calling code

WITH This as zoomcontainer

      .addbuttons("FirstButton","explorer96.png","This is the first button")

      .addbuttons("SecondButton","folder96.png", "Click here for a file")

      .addbuttons("ThirdButton","monitor96.png", "Monitor events")

      .addbuttons("FourthButton","music96.png","Play your music")

      .addbuttons("FifthButton","photo96.png","View your photos")

      .addbuttons("SearchButton","search96.png","Search for anything")

ENDWITH

* this must be called

DODEFAULT()

 

The above code will give me 6 buttons. The parameters are as before:

 

P1 = Name of the button stored in the TAG property for identifying the button

P2 = The name of the icon to use. PNG’s are best since they resize properly and can also have a transparent background

P3 = This is the tooltip text for the button. You will have to switch ShowTips on in your form.

 

As you can see I have added more properties for more control. These properties can be set individually or using the new _memberdata builder included in the class.

 

The new properties to be set are:

 

ShowReflections – Reflections on or off

CenterZoom – Zoom centrally or zoom upwards

ReflectionEXT – the extension for the reflections

ButtonSize – The initial size of the buttons.

 

This last was added since PNG images look good with the main icons but flicker when used in the reflections. For reflections, GIF is the best format and the one I use. BMP’s do not look good when shrunk.

 

All the above properties have been brought together in a builder using the property name:

 

A_Builderx

The builder is stored in the class as a form – propertywizard.

 

If you highlight this property in your Favourites, and click on the button to the right of the property, the builder will open where you can make all the above settings. All properties have tooltips and are self explanatory.

Once you have applied the settings in the builder, just run the form and enjoy the effect.

  

To trap clicks, just add code in the ButtonClicked method of the class. The whole button object is passed, so you can actually use any property. However the name passed as the first parameter above is stored in the TAG so you could have code here like this:

 

LPARAMETERS toButton

LOCAL cTag as String

cTag = toButton.Tag

DO CASE

CASE cTag = "FirstButton"

      * do something

     

CASE cTag = "SecondButton"

      * do something

     

CASE cTag = "ThirdButton"

      * do something

 

* etc

ENDCASE

 

Included in the zip is a form – inatoolbar.scx where the class has been added to a toolbar class, that behaves just like any other toolbar.

 

Note: The initial TOP of the buttons will depend on the position of the grey bar. The initial TOP will be set so that about 1/2 of the button protrudes above the grey bar. So you will also need to resize and reposition the grey bar so that the buttons appear properly.

As always I welcome your comments and suggestions.

You can download the complete source and this document from the link below:

http://www.foxite.com/downloads/default.aspx?id=178

Hope you all have a great New Year 2008.

Published Monday, December 31, 2007 2:35 PM by bbout

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Zoombar with Reflections @ Tuesday, January 01, 2008 11:09 PM


Thank you. Happy new year!

RsALs

# re: Zoombar with Reflections @ Thursday, January 03, 2008 9:36 PM

Excelent!!
Wow!!!

Can Send me the Example?

mhenao@gmail.com


Regards.

Download from the link on the page

Mauricio Henao

# re: Zoombar with Reflections @ Thursday, January 03, 2008 10:00 PM

WOOOOOOW... i just can say!!! woooow!!!... that is amazing... thanks so much for share this class!!!... DEMASIADO LINDO LUEGO!!!! iiiipuuuuuuuuuuuuu!!! bye... chau

Guille (Asuncion)

# re: Zoombar with Reflections @ Friday, January 04, 2008 11:23 AM

I think this must be magic... :-)
Thank you and a great 2008 to you too!

Chris-Jan

# re: Zoombar with Reflections @ Saturday, February 02, 2008 9:01 AM

You are Hero!

Thanks :)

John Reviews

What do you think?

(required) 
required 
(required) 
Powered by Community Server, by Telligent Systems