I've tried to add a custom function to TFolder():bKeyDown but seem it doesn't work.
The code is the same of Folder.prg in \FWH\Samples with the custom function.
- Code: Select all Expand view
- #include "fivewin.ch"
function Main()
local oDlg, oFld
DEFINE DIALOG oDlg TITLE "FiveWin Dynamic folders" ;
FROM 5, 5 TO 20, 49
@ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
OF oDlg SIZE 160, 90
@ 1, 1 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION MsgInfo( "Hello world!" )
@ 5.5, 11 BUTTON "Ok" OF oDlg ACTION oDlg:End()
oFld:bKeyDown := {|nKey,nFlags|TestKey(oFld,nKey,nFlags)}
ACTIVATE DIALOG oDlg CENTERED
return nil
procedure AppSys // Xbase++ requirement
return
FUNC TestKey(oFld,nKey,nFlags)
IF nKey == VK_TAB .and. GetKeyState( VK_CONTROL )
IF GetKeyState(VK_SHIFT)
IF oFld:nOption == 1
oFld:SetOption( Len(oFld:aDialogs) )
ELSE
oFld:SetOption( oFld:nOption - 1 )
ENDIF
ELSE
IF oFld:nOption == Len(oFld:aDialogs)
oFld:SetOption( 1 )
ELSE
oFld:SetOption( oFld:nOption + 1 )
ENDIF
ENDIF
ENDIF
RETURN nKey