General information
Category:
Forms & Form designer
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only