Tema calendario nuevamente.

Tema calendario nuevamente.

Postby José Camilo » Sun Jun 09, 2024 11:26 pm

Buenas noches.
Buscando un calendario mas grande a MsgDate me sugirieron usar la clase tMiCalendario, mi version de FW es 12.6 y no contiene dicha clase.
Alguien conoce alguna otra aplicacion que muestre un calendario de tamaño mayor?

Gracias
José Camilo
 
Posts: 212
Joined: Wed Apr 07, 2021 3:56 pm

Re: Tema calendario nuevamente.

Postby Antonio Linares » Mon Jun 10, 2024 1:21 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Tema calendario nuevamente.

Postby Jimmy » Mon Jun 10, 2024 5:58 am

hi,
what about CLASS TCalendar from source\classes\tcalenda.prg
Image
Code: Select all  Expand view  RUN
        oCal := TCalendar() :New( 0, 0, { | u | IF( PCOUNT() == 0, dFirst, dFirst := u ) }, { | u | IF( PCOUNT() == 0, dLast, dLast := u ) }, oWnd,,,, BFcolor, BGcolor, oFontDefault, .F.,, .F.,, .F., .T.,, { | nKey, nFlags, Self | ( oWnd:Update() ) },, { | Self | ( oCal:End(), oWnd:End() ) }, { | Self | ( aDates := oCal:GetDateRange(), MsgInfo( cText := DTOC( aDates[ 1 ] ) + " - " + DTOC( aDates[ 2 ] ) + CHR( 13 ) + CHR( 10 ) + LTRIM( STR( aDates[ 2 ] - aDates[ 1 ] ) ) + " Days" ) ) }, .T., .F., .F., .F. )

      // NEED for Color
      SetWindowTheme( oCal:hWnd, "", "" )

      oCal:SetBackGround( BGcolor )
      oCal:SetMonthBk( BGcolor )

      oCal:SetTitleBk( CLR_GRAY )

      oCal:SetTextClr( BFcolor )
      oCal:SetTitleText( BFcolor )
      oCal:SetTrailingText( CLR_GRAY )

      oCal:SetMaxSelCount( 364 + 1 )                                  // max Day Range select

      oWnd:oClient := oCal

      oWnd:bKeyDown := { | nKey, nFlag | IF( nKey = VK_ESCAPE, ( oCal:End(), oWnd:End() ), nil ) }
      oCal:bKeyDown := { | nKey, nFlag | IF( nKey = VK_ESCAPE, ( oCal:End(), oWnd:End() ), nil ) }
      oCal:bAction := { | nKey, nFlag | ( oCal:End(), oWnd:End() ) }
 
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1733
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Tema calendario nuevamente.

Postby Otto » Mon Jun 10, 2024 7:01 am

Jose, 'mas grande' do you mean like Jimmy suggests or the display larger?
Best regards,
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: Tema calendario nuevamente.

Postby karinha » Mon Jun 10, 2024 12:10 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Tema calendario nuevamente.

Postby Antonio Linares » Mon Jun 10, 2024 1:59 pm

Un nuevo calendario implementado por nuestro querido Rao usando XBrowse. Una maravilla! :-)

xbcalend.prg
Code: Select all  Expand view  RUN
#include "fivewin.ch"

REQUEST HB_LANG_ESWIN
REQUEST HB_LANG_FR
REQUEST HB_LANG_PT
REQUEST HB_LANG_DEWIN
REQUEST HB_LANG_IT

static aCal

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

function Main()

   local aWeeks   := Array( 7 )

   aCal  := Array( 7, 6 )

   HB_LANGSELECT( "EN" )

//   AEval( aWeeks, { |u,i| aWeeks[ i ] := Upper( Left( nTocDow( i ), 3 ) ) } )

//   XBROWSER aWeeks

   ShowCalendar()

return nil

function ShowCalendar()

   local dMth, nMth, nYear
   local aMonths  := MonthNames()
   local nLang := 1
   local oDlg, oBrw, oCbxLang, oCbxMth, oGetYr
   local oFont, oBold

   dMth     := BOM( Date() - 30 )
   nMth     := MONTH( dMth )
   nYear    := YEAR( dMth )
   FillDates( nMth, nYear )

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-16
   DEFINE FONT oBold NAME "IMPACT" SIZE 0,-40

   DEFINE DIALOG oDlg SIZE 600,550 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE "CALENDAR"

   @ 40, 20 COMBOBOX oCbxLang VAR nLang ITEMS { "ENGLISH", "SPANISH", "FRENCH", "PORTUGESE", "GERMAN", "ITALIAN" } ;
      SIZE 120,400 PIXEL OF oDlg  ON CHANGE ( ;
         HB_LANGSELECT( { "EN", "ES", "FR", "PT", "DE", "IT" }[ nLang ] ), ;
         oBrw:Refresh(), oCbxMth:SetItems( aMonths := MonthNames() ) )

   @ 40,200 COMBOBOX oCbxMth VAR nMth ITEMS aMonths ;
      SIZE 100,400 PIXEL OF oDlg ON CHANGE ( ;
      FillDates( nMth, nYear ), oBrw:Refresh() )

   @ 40,400 GET oGetYr VAR nYear SIZE 80,30 PIXEL OF oDlg RIGHT SPINNER ;
      ON UP ( FillDates( nMth, ++nYear ), oBrw:Refresh(), oGetYr:Refresh() ) ;
      ON DOWN ( FillDates( nMth, --nYear ), oBrw:Refresh(), oGetYr:Refresh() ) ;
      VALID ( FillDates( nMth, nYear ), oBrw:Refresh(), .t. )


   @ 80, 0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg ;
      DATASOURCE aCal ;
      COLUMNS { || Upper( Left( NtoCDow( oBrw:nArrayAt ), 3 ) ) }, 1, 2, 3, 4, 5 ;
      HEADERS "WEEK", "1", "2", "3", "4", "5" ;
      LINES NOBORDER

   WITH OBJECT oBrw
      :nRowHeight    := 60
      :nWidths       := 90
      :nStretchCol   := 1
      :lDisplayZeros := .f.
      :lColDividerComplete := .f.
      :nDataStrAligns   := AL_CENTER
      :oDataFonts    := oBold
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus() )

return nil

static function FillDates( nMth, nYear )

   local dDate := STOD( STR( nYear, 4 ) + STRZERO( nMth, 2 ) + "01" )
   local nDays := LastDayOM( dDate )
   local nDow  := DOW( dDate )
   local nRow, nCol, nDay := 1

   // this may be revised

   if nDow > 1
      AEval( aCal, { |a| a[ 1 ] := 0 }, 1, nDow )
   endif
   AEval( aCal, { |a| a[ 1 ] := nDay++ }, nDow )
   for nCol := 2 to 4
      AEval( aCal, { |a| a[ nCol ] := nDay++ } )
   next
   AEval( aCal, { |a| a[ 5 ] := If( nDay <= nDays, nDay++, 0 ) } )

   if nDay <= nDays
      AEval( aCal, { |a| a[ 1 ] := nDay++ }, 1, nDays - nDay + 1 )
   endif

return nil

static function MonthNames()

   local aRet  := Array( 12 )

   AEval( aRet, { |u,i| aRet[ i ] := UPPER( NTOCMONTH( i ) ) } )

return aRet

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Tema calendario nuevamente.

Postby José Camilo » Mon Jun 10, 2024 2:04 pm

Muchas Gracias a:
Mr. Rao, Antonio, Joao, Nano Espinoza, Jimmy y Otto por el tiempo dedicado.

Muchas Gracias
José Camilo
 
Posts: 212
Joined: Wed Apr 07, 2021 3:56 pm

Re: Tema calendario nuevamente.

Postby jbrita » Wed Jun 12, 2024 1:08 am

Buenas noches...
Otto podrias compartir ese calendario
saludos
jbrita
 
Posts: 504
Joined: Mon Jan 16, 2006 3:42 pm

Re: Tema calendario nuevamente.

Postby Euclides » Wed Jun 12, 2024 11:45 am

