Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing toolbars
Message
From
11/07/2003 01:49:47
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
11/07/2003 01:05:55
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00808690
Message ID:
00809110
Views:
36
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform