Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Toolbar in top-level form
Message
 
À
17/02/1999 02:40:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00186512
Message ID:
00189731
Vues:
12
In the destroy event you can check to see if the toolbar object still exists using the debugger. I haven't checked but I think release happens before destroy in which case an object reference in a property may already be released.

>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform