ERIS CORE

◆ render()

void FLASHMEM ControlButton::render ( )
inlineoverrideprotectedvirtual

render loop

Reimplemented from AppBaseClass.

Definition at line 74 of file ControlButton.h.

74  {
75  is_dirty = true;
76 
77  if(is_pressed==false && show_active == true && time_active > SHOW_ACTIVE_TIME_MILLISEC){
78  show_active = false;
79  is_dirty = true;
80  time_active = 0;
81  }
82  if (!is_dirty) return;
83  if(using_image){
84  if(!img_loaded){
85  //allocate space
87  if(!img_cache){
88  Serial.println(F("M ERROR img_cache out of mem"));
89  Serial.flush();
90  delete(img_cache);
91  return;
92  }else{
94  img_loaded = true;
95  return;
96  }
97  } else{
99  }
100  }else{
101  draw->fillRoundRect(x,y,w,h/2+3,3,am->data->read("UI_BUTTON_FILL_COLOR"));
102  draw->fillRoundRect(x,y+h/2,w,h/2,3,am->data->read("UI_BUTTON_SHADE_COLOR"));
103  }
104  if (show_active){
105  draw->drawRoundRect(x,y,w,h,4,am->data->read("UI_BUTTON_ACTIVE_BORDER_COLOR")); //ILI9341_GREENYELLOW
106  } else{
107  draw->drawRoundRect(x,y,w,h,4,am->data->read("UI_BUTTON_INACTIVE_BORDER_COLOR"));//ILI9341_MAGENTA
108  }
109 
110  if(!using_image){
111  draw->setTextColor(am->data->read("UI_BUTTON_TEXT_COLOR"));
112  draw->setCursor(x+(w/2),y+(h/2),true);
113  draw->setFont(Arial_9);
114  draw->print(text);
115  }
116  is_dirty = false;
117  };
const ILI9341_t3_font_t Arial_9
@ BLT_COPY
AppManager * am
Definition: AppBaseClass.h:38
ILI9341_t3_ERIS * draw
Definition: AppBaseClass.h:41
Surface * p_fast_img_cache_surface
Definition: AppManager.h:64
Surface * p_display_surface
Definition: AppManager.h:65
SvcDataDictionary * data
Definition: AppManager.h:63
elapsedMillis time_active
Definition: ControlButton.h:72
char img_filename[MAX_TEXT_LENGTH]
Definition: ControlButton.h:65
char img_path[MAX_TEXT_LENGTH]
Definition: ControlButton.h:66
char text[MAX_TEXT_LENGTH]
Definition: ControlButton.h:60
Surface * img_cache
Definition: ControlButton.h:67
void bltSurface2Surface(Surface *dest, int16_t dest_x, int16_t dest_y, Surface *source, int16_t from_x, int16_t from_y, int16_t from_width, int16_t from_height, bltMode blt_mode)
block transfer from source to dest with the given parameters
void bltSDB(uint16_t *dest_buffer, uint16_t dest_buffer_width, uint16_t dest_buffer_height, const char *path, const char *filename, int16_t x, int16_t y, bltMode blt_mode)
image block transfer from the SD card to a buffer at the given x,y coords
uint16_t getHeight()
uint16_t getWidth()
uint16_t * getSurfaceBufferP()
a Surface object manages a memory block with defined width and height dimensions
int32_t read(const char *key)
returns the int32_t value of the record

References AppBaseClass::am, Arial_9, BLT_COPY, ILI9341_t3_ERIS::bltSDB(), ILI9341_t3_ERIS::bltSurface2Surface(), AppManager::data, AppBaseClass::draw, Surface::getHeight(), Surface::getSurfaceBufferP(), Surface::getWidth(), AppBaseClass::h, img_cache, img_filename, img_loaded, img_path, is_dirty, is_pressed, AppManager::p_display_surface, AppManager::p_fast_img_cache_surface, SvcDataDictionary::read(), AppManager::sd, show_active, text, time_active, using_image, AppBaseClass::w, AppBaseClass::x, and AppBaseClass::y.

+ Here is the call graph for this function: