Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Can You Have One Tool Bar for Multiple Forms?
Message
De
08/04/1998 14:02:48
Walter Meester
HoogkarspelPays-Bas
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00090336
Message ID:
00090529
Vues:
24
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform