X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fgui%2Fmenu.c;h=556985f645a3ed7cf6c832f88f4664c2e0395122;hb=eadb6634eaa197dbc02331d75285a4a47f58d52a;hp=a00d951914a440c3e1fe6b4e56267150a5b62e5a;hpb=0fbabc305e65dfc5538cfcae10c04f6be9daf657;p=bertos.git diff --git a/bertos/gui/menu.c b/bertos/gui/menu.c index a00d9519..556985f6 100644 --- a/bertos/gui/menu.c +++ b/bertos/gui/menu.c @@ -26,14 +26,12 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/) - * Copyright 2000 Bernardo Innocenti + * Copyright 2003, 2004, 2006, 2010 Develer S.r.l. (http://www.develer.com/) + * Copyright 2000 Bernie Innocenti * * --> * - * \version $Id$ - * - * \author Bernardo Innocenti + * \author Bernie Innocenti * \author Stefano Fedrigo * * \brief General pourpose menu handling functions @@ -41,7 +39,9 @@ #include "menu.h" -#include +#include "cfg/cfg_menu.h" +#include "cfg/cfg_arch.h" + #include #include @@ -57,10 +57,6 @@ #include /* strncpy_P() */ #endif -#if CONFIG_MENU_SMOOTH -#include -#endif - #if (CONFIG_MENU_TIMEOUT != 0) #include #endif @@ -168,9 +164,7 @@ static void menu_defaultRenderHook(struct Bitmap *bm, int ypos, bool selected, c } } -#warning FIXME:REVISE this code! -#if 0 -//#if CPU_HARVARD +#if CPU_HARVARD ((item->flags & MIF_RAMLABEL) ? text_xyprintf : text_xyprintf_P) #else text_xyprintf @@ -198,13 +192,11 @@ static void menu_layout( ypos = bm->cr.ymin; -#if 0 if (redraw) { /* Clear screen */ text_clear(menu->bitmap); } -#endif if (title) { @@ -278,6 +270,9 @@ static void menu_layout( if (!(item->flags & MIF_HIDDEN)) { /* Check if a special render function is supplied, otherwise use defaults */ + #if (ARCH & ARCH_NIGHTTEST) + #warning __FILTER_NEXT_WARNING__ + #endif RenderHook renderhook = (item->flags & MIF_RENDERHOOK) ? (RenderHook)item->label : menu_defaultRenderHook; /* Render menuitem */ @@ -293,7 +288,7 @@ static void menu_layout( /* Clear rest of area */ gfx_rectClear(bm, bm->cr.xmin, ypos, bm->cr.xmax, bm->cr.ymax); - lcd_blitBitmap(&lcd_bitmap); + menu->lcd_blitBitmap(bm); } /* Restore old cliprect */ @@ -440,7 +435,7 @@ iptr_t menu_handle(const struct Menu *menu) items_per_page = - (menu->bitmap->height / menu->bitmap->font->height) + (menu->bitmap->height / menu->bitmap->font->height - 1) #if CONFIG_MENU_MENUBAR - 1 /* menu bar labels */ #endif @@ -540,6 +535,9 @@ iptr_t menu_handle(const struct Menu *menu) /* Store currently selected item before leaving. */ if (menu->flags & MF_SAVESEL) + #if (ARCH & ARCH_NIGHTTEST) + #warning __FILTER_NEXT_WARNING__ + #endif CONST_CAST(struct Menu *, menu)->selected = selected; return result;