FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Dialog - Readonly
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Dialog - Readonly
Posted: Thu Jul 13, 2006 01:12 PM

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

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Dialog - Readonly
Posted: Thu Jul 13, 2006 02:09 PM

Hi Jeff,

you could use a when clause.

... oGet ... WHEN lEdit

Your button could then switch this flag like

... BUTTON ... ACTION ( lEdit := !lEdit, oDlg:AevalWhen() )

May be this could help?

Regards,
Detlef

Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Dialog - Readonly
Posted: Thu Jul 13, 2006 02:30 PM

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

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Dialog - Readonly
Posted: Thu Jul 13, 2006 05:53 PM

Thanks Gale / Detlef,

I came to the same solution as Detlef. Works perfectly.

Thanks again.

Jeff

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion