Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close button on the Toolbar for read-only forms
Message
 
 
À
16/06/2005 14:23:07
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01023959
Message ID:
01024082
Vues:
21
Here is the code from form's Activate which disables toolbar for modal form:
*--------------------------------------------
*-- Disable all toolbars if the form is modal
*-- and not in Language Translation mode
*--------------------------------------------
IF This.WindowType = WIN_MODAL AND TYPE("goApp.oToolbars") == "O"
	IF NOT (TYPE('goApp.oLanguageMgr') == 'O' AND ;
	 goApp.oLanguageMgr.IsTranslationSetupMode())
		goApp.oToolbars.SetEnabled(.F.)
		_SCREEN.Closable = .F.
	ENDIF
ENDIF
So, for modal forms how can I have cmdClose enabled?

>>You can make an experiment, if you have some time. If you have your toolbar with New/Save/Cancel/Close buttons and you make form's property lReadOnly to true, what would you see for toolbar? Our toolbar is disabled completely. But puting this simple logic in Refresh of cmdClose button I achieved the desired functionality. Perhaps there is a more elegant solution... As I said, I tried to just set lIgnore property for this button to true, but it didn't help.
>
>Yes it all works for me just fine. The New, Save, Cancel buttons are disabled. While the Close button is enabled.
>Sorry for the misunderstanding, but the code to immediately look at is in the ccommandbutton in Ccontrls. The closebutton in the toolbar is based on this class. So in the init() of ccommandbutton, add a step and watch to see what it is saying.
> This.Enabled = ;
> !(ThisForm.lReadOnly AND !This.lReadOnlyIgnore)
>Well actually you should put
>SET STEP ON
>RETURN DODEFAULT()
>in the init() of your close button on the toolbar that you are using..
>From what I understand by default the SetEnabled method always passes a .F.
>Other than that I would not know what to do from here..
>
>Daniel
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform