hi Antonio,
Antonio Linares wrote:oFolder:nDlgCode = DLGC_WANTALLKEYS
no luck ... still can´t use TAB-Key to change Control
i have reduce CLASS to only 1 Method to set Bitmap (depend on Drive Type)
Code: Select all | Expand
METHOD SetDriveIcon(cPath,nOption) CLASS TFolderDXE
LOCAL aDrives, cDrive, nPosi, cIcon
LOCAL acItem, acBitmaps
DEFAULT nOption := 1
IF !EMPTY(cPath)
cDrive := UPPER(SUBSTR(cPath,1,1))
aDrives := FillDriveArray()
acItem := aDrives[ 1 ]
acBitmaps := aDrives[ 2 ]
nPosi := ASCAN(acItem,{ | x | SUBSTR(x,1,1) = cDrive })
IF nPosi > 0
cIcon := acBitmaps[nPosi]
::SetBitmap( cIcon, nOption )
::Update()
ENDIF
ENDIF
RETURN nil
but as soon i use this CLASS i can "TAB-in" but not "TAB-out"
i will try to make a small Sample
---
ok here Demo Sample for "no TAB-Key"
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
local oDlg, oFld, oGet, cTest := "Hello world", cAnother := "Another GET"
LOCAL nWidth := 190
LOCAL nHeight := 120
LOCAL nTop := 0
LOCAL nLeft := 0
LOCAL lPixel := .T.
LOCAL lDesign := .F.
// TFolderEx
LOCAL aPrompts := {"&One", "&Two", "&Three"}
LOCAL aBitmaps := {}
// DEFAULT
LOCAL nFolderHeight := 25
LOCAL aHelps
LOCAL nRound := 3
LOCAL bAction
LOCAL bClrTabs
LOCAL bClrText
LOCAL aAlign
LOCAL lAdjust := .F.
LOCAL nSeparator := 3
LOCAL nOption := 1
LOCAL bPopUp
LOCAL lStretch := .F.
LOCAL cLayOut := "TOP"
LOCAL bBmpAction
LOCAL nBright := 0
LOCAL lAnimate := .F.
LOCAL nSpeed
LOCAL oFont
LOCAL lTransparent := .F.
LOCAL aDialogs
LOCAL lBorder := .T.
LOCAL nClrPane := CLR_WHITE
LOCAL cVarName
DEFINE DIALOG oDlg SIZE 400, 300
* #define Original
#ifdef Original
@ 3, 5 FOLDEREX oFld PIXEL ;
PROMPT "&One", "&Two", "&Three" ;
SIZE 190, 120
#else
* #define Use_normal
#ifdef Use_normal
oFld := TFolderEx() :New( 3, 5, nWidth , nHeight , oDlg, ;
aBitmaps, lPixel, lDesign, aPrompts, nFolderHeight, ;
aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
lAdjust, nSeparator, nOption, bPopUp, lStretch, ;
cLayOut, bBmpAction, nBright, lAnimate, nSpeed, oFont, ;
lTransparent, aDialogs, lBorder, nClrPane, cVarName )
#else
oFld := TFolderDXE() :New( 3, 5, nWidth , nHeight , oDlg, ;
aBitmaps, lPixel, lDesign, aPrompts, nFolderHeight, ;
aHelps, nRound, bAction, bClrTabs, bClrText, aAlign, ;
lAdjust, nSeparator, nOption, bPopUp, lStretch, ;
cLayOut, bBmpAction, nBright, lAnimate, nSpeed, oFont, ;
lTransparent, aDialogs, lBorder, nClrPane, cVarName )
oFld:SetDriveIcon(,1)
oFld:SetDriveIcon(,2)
oFld:SetDriveIcon(,3)
oFld:nDlgCode := DLGC_WANTALLKEYS
#endif
#endif
@ 1, 1 GET oGet VAR cTest OF oFld:aDialogs[ 1 ]
@ 2, 1 GET cAnother OF oFld:aDialogs[ 1 ]
@ 7.2, 14 BUTTON "Ok" ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oGet:SetFocus(), .F. )
return nil
Code: Select all | Expand
CLASS TFolderDXE FROM TFolderEx
CLASSDATA lRegistered AS LOGICAL // this variable is compulsory for inherited controls
DATA BFcolor INIT nRGB( 000, 000, 001 )
DATA BGcolor INIT nRGB( 025, 254, 255 )
METHOD SetDriveIcon(cPath,nOption)
ENDCLASS
METHOD SetDriveIcon(cPath,nOption) CLASS TFolderDXE
LOCAL aDrives
LOCAL cDrive
LOCAL nPosi
LOCAL cBMP := "BMPGREEN"
LOCAL acItem
LOCAL acBitmaps
LOCAL acType
DEFAULT nOption := 1
/************
IF !EMPTY(cPath)
cDrive := UPPER(SUBSTR(cPath,1,1))
aDrives := FillDriveArray()
acItem := aDrives[ 1 ]
acBitmaps := aDrives[ 2 ]
acType := aDrives[ 3 ]
nPosi := ASCAN(acItem,{ | x | SUBSTR(x,1,1) = cDrive })
IF nPosi > 0
cBMP := acBitmaps[nPosi]
************/
::SetBitmap( cBMP, nOption )
::Update()
* ENDIF
* ENDIF
RETURN nil
---
Demo show 3 x TAB
on TAB 1 there are 2 x GET and you can "TAB-Key" between GET
but you can NOT "TAB-Key" to "OK" Button to leave GET
on "blank" TAB 2 and 3 "TAB-Key" troggle "OK" Button
---
it does work when use
for use Original TFolderEx() to "TAB-Key" from GET to "OK" Button