Wonderful!... But... Here in Brazil (and other places in the world) the name of the week days are at the top.
And the week numbers are at left. Could show the number of the week in the year.
Just my 2 cents.
Regards, Euclides.
User avatar
Euclides
 
Posts: 156
Joined: Wed Mar 28, 2007 1:19 pm

Re: Tema calendario nuevamente.

Postby karinha » Wed Jun 12, 2024 1:35 pm

https://imgur.com/NOISSwf

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Tema calendario nuevamente.

Postby karinha » Wed Jun 12, 2024 1:36 pm

Master RAO, can you help with these questions?

Maestro RAO, ¿puede ayudarnos con estas preguntas?

Code: Select all  Expand view  RUN

// C:\FWH\SAMPLES\XBCALEND.PRG  By mister Rao.

#include "fivewin.ch"

REQUEST HB_LANG_ESWIN
REQUEST HB_LANG_FR
REQUEST HB_LANG_PT
REQUEST HB_LANG_DEWIN
REQUEST HB_LANG_IT

REQUEST HB_CODEPAGE_PT850

STATIC aCal

FUNCTION Main()

   LOCAL aWeeks := Array( 7 )

   aCal := Array( 7, 6 )

   // hb_langSelect( "EN" )

   HB_LANGSELECT( 'PT' )     // Default language is now Portuguese

   /*
   Mr Rao, if you use this command, it causes an error on the day:
   Sábado (SAB) is returned S B. In Portuguese there is no S B but SÁB (Sabádo)
   Saturday

   HB_SETCODEPAGE( "PT850" )
   */


   // AEval( aWeeks, { |u,i| aWeeks[ i ] := Upper( Left( nTocDow( i ), 3 ) ) } )

   // XBROWSER aWeeks

   ShowCalendar()

RETURN NIL

FUNCTION ShowCalendar()

   LOCAL dMth, nMth, nYear, oSaida
   LOCAL aMonths  := MonthNames()
   LOCAL nLang // := 1     // 12/06/2024 - Joao.
   LOCAL oDlg, oBrw, oCbxLang, oCbxMth, oGetYr
   LOCAL oFont, oBold, cItens, cHeader, cTitle

   // dMth  := BOM( Date() - 30 ) // 12/06/2024 - Joao.
   // It must show the current month and not the previous month.
   dMth  := BOM( Date() )
   nMth  := Month( dMth )
   nYear := Year( dMth )

   FillDates( nMth, nYear )

   // 12/06/2024 - Joao.
   DEFAULT nLang := FWSetLanguage()
   // nLang := 4 // Portuguese
   FWSetLanguage( nLang )

   SkinButtons()

   // 12/06/2024 - Joao.
   IF( nLang ) = 4
      cItens  := { "INGLÊS", "ESPANHOL", "FRANCÊS", "PORTUGUÊS", "ALEMÃO", "ITALIANO" }
      cHeader := { "SEMANA", "1", "2", "3", "4", "5" }
      cTitle  := "CALENDÁRIO"
   ELSE
      cItens  := { "ENGLISH", "SPANISH", "FRENCH", "PORTUGESE", "GERMAN", "ITALIAN" }
      cHeader := { "WEEK", "1", "2", "3", "4", "5" }
      cTitle  := "CALENDAR"
   ENDIF

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0, - 16
   DEFINE FONT oBold NAME "IMPACT"   SIZE 0, - 40

   DEFINE DIALOG oDlg SIZE 600, 550 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE cTitle

   // Here it returns wrong. After changing the language
   @ 40, 20 COMBOBOX oCbxLang VAR nLang ITEMS cItens                    ;
      SIZE 120, 400 PIXEL OF oDlg  ON CHANGE ( ;
      hb_langSelect( { "EN", "ES", "FR", "PT", "DE", "IT" }[ nLang ] ), ;
      oBrw:Refresh(), oCbxMth:SetItems( aMonths := MonthNames() ) )

   @ 40, 200 COMBOBOX oCbxMth VAR nMth ITEMS aMonths ;
      SIZE 100, 400 PIXEL OF oDlg ON CHANGE ( ;
      FillDates( nMth, nYear ), oBrw:Refresh() )

   @ 40, 400 GET oGetYr VAR nYear SIZE 80, 30 PIXEL OF oDlg RIGHT SPINNER ;
      ON UP ( FillDates( nMth, ++nYear ), oBrw:Refresh(), oGetYr:Refresh() ) ;
      ON DOWN ( FillDates( nMth, --nYear ), oBrw:Refresh(), oGetYr:Refresh() ) ;
      VALID ( FillDates( nMth, nYear ), oBrw:Refresh(), .T. )

   @ 80, 0 XBROWSE oBrw SIZE 0, 0 PIXEL OF oDlg ;
      DATASOURCE aCal ;
      COLUMNS {|| Upper( Left( NtoCDow( oBrw:nArrayAt ), 3 ) ) }, 1, 2, 3, 4, 5 ;
      HEADERS cHeader ; // "WEEK", "1", "2", "3", "4", "5" ;
      LINES NOBORDER

   WITH OBJECT oBrw
      :nRowHeight    := 60
      :nWidths       := 90
      :nStretchCol   := 1
      :lDisplayZeros := .F.
      :lColDividerComplete := .F.
      :nDataStrAligns := AL_CENTER
      :oDataFonts    := oBold
      //
      :CreateFromCode()
   END

   @ 001, 500 BUTTONBMP oSaida PROMPT( "&Saida" )                     ;
      BITMAP "..\bitmaps\16x16\Exit.bmp" TEXTRIGHT SIZE 086, 34 PIXEL ;
      FONT oFont OF oDlg ACTION( oDlg:End() ) CANCEL

   ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus() )

   oFont:End()
   oBold:End()

