Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Editbox
Message
 
À
10/03/2003 16:14:42
Bill Breay
Custom Business Software
Arvada, Colorado, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Divers
Thread ID:
00763918
Message ID:
00764054
Vues:
21
Hi Bill.

You can try the following -

Override the setaccessreadonly method with -
IF NOT This.lReadOnlyIgnore
  This.lReadOnly = .F.
  This.Enabled = .T.
ENDIF
Override the KeyPress method with -
LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL lnAccess

IF TYPE('goApp.oSecurityMgr') = 'O'
  lnAccess = goApp.oSecurityMgr.GetAccess(This.iControlId)
  IF lnAccess = ACCESS_READONLY AND !INLIST(nKeyCode, 5, 24)  &&Up and Down Arrow
    NODEFAULT
    RETURN
  ENDIF
ENDIF

RETURN DODEFAULT(nKeyCode, nShiftAltCtrl)
Override the GotFocus method with -
IF TYPE('goApp.oMenu.oEditPad') = "O"
  goApp.oMenu.oEditPad.Enabled = .f.
ENDIF

RETURN DODEFAULT()

Override the LostFocus method with -
IF TYPE('goApp.oMenu.oEditPad') = "O"
  goApp.oMenu.oEditPad.Enabled = .t.
ENDIF

RETURN DODEFAULT()

This hasn't been fully tested <g>. It would probably also be best to just subclass the ceditbox control and add a property to it to hold the oEditPad.Enabled status and set it back in the LostFocus instead of hard coding like I did. Also, make sure your form's include file is set to framewrk.h or the ACCESS_READONLY won't be recognized. I think this would be a great enhancement to the framework. (Kevin, you out there?).

Let me know what you think...

Dan

>Is it possible to have security on an editbox set to readonly and still have it scrollable? If so how?
>
>TIA
>
>Bill
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform