FoxPro Programming
Date time picker
This would be a really cool date picker except the the code in the click event doesn't fire correctly when placed on a form that already has a read event. The popup calendar just flashes.
LOCAL dHoldDate
Public dSelectedDate, oCalendar
*!* Code below was commented out to allow for empty dates
*!* IF EMPTY(this.Parent.txtDate.value)
*!* dSelectedDate = DATE()
*!* ELSE
dSelectedDate = this.Parent.txtDate.value
*!* ENDIF
oCalendar = CREATEOBJECT("calCalendar", dSelectedDate)
this.Parent.PositionCalendar(oCalendar)
oCalendar.visible = .t.
BINDEVENT(thisform, "moved", this.Parent, "PositionCalendar")
READ EVENTS
UNBINDEVENTS(thisform, "moved", this.Parent, "PositionCalendar")
*!* IF dHoldDate != dSelectedDate
WITH this.parent
dHoldDate = .txtDate.Value
.txtDate.Value = dSelectedDate
.txtDate.refresh()
IF dHoldDate != dSelectedDate
this.parent.interactiveChange()
ENDIF
ENDWITH
*!* ENDIF
oCalendar = NULL
RELEASE dSelectedDate, oCalendar