Hi i'm trying to use datebrowser.gadget with DATEBROWSER_MultiSelect,TRUE, but can't make it work (as I think it should)
.. LAYOUT_AddChild, OBJ(GID_DATEBROWSER) = IIntuition->NewObject(DateBrowserClass, NULL, //"datebrowser.gadget", GA_ID, GID_DATEBROWSER, GA_RelVerify, TRUE, //DATEBROWSER_ShowTitle, TRUE, //DATEBROWSER_ShowWeek, TRUE, //DATEBROWSER_DayTitles, weeknames, //DATEBROWSER_Day, D_today, DATEBROWSER_Month, M_today+1, DATEBROWSER_Year, Y_today, DATEBROWSER_MultiSelect, TRUE, DATEBROWSER_SelectedDays, M_mydays[M_today], TAG_DONE), ..
It opens fine, M_today points to actual MONTH (dtarting from 0), Y_today -> actual YEAR and M_mydays[M_today] is an uint32 M_mydays[12] all filled with 0.
Clicking on a day adds it to my M_mydays[]
.. case GID_DATEBROWSER: IIntuition->GetAttrs(OBJ(GID_DATEBROWSER), DATEBROWSER_SelectedDays,&NewSpecialDays, TAG_END); IDOS->Printf("MOD MONTH:%2ld = 0x%08lx -> 0x%08lx (%s)\n",M_today+1,M_mydays[M_today],NewSpecialDays,ILocale->GetLocaleStr(ll, MON_1+M_today) ); //if(NewSpecialDays == M_mydays[M_today]) break; M_mydays[M_today] |= NewSpecialDays; IIntuition->RefreshSetGadgetAttrs(GAD(GID_DATEBROWSER), windows[WID_MAIN], NULL, DATEBROWSER_Month,M_today+1, DATEBROWSER_Year,Y_today, DATEBROWSER_SelectedDays,M_mydays[M_today], TAG_DONE); break; ..
I have a CLEAR button too, it erases all days marked/selected:
.. case GID_CLEAR: M_mydays[M_today] = 0; IDOS->Printf("\nCLR MONTH:%2ld = 0x%08lx (%s)\n",M_today+1,0,ILocale->GetLocaleStr(ll, MON_1+M_today) ); IIntuition->RefreshSetGadgetAttrs(GAD(GID_DATEBROWSER), windows[WID_MAIN], NULL, DATEBROWSER_Month,M_today+1, DATEBROWSER_Year,Y_today, DATEBROWSER_SelectedDays,M_mydays[M_today], TAG_DONE); break; ..
But when I try to select again the days it acts "funny":
1)Selecting only one day, CLEARing and then trying to select same day again, doesn't reccess such day.
2)Selecting one day, CLEARing and then selecting another day marks previous (cleared) day.
Any ideas what I'm doing wrong?
TIA
Can post full source (200 lines of code, 10KB)
I tried with OS 3.9 and all I can say is that the first click after setting SelectedDays is ignored. So if I clear the month and try to select a day, it is ignored. I have to click again but then the reaction is correct. This matches your first point, but I cannot confirm your second point.
Anyway you should report it as a bug on http://forum.hyperion-entertainment.biz/
OK thx. Added your reply in the BZ entry I reported.
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P