1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/shentqlf-eBox_Framework

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
gui_page.cpp 2 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
eboxmaker Отправлено 4 лет назад 53a133b
#include "gui_page.h"
#include "bsp_ebox.h"
void GuiPage::Register(ActivityComponent *object)
{
activityList.add(object);
}
void GuiPage::Register(Component *object)
{
componentList.add(object);
}
void GuiPage::create()
{
UART.printf(":%s",name.c_str());
_gpu->fill_rect(x,y, x + len - 1, y+ hight - 1,_gpu->back_color);
Component *p;
for(int i = 0; i < componentList.size(); i++)
{
componentList[i]->create();
}
for(int i = 0; i < activityList.size(); i++)
{
activityList[i]->create();
}
index_set(0);
if(outline == GuiOutlineMode::Surround)
_gpu->draw_rect(x,y, x + len - 1, y+ hight - 1);
}
void GuiPage::show()
{
UART.printf("ʾ:%s",name.c_str());
Component *p;
for(int i = 0; i < componentList.size(); i++)
{
componentList[i]->show();
}
for(int i = 0; i < activityList.size(); i++)
{
activityList[i]->show();
}
update_index();
}
void GuiPage::hide()
{
_gpu->fill_rect(x,y, x + len - 1, y+ hight - 1,_gpu->back_color);
UART.printf("أ%s\r\n",name.c_str());
}
void GuiPage::cancel()
{
activityList.clear();
componentList.clear();
index = 0;
_gpu->clear();
UART.printf("ע%s\r\n",name.c_str());
}
int16_t GuiPage::index_get()
{
return index;
}
void GuiPage::index_set(int16_t value)
{
index = value;
update_index();
}
bool GuiPage::index_next()
{
if(index < activityList.size() - 1)
{
index++;
update_index();
return true;
}
return false;
}
bool GuiPage::index_previous()
{
if(index > 0)
{
index--;
update_index();
return true;
}
return false;
}
void GuiPage::loop()
{
}
ActivityComponent * GuiPage::get_selected_object()
{
return activityList[index];
}
void GuiPage::update_index()
{
if(activityList.size() == 0)
return;
activityList[last_index]->set_select(false);
activityList[index]->set_select(true);
last_index = index;
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/shentqlf-eBox_Framework.git
git@gitlife.ru:oschina-mirror/shentqlf-eBox_Framework.git
oschina-mirror
shentqlf-eBox_Framework
shentqlf-eBox_Framework
master