DTPICKER show 1 Year

Post Reply
User avatar
Jimmy
Posts: 1734
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

DTPICKER show 1 Year

Post by Jimmy »

hi,

when using DTPICKER i got a Control where i can open Calendar
how to open Calendar at INIT :?:

i like to show 1 Year Calendar like this "only" ( no Action )
Image
greeting,
Jimmy
User avatar
Silvio.Falconi
Posts: 7110
Joined: Thu Oct 18, 2012 7:17 pm

Re: DTPICKER show 1 Year

Post by Silvio.Falconi »

I think you must create a dialog with 12 calendar controls
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Jimmy
Posts: 1734
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: DTPICKER show 1 Year

Post by Jimmy »

hi Silvio,

thx for Answer

ok, got it : wrong Control :roll:
instead of DTPICKER (SysDateTimePick32) i have to use CALENDAR (SysMonthCal32)

but i got a Problem with CALENDAR : NO Events :shock:

ACTION and DblClick seems not to work in Sample
c:\fwh\samples\testcal.prg
greeting,
Jimmy
User avatar
Silvio.Falconi
Posts: 7110
Joined: Thu Oct 18, 2012 7:17 pm

Re: DTPICKER show 1 Year

Post by Silvio.Falconi »

No you must use tcalendar class, no datepick class
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Jimmy
Posts: 1734
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: DTPICKER show 1 Year

Post by Jimmy »

hi Silvio,
Silvio.Falconi wrote:No you must use tcalendar class, no datepick class
got it
Image

but as i say it does not "react" on Event :shock:

Code: Select all | Expand

PROCEDURE ShowCalendar()
LOCAL oDlg, oCal
LOCAL dFirst := DATE()

   DEFINE WINDOW oDlg FROM 0, 0 TO 768, 1100 PIXEL TITLE "Calendar" ICON "A1MAIN" ;
         COLOR BFcolor, BGcolor NOMINIMIZE NOMAXIMIZE

      @  0,  0 CALENDAR oCal VAR dFirst FONT oFontDefault OF oDlg ;
              COLOR BFcolor, BGcolor ;
              DBLCLICK MsgInfo( oCal:GetDate() ) ;
              ON CHANGE( oDlg:Update() ) WEEKNUMBER ;
              ACTION( MsgInfo( "ok" ) )                               //  , oCal:End(), oDlg:End() )

      // 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 )

      oDlg:oClient := oCal

      oDlg:bKeyDown := { | nKey, nFlag | IF( nKey = VK_ESCAPE, oDlg:End(), nil ) }
      oCal:bKeyDown := { | nKey, nFlag | IF( nKey = VK_ESCAPE, oDlg:End(), nil ) }

#IFDEF __HMG__
   END WINDOW
#endif

   ACTIVATE WINDOW oDlg CENTERED

RETURN
p.s. when use DIALOG it will display only small 1 Month Calendar ... why :?:
greeting,
Jimmy
User avatar
Jimmy
Posts: 1734
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: DTPICKER show 1 Year

Post by Jimmy »

hi,

i have Problem with CALENDAR Control as i seem not to "react" on (any) Event :shock:

---

i found in CLASS TCalendar

Code: Select all | Expand

   METHOD HandleEvent()  VIRTUAL
i wonder as CLASS TDatePick did not have METHOD HandleEvent() which is about the same Control

---

i have made a copy of CLASS TCalendar and include it in App.

when remove

Code: Select all | Expand

   METHOD HandleEvent()  VIRTUAL
it work on VK_RETURN or VK_ESCAPE or other Event :D

so what does VIRTUAL mean in CLASS TCalendar :?:
greeting,
Jimmy
Post Reply