sl-ru / makisegui Goto Github PK
View Code? Open in Web Editor NEWGraphics and GUI library for embed systems.
License: MIT License
Graphics and GUI library for embed systems.
License: MIT License
Used for SSD1306 OLED.
Сейчас он не соответствует действительности и его нереально использовать. В дополнении надо добавить const к полям самой структуры шрифта.
Код демонстрации.
``
void gui::gui_demo (void *obj) {
obj = obj;
makise_gui_st7565_driver(&m_gui_driver);
makise_gui_st7565_init(&m_gui);
makise_gui_autoinit(&m_host,
&m_gui,
&m_gui_driver,
makise_gui_get_buffer,
nullptr,
makise_gui_draw,
makise_gui_predraw,
nullptr,
nullptr,
nullptr);
MakiseStyle_SList sl_style = {
.font = &f_minecraft_rus_regular_8,
.font_line_spacing = MC_Black,
.left_margin = 0,
.item_margin = 0,
.scroll_width = 5,
.scroll_bg_color = MC_White,
.scroll_color = MC_Black,
.normal = {
.bg_color = MC_White,
.font_col = MC_Black,
.border_c = MC_Black,
.thickness = 0,
},
.focused = {
.bg_color = MC_White,
.font_col = MC_Black,
.border_c = MC_Black,
.thickness = 0,
},
.active = {
.bg_color = MC_White,
.font_col = MC_Black,
.border_c = MC_Black,
.thickness = 0,
}
};
MakiseStyle_SListItem sl_item_style = {
.font = &f_minecraft_rus_regular_8,
.font_line_spacing = 0,
.text_scroll_speed = 0,
.normal = {
.bg_color = MC_White,
.font_col = MC_Black,
.border_c = MC_Black,
.thickness = 0,
},
.focused = {
.bg_color = MC_White,
.font_col = MC_Black,
.border_c = MC_Black,
.thickness = 0,
},
.active = {
.bg_color = MC_Black,
.font_col = MC_White,
.border_c = MC_Black,
.thickness = 0,
}
};
MSList sl;
static char b1[] = "but_1";
static char b2[] = "but_2";
static char b3[] = "but_3";
static char b4[] = "but_4";
static char sl_string[] = "MakiseGUI_sl";
m_create_slist(&sl, &m_host.host, mp_rel(0, 0, 127, 63), sl_string, nullptr, nullptr, MSList_RadioButton, &sl_style,
&sl_item_style);
MSList_Item sl_items[4];
m_slist_set_array(&sl, sl_items, 4);
sl_items[0].text = b1;
sl_items[1].text = b2;
sl_items[2].text = b3;
sl_items[3].text = b4;
makise_gui_st7565_update_screen(&m_gui);
makise_g_focus(&sl.el, M_G_FOCUS_GET);
while (true) {
makise_gui_input_send_button(&m_host, M_KEY_DOWN, M_INPUT_CLICK, 1);
makise_gui_input_perform(&m_host);
makise_gui_st7565_update_screen(&m_gui);
vTaskDelay(1000);
}
}
``
Много времени потратил на это. Сделай ifndef. Если кто-то захочет иное - пусть пишет. Ну и надо где-то это задокументировать. Хоть небольшой комментарий где-то.
Steins Gate is a commercial project - you are not allowed to use any of their resources (like image) by law in projects like this. Your repo can be blocked!
Please show a document which proves you are allowed to or remove all mentions of Steins Gate's characters!
Просишь void*, а потом кастуешь к uint32_t. Фраза про отдельный котел.
void* (*get_buffer)(uint32_t size);
При 128 на 64 экране эта строка выходит за пределы массива при отрисовке.
Твоя m_create_slist(&sl, &m_host.host, mp_rel(0, 0, 127, 63), sl_string, nullptr, nullptr, MSList_RadioButton, &sl_style,
&sl_item_style);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.