Anyone like to try this ..
the Date format is set for YYYY-MM-DD ; so rework if required
This is a proof of concept test for one of my apps.
I thought it may be a reasonable example of form resizing, and control relocation.
Note that the TextBox should be ReadOnly .. this bug will be fixed in the ARX.
(DEFUN C:CalendarTest (/ _displayDate )
;;--------------------------------------
(DEFUN _displayDate (rValue / CAL_DATE DAY MONTH)
(SETQ Month (CADR rValue)
Day (CADDR rValue)
cal_date (STRCAT (ITOA (CAR rValue))
"-"
(IF (< Month 10)
(STRCAT "0" (ITOA Month))
(ITOA Month)
)
"-"
(IF (< Day 10)
(STRCAT "0" (ITOA Day))
(ITOA Day)
)
)
)
(DCL_CONTROL_SETTEXT 20071009-CalendarTest_Form1_TextBox3 cal_date)
)
;;--------------------------------------
;; ASSUME THE OpenDCL .arx IS LOADED
;;--------------------------------------
(DCL_LOADPROJECT "20071009-CalendarTest" T)
(DCL_FORM_SHOW 20071009-CalendarTest_Form1)
(PRINC)
)
;;============================
;;============================
(DEFUN c:20071009-CalendarTest_Form1_OnInitialize (/)
(DCL_FORM_RESIZE 20071009-CalendarTest_Form1 210 200)
(DCL_CONTROL_SETPOS 20071009-CalendarTest_Form1_MonthPicker2 10 15)
;; (_displayDate (DCL_MONTH_GETTODAY 20071009-CalendarTest_Form1_MonthPicker2))
(DCL_CONTROL_SETTEXT 20071009-CalendarTest_Form1_TextBox3 "Select Date ->")
)
;;============================
(DEFUN c:20071009-CalendarTest_Form1_TextButton4_OnClicked (/)
(DCL_CONTROL_SETVISIBLE 20071009-CalendarTest_Form1_MonthPicker2 T)
)
;;============================
(DEFUN c:Project1_Form1_MonthPicker2_OnSelChanged (nSelection sSelText /)
;;; THIS HAS A BUG ... VER4.1.0.10
(DCL_MESSAGEBOX
"To Do: code must be added to event handler\r\nc:Project1_Form1_MonthPicker2_OnSelChanged"
"To do"
)
)
;;============================
(DEFUN c:20071009-CalendarTest_Form1_MonthPicker2_OnSelect (/)
(_displayDate (DCL_MONTH_GETCURSEL 20071009-CalendarTest_Form1_MonthPicker2))
(DCL_CONTROL_SETVISIBLE 20071009-CalendarTest_Form1_MonthPicker2 nil)
)
;;============================
(princ)
Added: Log-In for SourceCode Download
[attachment deleted by admin]
The Piccy :
Select to Activate.
[attachment deleted by admin]