#define MAX_LINE_CHARS 128 #define CHBOX 12 #define CHECKBOX_ID 50 unsigned char checkbox[sizeof(file "img/checkbox.raw")]= FROM "img/checkbox.raw"; #define COL_BG_ACTIVE 0xFFF0A9 #define COL_BG_INACTIVE 0xFFFFFF //===================================================// // // // LINE // // // //===================================================// struct NOTE_LINE { bool state; char data[MAX_LINE_CHARS]; void Delete(); }; void NOTE_LINE::Delete() { state=false; data[0]=' '; data[1]=NULL; } //===================================================// // // // LIST // // // //===================================================// struct NOTES : llist { char txt_path[4096]; char txt_data[MAX_LINE_CHARS+4*LINES_COUNT+30]; bool txt_file_exists; NOTE_LINE lines[LINES_COUNT]; char edit_active; int OpenTxt(); int SaveTxt(); void DrawList(); dword DrawLine(int line_n, draw_h); } notes; int NOTES::OpenTxt(dword file_path) { int i=0, linepos=0; int item_n=-1; count = LINES_COUNT; strcpy(#txt_path, file_path); ReadFile(0, 4096, #txt_data, #txt_path); if (!txt_data) || (strncmp(#txt_data, "notes", 5)!=0) { txt_file_exists = false; return 0; } else { txt_file_exists = true; i+=5; //skip "notes" indefinier while (txt_data[i]) { if (txt_data[i]=='\n') { item_n++; i+=2; if (txt_data[i]=='-') lines[item_n].state=false; else lines[item_n].state=true; i+=2; linepos = 0; continue; } if (linepos