/programs/cmm/notes/notes |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/img/edge.raw |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/img/checkbox.raw |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/img/edge.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/img/checkbox.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/engine.h |
---|
2,7 → 2,7 |
#define CHBOX 12 |
#define CHECKBOX_ID 50 |
unsigned char checkbox[sizeof(file "img/checkbox.raw")]= FROM "img/checkbox.raw"; |
unsigned char checkbox[sizeof(file "checkbox.raw")]= FROM "checkbox.raw"; |
#define COL_BG_ACTIVE 0xFFF0A9 |
#define COL_BG_INACTIVE 0xFFFFFF |
36,7 → 36,6 |
struct NOTES : llist { |
char txt_path[4096]; |
char txt_data[MAX_LINE_CHARS*LINES_COUNT]; |
bool txt_file_exists; |
NOTE_LINE lines[LINES_COUNT]; |
43,6 → 42,7 |
char edit_active; |
int OpenTxt(); |
int SaveTxt(); |
void DeleteNode(); |
void DrawList(); |
dword DrawLine(int line_n, draw_h); |
} notes; |
57,13 → 57,11 |
ReadFile(0, 4096, #txt_data, #txt_path); |
if (!txt_data) || (strncmp(#txt_data, "notes", 5)!=0) |
{ |
txt_file_exists = false; |
notify("'Notes\nData file does not exists or is not valid' -tE"); |
return 0; |
} |
else |
{ |
txt_file_exists = true; |
i+=5; //skip "notes" indefinier |
while (txt_data[i]) |
{ |
100,7 → 98,6 |
tm = #lines[i].data; |
strcat(#txt_data, #lines[i].data); |
} |
if (!txt_file_exists) CreateFile(0, 0, #txt_path); |
WriteFile(0, strlen(#txt_data), #txt_data, #txt_path); |
} |
/programs/cmm/notes/notes.c |
---|
1,4 → 1,4 |
// Notes v0.9 Beta |
// Notes v0.8 ALPHA |
#define MEMSIZE 0xDAE80 |
#include "..\lib\kolibri.h" |
32,7 → 32,7 |
#define RED_LINE_X 22 |
#define COL_RED_LINE 0xF3C9C9 |
unsigned char edge[sizeof(file "img/edge.raw")]= FROM "img/edge.raw"; //292x6 |
unsigned char edge[sizeof(file "edge.raw")]= FROM "edge.raw"; //292x6 |
#define EDGE_H 6 |
#define TITLE_H 24 |
#define HEADER_HEIGHT TITLE_H+EDGE_H |
47,7 → 47,7 |
#include "engine.h" |
dword ed_mouse; |
edit_box notebox = {NULL,NULL,NULL,COL_BG_ACTIVE,0x94AECE,COL_BG_ACTIVE,0xffffff,0, |
edit_box notebox = {0,999,0,COL_BG_ACTIVE,0x94AECE,COL_BG_ACTIVE,0xffffff,0, |
MAX_LINE_CHARS-1,NULL,#ed_mouse,ed_always_focus+ed_focus}; |
dword lists[] = { 0xEAEAEA, 0xCDCDCD, 0xF0F0F0, 0xD8D8D8, 0 }; |
63,14 → 63,13 |
void main() |
{ |
int btn; |
bool first_redraw=true; |
dword cur_line_offset; |
load_dll(boxlib, #box_lib_init,0); |
if (param) notes.OpenTxt(#param); else notes.OpenTxt(abspath("notes.txt")); |
//notes.cur_y = 0; |
notes.cur_y = -1; |
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
SetEventMask(0x27); |
loop() switch(WaitEvent()) |
{ |
91,7 → 90,6 |
if (mouse.key&MOUSE_LEFT)&&(mouse.up) |
&& (notes.ProcessMouse(mouse.x, mouse.y)) { |
notebox.pos = mouse.x - notebox.left / 6; |
EventListRedraw(); |
EventActivateLine(notes.cur_y); |
} |
109,7 → 107,8 |
EventDeleteCurrentNode(); |
break; |
default: |
EventCheckBoxClick(btn-CHECKBOX_ID); |
notes.lines[btn-CHECKBOX_ID].state ^= 1; |
EventListRedraw(); |
break; |
} |
break; |
116,14 → 115,6 |
case evKey: |
GetKeys(); |
if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) |
{ |
if (key_scancode == SCAN_CODE_SPACE) |
{ |
EventCheckBoxClick(notes.cur_y); |
} |
break; |
} |
switch(key_scancode) |
{ |
case SCAN_CODE_ESC: |
146,12 → 137,8 |
case evReDraw: |
draw_window(); |
if (first_redraw) { |
first_redraw = false; |
EventActivateLine(0); |
} |
} |
} |
void DrawCloseButton(dword x,y,w,h) |
{ |
185,10 → 172,9 |
{ |
notebox.width = notes.w-notes.x-8; |
notebox.left = notes.x+5; |
notebox.offset = notebox.shift = notebox.shift_old = 0; |
notebox.pos = notebox.offset = notebox.shift = notebox.shift_old = 0; |
notebox.cl_curs_x = notebox.cl_curs_y = 0; |
notebox.size = strlen(notebox.text); |
if (notebox.pos > notebox.size) notebox.pos = notebox.size; |
notebox.top = notes.cur_y*notes.item_h+4+notes.y; |
edit_box_draw stdcall(#notebox); |
} |
226,8 → 212,7 |
void EventDeleteCurrentNode() |
{ |
int t = notes.cur_y; |
notes.lines[t].Delete(); |
notes.lines[notes.cur_y].Delete(); |
EventListRedraw(); |
} |
238,10 → 223,4 |
notes.DrawList(); |
} |
void EventCheckBoxClick(int id) |
{ |
notes.lines[id].state ^= 1; |
EventListRedraw(); |
} |
stop: |
/programs/cmm/notes/checkbox.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/checkbox.raw |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/edge.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/cmm/notes/edge.raw |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |