Re: [WIN] MonthCalendar Control: getSelected, how?
- Posted by Derek Parnell <ddparnell at bigpond.com> Aug 03, 2001
- 484 views
There is a bug in the notification handler for Calendars. To fix it, find the function "fDoMCN_SELCHANGE" and insert this line as the first line in the function. id = getId( fetch(lParam, NMHDR_hwndFrom ) ) ----- Original Message ----- From: <DanMoyer at PRODIGY.NET> To: "EUforum" <EUforum at topica.com> Subject: [WIN] MonthCalendar Control: getSelected, how? > > In trying to use the MonthCalendar control, I was thinking I could get info > about which date was user clicked on by using "SelectedDate = > getSelectedDate( MonthCalendar2 )", by putting it in an > "onChange[MonthCalendar2]" event routine, but it doesn't seem to work. Is > that wrong approach?? (I tried putting it in "onClick", too, but that > didn't work for me either.) > > Below is full test code. > > Dan Moyer > > -- code generated by Win32Lib IDE v0.10.5 > > include Win32Lib.ew > without warning > > ---- > -- Window Window1 > global constant Window1 = create( Window, "Window1", 0, Default, Default, > 592, 301, 0 ) > global constant MonthCalendar2 = create( MonthCalendar, "MonthCalendar2", > Window1, 4, 4, 250, 200, 0 ) > global constant MleText3 = create( MleText, "MleText3", Window1, 272, 8, > 304, 196, 0 ) > ---- > -- variable structures for dated notes: > sequence CalendarDates, CalendarNotes > CalendarDates = {} > CalendarNotes = {} > ---- > procedure Window1_onOpen () > setText( MleText3, "beginning" ) -- test to see it written > end procedure > onOpen[Window1] = routine_id("Window1_onOpen") > > ---- > procedure MonthCalendar2_onChange () > sequence SelectedDate > integer DateInfoLocation > > SelectedDate = getSelectedDate( MonthCalendar2 ) > DateInfoLocation = find(SelectedDate, CalendarDates) > if DateInfoLocation then > wPuts( MleText3, CalendarNotes[DateInfoLocation] ) > else > setText( MleText3, "nothing" ) > wPuts( MleText3, "nothing") -- tried first > end if > end procedure > onChange[MonthCalendar2] = routine_id("MonthCalendar2_onChange") > > ---- > > WinMain( Window1, Normal ) > > > > >