Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Can You Have One Tool Bar for Multiple Forms?
Message
From
08/04/1998 14:02:48
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00090336
Message ID:
00090529
Views:
23
You could try the following solution:

Make a class of your toolbar and make a instance of it at the start of your application:

m.pToolbar=CREATEOBJECT("Toolbarclass")

Let a timer refresh the toolbar at regular intervals:

m.pToolbar.refresh in the timer event of the timer

Let each object on the toolbar (buttons, comboboxes, chackboxes etc.) decide if it should be enabled of disabled by adding simlular code in the refresh methods of the objects:

THIS.Enabled=TYPE("_Screen.Activeform")="O" AND ;
PEMSTATUS(_Screen.Activeform,"Print",5)

In the click event you could add the following code

IF TYPE("_Screen.Activeform")="O"
_Screen.Activeform.print
ENDIF

In this way you are really making your application OO. Your forms don't have to have knowledge about the existance of a toolbar. It only has to expose some methods or properties which could be use either by a toolbar or a menubar.
Previous
Reply
Map
View

Click here to load this message in the networking platform