RETURN NIL

STATIC FUNCTION FillDates( nMth, nYear )

   LOCAL dDate := SToD( Str( nYear, 4 ) + StrZero( nMth, 2 ) + "01" )
   LOCAL nDays := LastDayOM( dDate )
   LOCAL nDow  := DoW( dDate )
   LOCAL nRow, nCol, nDay := 1

   // this may be revised

   IF nDow > 1
      AEval( aCal, {| a | a[ 1 ] := 0 }, 1, nDow )
   ENDIF

   AEval( aCal, {| a | a[ 1 ] := nDay++ }, nDow )

   FOR nCol := 2 TO 4
      AEval( aCal, {| a | a[ nCol ] := nDay++ } )
   NEXT

   AEval( aCal, {| a | a[ 5 ] := If( nDay <= nDays, nDay++, 0 ) } )

   IF nDay <= nDays
      AEval( aCal, {| a | a[ 1 ] := nDay++ }, 1, nDays - nDay + 1 )
   ENDIF

RETURN NIL

STATIC FUNCTION MonthNames()

   LOCAL aRet  := Array( 12 )

   AEval( aRet, {| u, i | aRet[ i ] := Upper( NTOCMONTH( i ) ) } )

RETURN aRet
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Tema calendario nuevamente.

Postby karinha » Wed Jun 12, 2024 1:40 pm

Señor Rao, la visualización del calendario en portugués es incorrecta.

Mister Rao, calendar display for Portuguese is incorrect.

https://imgur.com/FvsUkOv

Image

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Tema calendario nuevamente.

Postby sysctrl2 » Wed Jun 12, 2024 7:34 pm

Se puede seleccionar la fecha ?
Code: Select all  Expand view  RUN

dFecha := ShowCalendar()
? dFecha
 
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1032
Joined: Mon Feb 05, 2007 7:15 pm

Re: Tema calendario nuevamente.

Postby carlos vargas » Tue Jun 25, 2024 9:16 pm

Karina, muy bonito calendario, su forma y colores.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Tema calendario nuevamente.

Postby karinha » Wed Jun 26, 2024 1:36 pm

carlos vargas wrote:Karina, muy bonito calendario, su forma y colores.


Buén dia. Download aqui master:

https://mega.nz/file/cIcwEBaZ#E3PhxjP_GekUMwgN2rOYWN0c00bogblM4WLymsU4fJ8

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 111 guests