Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Toolbar in top-level form
Message
 
À
15/02/1999 02:32:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00186512
Message ID:
00187950
Vues:
21
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.

HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform