>_screen.AddObject( "oCalendar", "Calendar", date() ) >_screen.oCalendar.Visible = .t. > >define class Calendar as Container > >function Init( ldWhen ) >local lnDOW, ldCurrent, lnY, lnX > >ldCurrent = date( year( ldWhen ), month( ldWhen ), 1 ) > >lnY = 10 > >do while month( ldCurrent ) = month( ldWhen ) > lnDow = dow( ldCurrent ) > lnX = ( lnDow - 1 ) * 110 > lcName = "day" + transform( day( ldCurrent ) ) > this.AddObject( lcName, "CalendarDay", day( ldCurrent ) ) > with evaluate( "this." + lcName ) > .Left = lnX > .Top = lnY > .Visible = .t. > this.Height = max( this.Height, lnY + .Height + 10 ) > this.Width = max( this.Width, lnX + .Width + 10 ) > endwith > ldCurrent = ldCurrent + 1 > if ( dow( ldCurrent, 0 ) = 1 ) > lnY = lnY + 60 > endif >enddo > >enddefine > >define class CalendarDay as Container > >function Init( lnDay ) >with this > .Width = 100 > .Height = 50 > > .AddObject( "lblDay", "label" ) > with .lblDay > .Top = 1 > .Left = 10 > .Autosize = .t. > .Caption = transform( lnDay ) > .Visible = .t. > endwith > .AddObject( "txtNotes", "textbox" ) > with .txtNotes > .Top = 20 > .Left = 10 > .Width = 80 > .Visible = .t. > endwith >endwith >enddefine >>