Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Toolbar in top-level form
Message
From
17/02/1999 02:40:20
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00186512
Message ID:
00188296
Views:
23
Yes, it is solution for me. It work well. I have another question. Property oToolbar contain reference to mytoolbar. If I want use oToolbar in destroy event of SDI form, VFP tell me, that member oToolbar does not exist. When VFP destroy toolbar? Before destroy event of SDI form or after? I search in toolbar properties some like release method in form. But I found nothing. How can I release toolbar which is referenced to SDI form property (if object is referenced to memory variable simly I release this memory variable)?

Maros


>You can do this.

>Add a custom property to your SDI to hold the toolbar object in the scope of the form object. ie. add property oToolBar to the SDI

>Create a custom method in the SDI like sdi.showtoolbar() with the following:

>set classlib to mytoolbarclass additive
>if type('this.oToolBar') # "O"
>this.oToolBar = createobject('mytoolbar',this)
>this.oToolBar.show()
>endif

>Create a toolbar custom class from baseclass 'toolbar' with showwindow as 'In Top Level Form' and save in mytoolbarclass:

>Create a custom property in the mytoolbar class mytoolbar.oFormRef
In the init method of the toolbar class put the following:

>lparameters pcFormRef
>if type('pcFormRef') != "O"
>* Some message
>return .F.
>else
>this.oFormRef = pcFormRef
>endif

>In your menu, include a pad View with a dropdown that calls thisform.showtoolbar()

>GOTCHA: You can't launch the toolbar in thisform.Init() because thisform does not yet exist. Therefore use the menu or a button or some tricky thing like mousemove()... ;)

>The reference passed as a parameter to the toolbar is only for making calls to the form from objects on the toolbar easier. For example, a button.click() on the toolbar cannot reference the SDI simply by saying thisform.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform