FS#9224 - Calendar button map for Gigabeat F and other targets

Attached to Project: Rockbox
Opened by Teruaki Kawashima (teru) - Tuesday, 29 July 2008, 15:21 GMT
Last edited by Nils Wallménius (nls) - Saturday, 25 October 2008, 16:35 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This patch will make calendar plugin available for the targets with RTC.
1. I added button maps just like other plugins and fixed some codes.
2. use rb->memset to initialize struct variables.
3. draw lines if the LCD is large enough.
4. use List Widget to show memos and menu API for edit menu.

I tested this on my Gigabeat F21 and on the sim.
Sorry for my bad English.
This task depends upon

Closed by  Nils Wallménius (nls)
Saturday, 25 October 2008, 16:35 GMT
Reason for closing:  Accepted
Additional comments about closing:  I committed the last patch with two small tweaks, thanks!
Comment by Justin Hannigan (Chronon) - Friday, 08 August 2008, 20:23 GMT
I will give this a test over the weekend.

Comment by Teruaki Kawashima (teru) - Saturday, 16 August 2008, 11:19 GMT
fix a bug that the display of month and year could overlap day.
Comment by Teruaki Kawashima (teru) - Sunday, 14 September 2008, 09:15 GMT
updated to revision 18510 and reverted some changes.
Comment by Nils Wallménius (nls) - Friday, 24 October 2008, 09:03 GMT
This is definitely the right thing to do with this plugin.
The patch needs to be synced to svn though.

edit: using DRMODE_COMPLEMENT and fillrect works well on monochrome displays but
it is not so nice on color displays since it fills the rectangle with the complement
color which is often not the same as the background color.
Comment by Teruaki Kawashima (teru) - Friday, 24 October 2008, 16:30 GMT
I made a patch without touching functions drawing calendar.
this patch does following things;
1.add button maps.
2.use List Widget to show memos.
3.use menu API for edit menu.
button maps needs to be tested.

Nils: then, what value should be set?
i don't understand well how the setting affects.
Comment by Nils Wallménius (nls) - Saturday, 25 October 2008, 10:21 GMT
An example can be seen in the "set time and date" screen which uses
DRMODE_SOLID|DRMODE_INVERSEVID for the selected item this will draw the
text with background and foreground colors reversed but will not extend beyond
the text drawn so to get the visual effect i think you should fill a rectangle
with the background color first and then draw the text with DRMODE_SOLID|DRMODE_INVERSEVID set.
I forgot to mention that the effect is only visible when not using black and white as
fg/bg since they are each other's inverse it is pretty visible if you use different colors though.

The patch works fine for me but i want to suggest a few changes to the menu.
1) The "New" item is confusing I understand that it's meant as a sort of subtitle but
this doesn't work so well with rockbox' lists imho. I would suggest to either remove the "New" item
and call the others "New Daily" etc, or make "New" open a submenu that contains the different types of memos.
2) The "Return" menu item should be removed so that this works consistently with other lists in rockbox, which
you exit by pressing left (or equivalent button).

Button maps look good to me, if something should be changed people will complain after it's committed ;)

edit: forgot to mention, the "set time and date" screen is in screens.c and around line 570 the drawing is done.
Comment by Teruaki Kawashima (teru) - Saturday, 25 October 2008, 15:39 GMT
here is a updated patch.
Thank you for your suggestions.