Can't make datebrowser work correct :-/

3 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
Can't make datebrowser work correct :-/

Hi i'm trying to use datebrowser.gadget with DATEBROWSER_MultiSelect,TRUE, but can't make it work (as I think it should)

  1. ..
  2. LAYOUT_AddChild, OBJ(GID_DATEBROWSER) = IIntuition->NewObject(DateBrowserClass, NULL, //"datebrowser.gadget",
  3. GA_ID, GID_DATEBROWSER,
  4. GA_RelVerify, TRUE,
  5. //DATEBROWSER_ShowTitle, TRUE,
  6. //DATEBROWSER_ShowWeek, TRUE,
  7. //DATEBROWSER_DayTitles, weeknames,
  8. //DATEBROWSER_Day, D_today,
  9. DATEBROWSER_Month, M_today+1,
  10. DATEBROWSER_Year, Y_today,
  11. DATEBROWSER_MultiSelect, TRUE,
  12. DATEBROWSER_SelectedDays, M_mydays[M_today],
  13. TAG_DONE),
  14. ..

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[]

  1. ..
  2. case GID_DATEBROWSER:
  3. IIntuition->GetAttrs(OBJ(GID_DATEBROWSER), DATEBROWSER_SelectedDays,&NewSpecialDays, TAG_END);
  4. 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) );
  5.  
  6. //if(NewSpecialDays == M_mydays[M_today]) break;
  7. M_mydays[M_today] |= NewSpecialDays;
  8.  
  9. IIntuition->RefreshSetGadgetAttrs(GAD(GID_DATEBROWSER), windows[WID_MAIN], NULL,
  10. DATEBROWSER_Month,M_today+1, DATEBROWSER_Year,Y_today,
  11. DATEBROWSER_SelectedDays,M_mydays[M_today], TAG_DONE);
  12. break;
  13. ..

I have a CLEAR button too, it erases all days marked/selected:

  1. ..
  2. case GID_CLEAR:
  3. M_mydays[M_today] = 0;
  4. IDOS->Printf("\nCLR MONTH:%2ld = 0x%08lx (%s)\n",M_today+1,0,ILocale->GetLocaleStr(ll, MON_1+M_today) );
  5. IIntuition->RefreshSetGadgetAttrs(GAD(GID_DATEBROWSER), windows[WID_MAIN], NULL,
  6. DATEBROWSER_Month,M_today+1, DATEBROWSER_Year,Y_today,
  7. DATEBROWSER_SelectedDays,M_mydays[M_today], TAG_DONE);
  8. break;
  9. ..

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)

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
I tried with OS 3.9 and all I

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/

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 5 days ago
Joined: 2013-05-30 00:53
OK thx. Added your reply in

OK thx. Added your reply in the BZ entry I reported.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments