Page 1 of 2

TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Apr 04, 2017 1:33 am
by MGA
Sr. Cristobal,

El mayor calendario no está sincronizado con el más bajo, ver:

Image

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Apr 04, 2017 9:30 am
by cnavarro
No entiendo

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Apr 04, 2017 10:52 am
by MGA
Sr. Cristóbal, la selección de un mes en el calendario (izquierda) se monta el gran calendario (derecha). El calendario (derecha) (domingo, lunes, martes, miércoles, jueves, viernes, sábado) en sus respectivas columnas no coincide con el calendario (izquierda).

Entiendo que los dos calendario debe tener el mismo formato de los días con respecto a sus columnas.

Lo siento, estoy usando el traductor de Google.

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Apr 04, 2017 11:18 am
by cnavarro
Yo he probado ahora mismo a mover el calendario de la izquierda ( pequeño ) y aparece correctamente en la derecha el calendario correspondiente
Tambien he probado a mover los meses en el calendario de la derecha ( grande ) y el pequeño se sincroniza correctamente

Comprueba tu configuracion de fechas, por si influye en algo

Image

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Wed Apr 05, 2017 12:21 am
by MGA
Sr. Cristobal,

compilei o fontes sem nenhuma alteração e o problema continua. Será que é questão de REGIÃO?

Att.

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Wed Apr 05, 2017 2:29 am
by MGA
Sr. Cristobal,

consegui :D


Image


tcalex.prg:

//----------------------------------------------------------------------------//
FUNCTION Calex_SetFirstDate( nFirst )

// local nOldValue
//
// static nFirstDate := 0
//
// nOldValue := nFirstDate
//
// if PCount() > 0
// nFirstDate := Min( Max( 1, nFirst ), 7 ) - 1
// endif

return -1 <---------------------------------- nOldValue para -1

tmonthv.prg:

METHOD SetDate( dDate ) CLASS TMonthView
...
::dEnd := ::dStart + 34
::nWks := 6 <------------------------------ De 5 para 6
...

METHOD PaintHeader( hDC ) CLASS TMonthView
//local dFirstDateWeek := ::GetFirstDateWeek( ::dDate ) //::dDate - DoW( ::dDate ) + 1
local dFirstDateWeek := ::dDate - DoW( ::dDate ) + 1 <-------------------------

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Wed Apr 05, 2017 4:55 pm
by aferra
e onde pode baixar a versão mais nova da tcalex?

agradecido

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Wed Apr 05, 2017 5:26 pm
by MGA
aferra,

solicite o envio aqui:

viewtopic.php?f=6&t=33740

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Mon Apr 10, 2017 12:36 am
by MGA
Sr. Cristobal,

estou tentando utilizar a WINDOW principal como MDICHILD mais não estou conseguindo, a window inicia mais o mouse não funciona. A window fica como se estivesse congelada.

METHOD New() CLASS SampleCalex

local oMenu
local oSelf := Self

MENU oMenu
ENDMENU

::dDateStart := Date()
::dDateEnd := Date()
::lOnPreNext := .F.
::nIDPonto := RetornaIDDoPonto()

DEFINE WINDOW ::oWndAC mdichild of M->oWnd TITLE "Agenda de Compromissos" MENU oMenu

::BuildPanels()
::BuildExplorer()
::BuildCalex()

::oWndAC:SetIcon( TIcon():New(,,'MGAICON'))
::oWndAC:bKeyDown := {|nKey| IIf( nKey == VK_ESCAPE,::oWndAC:End(),) }

ACTIVATE WINDOW ::oWndAC MAXIMIZED ;
ON RESIZE oSelf:SetSize( nSizeType, nWidth, nHeight )


RETURN Self

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Mon Apr 10, 2017 1:41 pm
by cnavarro
Mira, te pongo los métodos que tienes que modificar
El problema es que en el caso de las MDICHILDs, no puedes hacer referencia ( OF ) a ::oWnd:oWndClient en los controles, sino a la propia ventana ::oWnd

Code: Select all  Expand view


function Main()

   local oBrush
   local oMenu
   local oWnd

   HB_CDPSELECT("ESWIN")
   HB_LangSelect( "ES" )

   SET DATE FORMAT "MM/DD/YYYY"
   SET DELETE ON
   
   DEFINE BRUSH oBrush COLOR CLR_GRAY
   DEFINE WINDOW oWnd MDI BRUSH oBrush
   
   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON INIT SampleCalex():New( oWnd )
 
   oBrush:End()  
   
   //SampleCalex():New()

