Subject |
Re: Report Day with DateCalendar.cc |
From |
Ivar B. Jessen <nospam@nospam.com> |
Date |
Sat, 21 May 2016 09:55:34 +0200 |
Newsgroups |
dbase.getting-started |
On Fri, 20 May 2016 16:16:50 -0400 Randy Waldman
Sender: Randy Waldman <randy@houstonfurniturebank.org>
wrote the following in:
Newsgroup: dbase.getting-started
Subject: Report Day with DateCalendar.cc:
MessageID:<TE9OLStsRHA.2024@ip-AC1E04A7>
References:
>Hi. Pro 10.3.1 - working with DateCalendar.cc - (in a field?) below the selected date, I would like to show the day of week Good idea, but I don't know how without hacking the control. Can anyone help?
>
>Thanks, Randy
Randy,
In the following I have taken your subject line "Report Day with
DateCalendar.cc:" to mean "Display Day with DateCalendar.cc:".
Try the code below my signature, it works with Plus10.3.1 on Windows 8 pro
64bit. When a date is selected the name of the day is displayed in a entryfield
below the displayed date.
Ivar B. Jessen
//----- Save as DayCalendar.wfm -----
** END HEADER -- do not remove this line
//
// Generated on 21-05-2016
//
parameter bModal
local f
f = new DayCalendarForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class DayCalendarForm of FORM
set procedure to :duflp:DateCalendar.cc additive
with (this)
metric = 6 // Pixels
height = 263.0
left = 459.0
top = 0.0
width = 287.0
text = ""
endwith
this.DATECALENDAR1 = new DATECALENDAR(this)
with (this.DATECALENDAR1)
left = 78.0
top = 88.0
width = 106.0
height = 24.0
endwith
with (this.DATECALENDAR1.DATEENTRYFIELD)
onGotFocus = class::DATEENTRYFIELD_ONGOTFOCUS
endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this)
with (this.ENTRYFIELD1)
height = 20.0
left = 78.0
top = 123.0
width = 83.0
fontSize = 7.0
value = ""
endwith
function DATEENTRYFIELD_onGotFocus()
nday = (form.DATECALENDAR1.DATEENTRYFIELD.value).getDay()
local dayName
dayName = ""
do case
case nDay = 0
dayname = "Sunday"
case nDay = 1
dayname = "Monday"
case nDay = 2
dayname = "Tuesday"
case nDay = 3
dayname = "Wednesday"
case nDay = 4
dayname = "Thursday"
case nDay = 5
dayname = "Friday"
case nDay = 6
dayname = "Saturday"
endcase
form.entryfield1.value = dayName
return
endclass
//-----
|
|