Another re-use sample calendar checkbox

65 views
Skip to first unread message

José Quintas

unread,
Jun 7, 2025, 9:51:05 AM6/7/25
to Harbour Minigui
democalmonth.prg
creates a month calendar with checkbox for current month



democalmonth.png

democalyear.prg
call democalmonth.prg 12 times
create all year month calendar with checkbox

democalyear.png

button showall, show list of all checked dates of all year

José M. C. Quinas


democalmonth.prg
democalyear.prg

Grigory Filatov

unread,
Jun 7, 2025, 10:46:04 AM6/7/25
to Harbour Minigui
Hi José,

Thanks a lot!

Your example is an amazing tutorial on array management.

Kind regards,
Grigory

суббота, 7 июня 2025 г. в 15:51:05 UTC+2, jmcqu...@gmail.com:

José Quintas

unread,
Jun 7, 2025, 1:44:02 PM6/7/25
to Harbour Minigui
A complement test, about the powerfull feature on HMG Extended when use any variable.

CLASS ObjFromStack

   VAR aStack INIT {}

   METHOD New( ... )
   METHOD Center() INLINE DoMethod( hb_ArrayToParams( ::aStack ), "Center")
   METHOD Activate() INLINE DoMethod( hb_ArrayToParams( ::aStack ), "Activate")
   METHOD Value( xValue )
ENDCLASS

METHOD New( ... ) CLASS ObjFromStack

   ::aStack := hb_AParams()

   RETURN Self

METHOD Value( xValue ) CLASS ObjFromStack

   IF xValue != Nil
      SetProperty( hb_ArrayToParams( ::aStack ), "Value", xValue )
   ELSE
      xValue := GetProperty( hb_ArrayToParams( ::aStack ), "Value" )
   ENDIF

   RETURN xValue


On same sample:
   oDlg := ObjFromStack():new(  xDlg )
   oDlg:Center()
   oDlg:Activate()
...
         IF ! Empty( oDay )
            oCheck := ObjFromStack():New( xDlg, oDay )
            IF oCheck:Value
               cTxt += Dtoc( Stod( "2025" + StrZero( oMonth:__EnumIndex(), 2 ) + StrZero( oDay:__EnumIndex(), 2 ) ) ) + " "
            ENDIF
         ENDIF

Note: 
the Empty() is needed, because there are 31 days on array, but not all months have 31 days
It is only a test, we do not need OOP all time

José M. C. Quintas
democalyearoop.zip
Reply all
Reply to author
Forward
0 new messages