Page 1 of 1

DTPICKER show 1 Year

Posted: Tue May 09, 2023 11:37 pm
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

Re: DTPICKER show 1 Year

Posted: Wed May 10, 2023 9:44 am
by Silvio.Falconi
I think you must create a dialog with 12 calendar controls

Re: DTPICKER show 1 Year

Posted: Wed May 10, 2023 4:18 pm
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

Re: DTPICKER show 1 Year

Posted: Wed May 10, 2023 5:13 pm
by Silvio.Falconi
No you must use tcalendar class, no datepick class

Re: DTPICKER show 1 Year

Posted: Wed May 10, 2023 7:30 pm
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 :?:

Re: DTPICKER show 1 Year

Posted: Sat May 13, 2023 8:35 pm
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 :?: