Problemas con la versión 7.12
Posted: Tue Dec 18, 2007 12:01 pm
Me he encontrado los siguientes problemas en la versión 7.12 y como los he solucionado
1.- TCombobox. Genera un error al pulsar VK_DEL si la lista de elementos (::aItems) son 0
2.- TDtPicke. Genera un error al definir el objeto si la variable (uVar) esta definida a null. No se si es un error pero la clase TGet lo acepta.
3. TTmPicke. No controla correctamente la hora vacia (checkbox a su izquierda)
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