MCPcopy Create free account
hub / github.com/El-EnderJ/NeoCalculator / createScriptsPanel

Method createScriptsPanel

src/apps/PythonApp.cpp:202–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void PythonApp::createScriptsPanel() {
203 int contentH = CONTENT_H - BTN_BAR_H;
204 _panelScripts = makePanel(_screen, 0, CONTENT_Y, SCREEN_W, contentH, COL_BG, true);
205 lv_obj_set_scroll_dir(_panelScripts, LV_DIR_VER);
206
207 // Script rows will be created dynamically in refreshScriptList()
208 loadScriptsList();
209 refreshScriptList();
210
211 // Bottom button bar
212 _btnBarScripts = makePanel(_screen, 0, SCREEN_H - BTN_BAR_H, SCREEN_W, BTN_BAR_H, 0xEEEEEE);
213
214 int bw = (SCREEN_W - 4 * 6) / 3; // 3 buttons with padding
215 _btnNew = makePanel(_btnBarScripts, 6, 3, bw, BTN_BAR_H - 6, COL_BTN_BG);
216 lv_obj_set_style_radius(_btnNew, 4, LV_PART_MAIN);
217 makeLabel(_btnNew, bw / 2 - 12, (BTN_BAR_H - 6 - 12) / 2, "New", COL_BTN_TXT, &stix_math_18);
218
219 _btnRun = makePanel(_btnBarScripts, 6 + bw + 6, 3, bw, BTN_BAR_H - 6, COL_BTN_BG);
220 lv_obj_set_style_radius(_btnRun, 4, LV_PART_MAIN);
221 makeLabel(_btnRun, bw / 2 - 12, (BTN_BAR_H - 6 - 12) / 2, "Run", COL_BTN_TXT, &stix_math_18);
222
223 _btnDelete = makePanel(_btnBarScripts, 6 + (bw + 6) * 2, 3, bw, BTN_BAR_H - 6, 0xCC3333);
224 lv_obj_set_style_radius(_btnDelete, 4, LV_PART_MAIN);
225 makeLabel(_btnDelete, bw / 2 - 18, (BTN_BAR_H - 6 - 12) / 2, "Delete", COL_BTN_TXT, &stix_math_18);
226
227 _btnIdx = 0;
228 _btnFocus = false;
229 refreshBtnBar();
230}
231
232void PythonApp::createEditorPanel() {
233 _panelEditor = makePanel(_screen, 0, CONTENT_Y, SCREEN_W, CONTENT_H, COL_EDITOR_BG);

Callers

nothing calls this directly

Calls 2

makePanelFunction · 0.70
makeLabelFunction · 0.70

Tested by

no test coverage detected