Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to add another toolbar.
Message
From
01/07/2002 10:18:05
 
 
To
01/07/2002 10:01:20
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00673844
Message ID:
00673856
Views:
19
Igor,


Here's the code I used to launch a common toolbar from any form.

* LaunchCommonToolBar.PRG ...

LOCAL llVarNameConflict,llVarOK,llCreateVar


llVarNameConflict = .F.
llVarOK = .F.
llCreateVar = .F.

IF TYPE('goCommon')='O'
IF !ISNULL(goCommon)
IF UPPER(goCommon.Name)=UPPER('tbCommon')
llVarOK = .T.
ELSE
llVarNameConflict = .T.
ENDIF
ELSE
RELEASE goCommon
llCreateVar = .T.
llVarOK = .T.
ENDIF
ELSE
IF TYPE('goCommon')='U'
llCreateVar = .T.
llVarOK = .T.
ELSE
llVarNameConflict = .T.
ENDIF
ENDIF

IF llVarNameConflict
MESSAGEBOX('Could not instantiate the Common Toolbar - Variable Name conflict : "goCommon"',0+16+0,'Contrif')
RETURN .F.
ENDIF

IF llCreateVar
PUBLIC goCommon
goCommon = CREATEOBJECT('tbCommon')
goCommon.Dock(0)
goCommon.Visible = .T.
ENDIF

IF llVarOK
* goCommon.oCurrentForm = loCurrentForm
RETURN .T.
ENDIF




Assign the reference to a form Property ...

THISFORM.lCommonToolbar = LaunchCommonToolbar()


You may "cross reference" from the toolbar ...

goCommon.oCurrentForm = THISFORM

and destroy the XRef when exiting or moving the focus to another form ...

goCommon.oCurrentForm = .NULL.
Kenneth.
Previous
Reply
Map
View

Click here to load this message in the networking platform