Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bernard Bout
  Where is Bernard Bout?
 Brisbane
 Australia
 Bernard Bout
 To: M. Tanveer Ul Hassan Shaheen
  Where is M. Tanveer Ul Hassan Shaheen?
 Rahim Yar Khan
 Pakistan
 M. Tanveer Ul Hassan Shaheen
 Tags
Subject: RE: A zoombar class for VFP
Thread ID: 154396 Message ID: 154607 # Views: 5 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Tuesday, December 18, 2007 11:05:44 AM         
   


> Dear Bernard
> Its a very good effort. my rating for u
> please tell me, when i clik specific button how it poerform my command line. I.E do form test etc.
>
> Thanks & Regards
>
> Tanveer Ul hassan

Hi Tanveer.

Thanks for posting.
About your question:

>>when i clik specific button how it poerform my command line. I.E do form test etc.

Open the sample form and double click the zoombar class to open the code window. Open the INIT event and see the code how the buttons are set up.

* 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")
	.addbuttons("Wizard","wizard96.png", "Merlin's apprentice")
ENDWITH
* this must be called
DODEFAULT()



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

What this means is:

.addbuttons("Name of your button - stored in property TAG","Name of the image to use","Tooltip text for this button.")

So the name you specify is stored in the button.tag property.

so to add 3 buttons this is your 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")
ENDWITH
DODEFAULT()  && this MUST be here


Now double click on the zoombar to open the code window. Open the method buttonclicked. This is where all clicks are directed. The parameter passed is the instance of the button. So add code like this in this method:

*bbzoombar.buttonclicked
LPARAMETERS toButton
LOCAL cButton as string
cButton = toButton.Tag

DO CASE
CASE cButton == "FirstButton"
    DO FORM EXPLORED
CASE cButton == "SecondButton"
    DO Form FolderOpen
CASE cButton == "ThirdButton"
    DO FORM Test
ENDCASE



And that is how simple it is. You can also check out my blog post here:

http://weblogs.foxite.com/bernardbout/archive/2007/12/16/5471.aspx

and this post here for more ideas on using it in a toolbar:

https://www.foxite.com/archives/0000154571.htm

Also keep an eye on this post as I will post improvements here.


Bernard

** If you see someone without a smile, give em one of yours :) **

ENTIRE THREAD

A zoombar class for VFP Posted by Bernard Bout @ 12/15/2007 5:05:59 AM
RE: A zoombar class for VFP Posted by Emerson Reed @ 12/15/2007 12:32:03 PM
RE: A zoombar class for VFP Posted by Ken Murphy @ 12/15/2007 1:01:52 PM
RE: A zoombar class for VFP Posted by Bernard Bout @ 12/15/2007 3:10:20 PM
RE: A zoombar class for VFP Posted by Bernard Bout @ 12/17/2007 8:12:11 AM
RE: A zoombar class for VFP Posted by Eric den Doop @ 12/17/2007 9:26:32 AM
RE: A zoombar class for VFP Posted by Bernard Bout @ 12/17/2007 10:52:23 AM
RE: A zoombar class for VFP Posted by Eric den Doop @ 12/17/2007 11:09:21 AM
RE: A zoombar class for VFP Posted by Bernard Bout @ 12/18/2007 2:00:13 AM
RE: A zoombar class for VFP Posted by Rey Magdalaga @ 12/15/2007 5:42:59 PM
RE: A zoombar class for VFP Posted by Nadeem Iqbal @ 12/16/2007 2:57:54 PM
RE: A zoombar class for VFP Posted by M. Tanveer Ul Hassan Shaheen @ 12/18/2007 7:24:34 AM
RE: A zoombar class for VFP Posted by Bernard Bout @ 12/18/2007 11:05:44 AM
RE: A zoombar class for VFP Posted by M. Tanveer Ul Hassan Shaheen @ 12/18/2007 1:56:55 PM
RE: A zoombar class for VFP Posted by Erik Gomez @ 12/18/2007 4:58:30 PM