return nil

//----------------------------------------------------------------------------//

METHOD New( oWnd ) CLASS SampleCalex
   
   local oMenu
   local oSelf  := Self
   local oBrush
   
   MENU oMenu
   ENDMENU
   
   ::dDateStart := Date()
   ::dDateEnd   := Date()
   
   ::lOnPreNext := .F.
   
   ::cAlias     := "citas"
   
   ::BuildDbf()

   DEFINE BRUSH oBrush COLOR CLR_HGRAY

   if Empty( oWnd )
      DEFINE WINDOW ::oWnd MDI MENU oMenu BRUSH oBrush
   else
      DEFINE WINDOW ::oWnd MDICHILD MENU oMenu BRUSH oBrush OF oWnd
   endif
   
   ::BuildPanels()
   ::BuildSplitterV()
   ::BuildExplorer()
   ::BuildCalex()
//   ::AddDates()

   ACTIVATE WINDOW oSelf:oWnd MAXIMIZED ;
      ON RESIZE oSelf:SetSize( nSizeType, nWidth, nHeight )
 
   oBrush:End()

RETURN Self

//----------------------------------------------------------------------------//

METHOD BuildPanels() CLASS SampleCalex

   local oBrush
   local oParent

   if ::oWnd:ClassName() == "TMDICHILD"
      oParent := ::oWnd
   else
      oParent  := ::oWnd:oWndClient
   endif
   ::oPanelExplorer := TPanel():New( 1, 0, ::oWnd:nHeight, 280, oParent )
   ::oPanelCalex    := TPanel():New( 1, ::oPanelExplorer:nWidth + 6, ::oWnd:nHeight, ::oWnd:nWidth - ::oPanelExplorer:nWidth + 6, oParent )
   DEFINE BRUSH oBrush COLOR CLR_WHITE
   ::oPanelExplorer:SetBrush( oBrush )
   ::oPanelCalex:SetBrush( oBrush )
   oBrush:End()

Return nil

//---------------------------------------------------//


 


Image

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Mon Apr 10, 2017 5:45 pm
by MGA
Muito obrigado Sr. Cristobal,

vou testar! :D

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Apr 11, 2017 1:55 am
by MGA
Perfeito Maestro! :D

Muito obrigado!

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Oct 24, 2017 7:48 am
by AngelSalom
Hola amigos, tengo el mismo problema con el correcto pintado del calex en algunos meses. La solución que aquí se aporta soluciona el problema pero siempre muestra como Domingo el primer día de la semana independientemente del SetFirstDate ... ¿cómo sería para poner el lunes?

Me refiero a este código :

Code: Select all  Expand view
tcalex.prg:

//----------------------------------------------------------------------------//
FUNCTION Calex_SetFirstDate( nFirst )

// local nOldValue
//
// static nFirstDate := 0
//
// nOldValue := nFirstDate
//
// if PCount() > 0
// nFirstDate := Min( Max( 1, nFirst ), 7 ) - 1
// endif

return -1 <---------------------------------- nOldValue para -1

tmonthv.prg:

METHOD SetDate( dDate ) CLASS TMonthView
...
::dEnd := ::dStart + 34
::nWks := 6 <------------------------------ De 5 para 6
...

METHOD PaintHeader( hDC ) CLASS TMonthView
//local dFirstDateWeek := ::GetFirstDateWeek( ::dDate ) //::dDate - DoW( ::dDate ) + 1
local dFirstDateWeek := ::dDate - DoW( ::dDate ) + 1 <-------------------------


Gracias

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Oct 24, 2017 8:38 am
by cnavarro
Esa es la clausula que has de utilizar

DEFINE CALEX ::oCalex OF ::oPanelCalex ;
FROM 1, 10 TO 600, 600 ;
FIRST_DATE 1 ALL //TOP //LEFT //BOTTOM //RIGHT

Re: TCALEX - Sr. Cristobal Navarro

PostPosted: Tue Oct 24, 2017 8:49 am
by AngelSalom
Cristóbal, gracias. Así lo hago, pero todos los meses en los que el día 1 es domingo (En 2017, Enero y Octubre), la información no se muestra correctamente.
Adjunto capturas.

Enero
Image

Octubre
Image