Hi Everybody,
Is there a way to set all the gets in a dialog to readonly then with a click of a button allow editing?
Thanks.
Jeff
Dialog - Readonly
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
FUNCTION OnOff( oDlg, lOn )
DEFAULT lOn := .t.
FOR nI := 1 TO LEN( oDlg:aControls )
IF oDlg:aControls[ nI ]:ClassName() = "TGET" .or. oDlg:aControls[ nI ]:ClassName() = "TCHECKBOX" // etc
IF lOn
oDlg:aControls[ nI ]:Enable()
ELSE
oDlg:aControls[ nI ]:Disable()
ENDIF
ENDIF
IF oDlg:aControls[ nI ]:ClassName() = "TFOLDER"
FOR nIFold := 1 TO LEN( oDlg:aControls[ nI ]:aDialogs )
FOR nFoldI := 1 TO LEN( oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls )
IF oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:ClassName() = "TGET" .or. ;
oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:ClassName() = "TCHECKBOX" // etc
IF lOn
oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:enable()
ELSE
oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:disable()
ENDIF
ENDIF
NEXT
NEXT
ENDIF
NEXT
RETURN nil
DEFAULT lOn := .t.
FOR nI := 1 TO LEN( oDlg:aControls )
IF oDlg:aControls[ nI ]:ClassName() = "TGET" .or. oDlg:aControls[ nI ]:ClassName() = "TCHECKBOX" // etc
IF lOn
oDlg:aControls[ nI ]:Enable()
ELSE
oDlg:aControls[ nI ]:Disable()
ENDIF
ENDIF
IF oDlg:aControls[ nI ]:ClassName() = "TFOLDER"
FOR nIFold := 1 TO LEN( oDlg:aControls[ nI ]:aDialogs )
FOR nFoldI := 1 TO LEN( oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls )
IF oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:ClassName() = "TGET" .or. ;
oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:ClassName() = "TCHECKBOX" // etc
IF lOn
oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:enable()
ELSE
oDlg:aControls[ nI ]:aDialogs[ nIFold ]:aControls[ nFoldI ]:disable()
ENDIF
ENDIF
NEXT
NEXT
ENDIF
NEXT
RETURN nil
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact: