1.- TCombobox. Genera un error al pulsar VK_DEL si la lista de elementos (::aItems) son 0
Code: Select all
METHOD KeyChar( nKey, nFlags ) CLASS TComboBox
local nNewAT := 0, nOldAT := ::nAT, uItem
do case
case nKey = 32 // VK_DELETE (DO NOT WORK!)
::cSearchKey = ""
nNewAt = 1
uItem = if( len(::aItems)>=nNewAt, ::aItems[ nNewAt ], '' ) //... Nuevo.fgondi
case nKey = VK_BACK
::cSearchKey = Left( ::cSearchKey, Len( ::cSearchKey ) - 1 )
case nKey = 190
nKey = 0
::cSearchKey += "."
otherwise
::cSearchKey += Upper( Chr( nKey ) )
endcase
if Empty( uItem )
if nNewAt == 0
nNewAt = AScan( ::aItems, {|x| Upper(x) = ::cSearchKey } )
if nNewAt > 0 //.and. Len( ::aItems ) <= nNewAt //... Nuevo.fgondi
uItem = ::aItems[ nNewAt ]
elseif len(::aItems)>=Max( ::nAT, 1 ) //... Nuevo.fgondi
uItem = ::aItems[ Max( ::nAT, 1 ) ] //... Nuevo.fgondi
endif
elseif len(::aItems)>=Max( nNewAt, 1 ) //... Nuevo.fgondi
uItem = ::aItems[ Max( nNewAt, 1) ]
endif
endif
...
Code: Select all
METHOD SetDate( dDate, lEmpty ) INLINE if( Valtype(dDate)<>'D', dDate := ctod(''), ),; //... Nuevo.fgondi
SetDatePick( ::hWnd, Year( dDate ),;
Month( dDate ), Day( dDate ),;
If( ( lEmpty != nil .and. lEmpty ) .or. Empty( dDate ),;
1, 0 ) )
Code: Select all
METHOD GetTime() INLINE if( Empty(GetDatePick( ::hWnd )), space(6), GetTimePick(::hWnd) ) //... Nuevo.fgondi
Code: Select all
METHOD SetTime( cHour ) CLASS TTimePick
local cShow, nHora, nMinut, nSeg
cShow := if( Empty(cHour), Hora(), cHour )
dShow := if( Empty(cHour), Date(), ctod('') ) //... Nuevo.fgondi
nHora := Val(left(cShow, 2))
if At(':', cShow)<>0
nMinut := Val(SubStr(cShow, 4, 2))
else
nMinut := Val(SubStr(cShow, 3, 2))
endif
nSeg := Val(Right(cShow, 2))
SetTimePick( ::hWnd, Year( dShow), Month( dShow ), Day( dShow ),;
nHora, nMinut, nSeg, 0 ) //... Nuevo.fgondi
if Empty(cHour)
SetTimePick( ::hWnd, Year( dShow ), Month( dShow ), Day( dShow ),;
nHora, nMinut, nSeg, 1 ) //... Nuevo.fgondi
endif
return self