Hola Andrés:Andrés González wrote:Alguien sabe si existe algún control de calendario anual del tipo los doce meses en el mismo control, no me refiero a los 12 cuadritos de los meses, si no a 12 lineas una por cada mes, recuerdo haberlo visto en los antiguos programas del grupo sp, y antiguamente alguien hizo algo cuando teníamos el foro de las news.
Alguien me puede poner en la pista.
jajajaRicardo Ramirez E. wrote:Manuel... qeu control es ese???Es free?
Lo necesito..
Andrés González wrote:cuando hago dobleclick en la cabecera de los días de la semana me hace otro orden distinto de los días y si pulso en la primera o ultima semana me genera un error
:lNoChangeOrd := .T.
Una Disculpa por la tardanza.Ricardo Ramirez E. wrote:Puedes enviarmela a mi tambien
#include "Fivewin.ch"
#include "TSBrowse.ch"
//--------------------------------------------------------------------------------------------------------------------//
Function CalAnual( dDate )
Local oDlg, oBrw, nCol, dFecha, nMonth, aLine, bBlock, nDia, nMes, nYear, ;
aCale := {}, ;
aMes := { "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" }, ;
aSem := { "Mes", "Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab", ;
"Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab", ;
"Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab", ;
"Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab", ;
"Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab", "Dom", "Lun", "Mar", "Mie" }
Default dDate := Date()
SET DATE BRITISH
SET EPOCH TO Year( Date() ) - 70
SetKey( VK_UP, {|| If( GetKeyState( VK_CONTROL ), aSetCale( StoD( Str( --nYear, 4 ) + StrZero( nMes, 2 ) + ;
StrZero( nDia, 2 ) ), oBrw, oDlg ), Nil ) } )
SetKey( VK_DOWN, {|| If( GetKeyState( VK_CONTROL ), aSetCale( StoD( Str( ++nYear, 4 ) + StrZero( nMes, 2 ) + ;
StrZero( nDia, 2 ) ), oBrw, oDlg ), Nil ) } )
nYear := Year( dDate )
aCale := aSetCale( dDate )
nDia := AScan( aCale[ Month( dDate ) ], {|e,n| n > 1 .and. e == Day( dDate ) } )
DEFINE DIALOG oDlg TITLE Str( nYear ) SIZE 760, 210
@ 0, 0 BROWSE oBrw ARRAY aCale OF oDlg SIZE 385, 107 PIXEL CELLED ;
COLORS CLR_BLACK, {|r,c| If( c == 1, CLR_HGRAY, CLR_WHITE ) }, ;
{ |c| If( c== oBrw:nCell, CLR_WHITE, CLR_BLACK ) }, ;
{ |c| If( c== oBrw:nCell, CLR_BLACK, CLR_HGRAY ) }, CLR_WHITE, CLR_BLACK
For nCol := 1 To 38
bBlock := bDetachable( oBrw, nCol )
ADD COLUMN TO oBrw DATA bBlock TITLE aSem[ Min( 42, nCol ) ] SIZE 20 ALIGN DT_RIGHT
oBrw:aColumns[ nCol ]:bGotFocus := {|| Eval( oBrw:bChange ) }
Next
With Object oBrw
:lNoChangeOrd := .T.
:lNoHSCroll := .T.
:lInitGoTop := .F.
:aColumns[ 1 ]:lFixLite := .T.
:nFreeze := 1
:lLockFreeze := .T.
:nRowPos := Month( dDate )
:bChange := { || If( Empty( oBrw:aArray[ oBrw:nAt, oBrw:nCell ] ), dFecha := CtoD( "//" ), ( ;
dFecha := Ctod( StrZero( nDia := oBrw:aArray[ oBrw:nAt, oBrw:nCell ], 2 ) + "/" + ;
StrZero( nMes := oBrw:nAt, 2 ) + "/" + Str( nYear ) ), oBrw:DrawHeaders() ) ) }
End With
ACTIVATE DIALOG oDlg CENTER ON INIT oBrw:HiliteCell( nDia )
Return dFecha
//--------------------------------------------------------------------------------------------------------------------//
Static Function bDetachable( oBrw, nCol )
Return { |uVar| If( uVar == Nil, oBrw:aArray[ oBrw:nAt, nCol ], oBrw:aArray[ oBrw:nAt, nCol ] := uVar ) }
//--------------------------------------------------------------------------------------------------------------------//
Static Function aSetCale( dDate, oBrw, oDlg )
Local aLine, nMonth, nCol, dFecha, nYear, nDia, ;
aMes := { "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic" }, ;
aArr := {}
nYear := Year( dDate )
For nMonth := 1 To 12
dFecha := CtoD( "01/" + StrZero( nMonth, 2 ) + "/" + Str( nYear ) )
nCol := DoW( dFecha )
aLine := Array( 39 )
While Month( dFecha ) == nMonth
aLine[ nCol++ ] := Day( dFecha )
dFecha ++
EndDo
AAdd( aArr, aLine )
Next
For nCol := 1 To Len( aArr )
ASize( aArr[ nCol ], 40 )
AIns( aArr[ nCol ], 1 )
aArr[ nCol, 1 ] := aMes[ nCol ]
Next
If oBrw != Nil
nDia := AScan( aArr[ Month( dDate ) ], {|e,n| n > 1 .and. e == Day( dDate ) } )
oBrw:SetArray( aArr )
oBrw:nRowPos := Month( dDate )
oBrw:HiliteCell( nDia )
oDlg:SetText( Str( nYear, 4 ) )
EndIf
Return aArr
//--------------------------------------------------------------------------------------------------------------------//
Static Function StoD( cAnsiDate )
Local cFormat := Upper( Set( _SET_DATEFORMAT ) ), ;
cYear := SubStr( cAnsiDate, 1, 4 ), ;
cMon := SubStr( cAnsiDate, 5, 2 ), ;
cDay := SubStr( cAnsiDate, 7, 2 )
cFormat := StrTran( cFormat, "YYYY", cYear )
cFormat := StrTran( cFormat, "YY", Right( cYear, 2 ) )
cFormat := StrTran( cFormat, "MM", cMon )
cFormat := StrTran( cFormat, "DD", cDay )
Return CtoD( cFormat )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Antonio Linares and 53 guests