Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scroll bars and formsets
Message
From
04/12/2006 17:35:37
 
 
To
04/12/2006 13:54:53
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01174483
Message ID:
01174786
Views:
13
Thank you Tore and Fred! I've been sweating over this little turkey for a couple of days. I'm sure it was very simple for you, but this is my first hardcore use of classes and it was driving me nuts.

Here is the code I chose to use. Rest assured I shall store it away and not bother anyone again with this request.
_SCREEN.AddProperty("oToolBar")
_SCREEN.oToolBar = NEWOBJECT('mytoolbar','mylib.vcx')
As you can see I changed the name of the toolbar.

I still have one more tiny problem. The code under my toolbar's command button needs to refer back to objects on the form on which the toolbar is being used. Here is the button code at this point.
LOCAL ShapeID
ShapeID = ""
SELECT localcrime1
Scan For Alltrim(crimetype) <> "Vandalism"
	ShapeID = localcrime1.shapename
	Thisform.Grove.RemoveObject(ShapeID)
ENDSCAN
this.mytoolbar.hide()
>/PRE>
The name of the form is 'Grove'. There needs to be a referrence to the form so that the code can act on the form's image and remove the unwanted objects, but I haven't had success yet. I can get the code to remove the objects if I run it within the forms methods, but as soon as I run it from the toolbar it won't even recognize the shape's names. How is this done?
Grady
---------------------------------------
>>>Okay - I don't know how to do this and I've beaten on my code and VFP help long enough. Please show me how?
>>>
>>>
>>>>oToolbar needs to be a property of _SCREEN, not a form.
>>>>
>>>>>I added the code below to the mouse middleclick method of the form's image/pic. Here is the code I used:
>>>>><PRE>
>>>>>LOCAL oToolBar
>>>>>oToolBar = NewObject('showonly','mylib.vcx')
>>>>>oToolBar.Show( )
>>>>>
>>>>>When I middle click on the form's image(its a map), I can see the class flash and then disappear on the map image. How do I get it to show and stay on the image?
>>>>>
>>>>>+++ Grady
>>
>>Try this:
>>
>>
_SCREEN.AddProperty("oToolBar")
>>_SCREEN.oToolBar = NEWOBJECT('showonly','mylib.vcx')
>
>Or even simpler
>_screen.AddObject('oToolbar','mylib.vcx')
I ain't skeert of nuttin eh?
Yikes! What was that?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform