esp32 firmware for a toaster reflow oven WIP!!!!!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
reflower/main/scenes/scene_popup_menu.c

36 lines
998 B

#include <malloc.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <common_utils/utils.h>
#include "analog.h"
#include "firehazard.h"
#include "graphics/bitmaps.h"
#include "liquid.h"
#include "graphics/drawing.h"
#include "graphics/display_spec.h"
#include "scenes.h"
#include "scene_menu.h"
static void paint(struct MenuScene *self)
{
LCD_setShadeOverlay();
// frame around the menu items
LCD_setRect(self->x - 3, self->y - 3, self->x + self->ncols*6 + 3, self->y + self->nlines * 9 + 2, true, WHITE);
LCD_setRect(self->x - 2, self->y - 2, self->x + self->ncols*6 + 2, self->y + self->nlines * 9 + 1, false, BLACK);
MenuScene_Paint(self);
}
struct MenuScene *NewScene_PopupMenu(struct MenuItem *items, size_t items_len)
{
struct MenuScene * scene = NewScene_Menu(items, items_len);
scene->x = 12;
scene->y = 6;
scene->ncols = 10;
scene->nlines = MIN(items_len, 4);
scene->base.paint = (Scene_paint_t) paint;
return scene;
}