Page 1 of 1

Folder

PostPosted: Mon Dec 05, 2005 2:26 pm
by MarcoBoschi
In this little sample is impossible to navigate in all objects of dialog using keyboard. Only with mouse is possible to change folder.

#include "fivewin.ch"

function Main()

LOCAL oDlg, oFld
LOCAL aTit := {"Anagrafica" , "Laboratorio", "Fatture" }
LOCAL aDlg := { NIL , NIL , NIL }
LOCAL aEna := { .T. , .T. , .T. }
LOCAL rb := 252
LOCAL cb := 2
LOCAL lb := 60
LOCAL ib := 1
LOCAL oBut
LOCAL oGroup
LOCAL nOption


DEFINE DIALOG oDlg TITLE "Fogli di lavoro" FROM 1, 1 TO 300, 400 PIXEL

@ 120 , 0 GROUP oGroup TO 140 , 199 of Odlg PIXEL
// oFld := tFolder():New(20,1, aTit, aDlg , oDlg , 1, , , .T., .F., 199, 100, "Folder", .F.)
@ 20 , 1 FOLDER ofld OF oDlg PROMPTS aTit[1], aTit[2], aTit[3] DIALOGS aDlg[1], aDlg[2], aDlg[3] SIZE 199, 100 PIXEL MESSAGE "CIAO"
oFld:aEnable := aEna
oFld:nOption := 1

@ 1, 1 BUTTON "Anagrafica" OF oFld:aDialogs[ 1 ] ACTION MsgInfo( oFld:nOption )
@ 2, 1 BUTTON "Laboratorio" OF oFld:aDialogs[ 2 ] ACTION MsgInfo( oFld:nOption )
@ 3, 1 BUTTON "Fatturazione" OF oFld:aDialogs[ 3 ] ACTION ( MsgInfo( oFld:nOption ), aEna := { .T. , .F. , .T. }, oFld:aEnable := aEna )
ACTIVATE DIALOG oDlg CENTERED ON INIT CreaBut(rb, cb, ib, lb, obut, odlg)

return nil

FUNCTION creabut(rb, cb, ib, lb, obut, odlg)
@ rb , cb + 1*(lb+2) - lb BUTTON oBut PROMPT "Prova1" OF oDlg SIZE lb , 24 PIXEL
@ rb , cb + 2*(lb+2) - lb BUTTON oBut PROMPT "Prova2" OF oDlg SIZE lb , 24 PIXEL
@ rb , cb + 3*(lb+2) - lb BUTTON oBut PROMPT "Prova3" OF oDlg SIZE lb , 24 PIXEL
@ rb , cb + 4*(lb+2) - lb BUTTON oBut PROMPT "Prova4" OF oDlg SIZE lb , 24 PIXEL
RETURN NIL

PostPosted: Mon Dec 05, 2005 5:38 pm
by Antonio Linares
Marco,

FWH does not gives the focus to the folder itself, thus you can not change to a next folder page using the keyboard. Is that what you mean ?

PostPosted: Mon Dec 05, 2005 5:49 pm
by MarcoBoschi
Yes
this is my problem
Thanks

PostPosted: Mon Dec 05, 2005 8:45 pm
by Antonio Linares
Marco,

You may modify Class TFolder, so when it gets focus, it is not given to a contained control. We have not tested it ourselves, but it may work.

PostPosted: Tue Dec 06, 2005 11:18 am
by MarcoBoschi
Is your intention to sort out this class?

PostPosted: Tue Dec 06, 2005 1:01 pm
by Antonio Linares
Marco,

The problem is that if we modify this class then it may affect many users applications because if we give the focus to the folder, then the VALID of a control may be executed. Thats why it seems a better way if you modify it on your local copy.

Anyhow we may do some tests and see what we get. Its source code is available at source\classes\folder.prg

We appreciate your feedback.