Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refreshing toolbars
Message
De
11/07/2003 01:49:47
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
 
À
11/07/2003 01:05:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00808690
Message ID:
00809110
Vues:
37
Usually, buttons on main toolbar only call methods of active form. I've created a form class with custom methods like AddNewRecord(),EditRecord(), Save(), Revert(), Print(),..., and custom properties.
When a user click on the Add button on main toolbar, in its Click event code I have only _VFP.ActiveForm.AddNewRecord(), if Save button is clicked, in its click event code I have _VFP.ActiveForm.Save(). In Activate event of this form class I have code like this:
WITH oApp.MainToolbarRef
	IF this.Mode = 'view'
		.cmdAddNew.Enabled = .t.
		.cmdEdit.Enabled = .t.
		.cmdDelete.Enabled = .t.
		.cmdSave.Enabled = .f.
		.cmdRevert.Enabled = .f.
	ELSE
		.cmdAddNew.Enabled = .f.
		.cmdEdit.Enabled = .f.
		.cmdDelete.Enabled = .f.
		.cmdSave.Enabled = .t.
		.cmdRevert.Enabled = .t.
	ENDIF
ENDWITH 
The form property Mode is set in AddNewRecord, EditRecord methods to 'add' or 'edit' and set back to 'view' after user choose to save or revert changes.

The Tastrade application is built using something like this.


>And how do you update cut-copy-paste buttons?
>
>Thanks,
>Javier.
>
>>I have a reference to it stored in an application object property. Then, oApp.MainToolbarRef.Refresh is always possible when I need it.
>>
>>Dorin
>>
>>>I just wanted to know what is the recommended way to refresh a toolbar:
>>>- Timer
>>>- Inserting code in thisForm.init() and thisForm.destroy() methods.
>>>
>>>Thanks,
>>>Javier Borrajo.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform