Rev 7434 | Rev 7444 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7434 | Rev 7437 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | // Notes v0.9 Beta |
1 | // Notes v1.0 |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | #define MEMSIZE 0xDAE80 |
3 | #define MEMSIZE 0xDAE80 |
4 | #include "..\lib\kolibri.h" |
- | |
5 | #include "..\lib\mem.h" |
- | |
6 | #include "..\lib\strings.h" |
- | |
7 | #include "..\lib\fs.h" |
- | |
Line 8... | Line 4... | ||
8 | #include "..\lib\dll.h" |
4 | #include "..\lib\kolibri.h" |
9 | 5 | ||
10 | #include "..\lib\obj\box_lib.h" |
- | |
11 | #include "..\lib\gui.h" |
6 | #include "..\lib\obj\box_lib.h" |
Line 12... | Line 7... | ||
12 | #include "..\lib\encoding.h" |
7 | #include "..\lib\gui.h" |
13 | #include "..\lib\list_box.h" |
8 | #include "..\lib\list_box.h" |
14 | 9 | ||
Line 66... | Line 61... | ||
66 | bool first_redraw=true; |
61 | bool first_redraw=true; |
67 | dword cur_line_offset; |
62 | dword cur_line_offset; |
68 | load_dll(boxlib, #box_lib_init,0); |
63 | load_dll(boxlib, #box_lib_init,0); |
Line 69... | Line 64... | ||
69 | 64 | ||
70 | if (param) notes.OpenTxt(#param); else notes.OpenTxt(abspath("notes.txt")); |
- | |
Line 71... | Line 65... | ||
71 | //notes.cur_y = 0; |
65 | if (param) notes.OpenTxt(#param); else notes.OpenTxt(abspath("notes.txt")); |
Line 72... | Line 66... | ||
72 | 66 | ||
73 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
67 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
Line 171... | Line 165... | ||
171 | DrawRectangle3D(1,1,WIN_W-2,TITLE_H-3,0xEFBFA4, 0xDD8452); |
165 | DrawRectangle3D(1,1,WIN_W-2,TITLE_H-3,0xEFBFA4, 0xDD8452); |
172 | DrawBar(2,2,WIN_W-3,TITLE_H-4,0xE08C5E); |
166 | DrawBar(2,2,WIN_W-3,TITLE_H-4,0xE08C5E); |
173 | WriteText(9,TITLE_H/2-6,0x90,0xA9613A,WINDOW_CAPTION); |
167 | WriteText(9,TITLE_H/2-6,0x90,0xA9613A,WINDOW_CAPTION); |
174 | WriteTextB(7,TITLE_H/2-7,0x90,0xFFFfff,WINDOW_CAPTION); |
168 | WriteTextB(7,TITLE_H/2-7,0x90,0xFFFfff,WINDOW_CAPTION); |
175 | _PutImage(1, TITLE_H, 292,EDGE_H, #edge); |
169 | _PutImage(1, TITLE_H, 292,EDGE_H, #edge); |
176 | PutPixel(notes.x+RED_LINE_X, notes.y-1, COL_RED_LINE); |
170 | PutPixel(notes.x, notes.y-1, COL_RED_LINE); |
177 | ECX-=1; $int 0x40; |
171 | ECX-=1; $int 0x40; |
178 | DrawCloseButton(WIN_W-23,4,16,16); |
172 | DrawCloseButton(WIN_W-23,4,16,16); |
179 | DrawRectangle(0,TITLE_H,WIN_W,WIN_H-HEADER_HEIGHT+EDGE_H,0xBBBBBB); |
173 | DrawRectangle(0,TITLE_H,WIN_W,WIN_H-HEADER_HEIGHT+EDGE_H,0xBBBBBB); |
180 | for (i=0; lists[i]!=0; i++) DrawBar(1,WIN_H-i-1, WIN_W-1, 1, lists[i]); |
174 | for (i=0; lists[i]!=0; i++) DrawBar(1,WIN_H-i-1, WIN_W-1, 1, lists[i]); |
181 | EventListRedraw(); |
175 | EventListRedraw(); |
Line 186... | Line 180... | ||
186 | notebox.width = notes.w-notes.x-8; |
180 | notebox.width = notes.w-notes.x-8; |
187 | notebox.left = notes.x+5; |
181 | notebox.left = notes.x+5; |
188 | notebox.offset = notebox.shift = notebox.shift_old = 0; |
182 | notebox.offset = notebox.shift = notebox.shift_old = 0; |
189 | notebox.cl_curs_x = notebox.cl_curs_y = 0; |
183 | notebox.cl_curs_x = notebox.cl_curs_y = 0; |
190 | notebox.size = strlen(notebox.text); |
184 | notebox.size = strlen(notebox.text); |
- | 185 | notebox.flags = ed_always_focus+ed_focus; |
|
191 | if (notebox.pos > notebox.size) notebox.pos = notebox.size; |
186 | if (notebox.pos > notebox.size) notebox.pos = notebox.size; |
192 | notebox.top = notes.cur_y*notes.item_h+4+notes.y; |
187 | notebox.top = notes.cur_y*notes.item_h+4+notes.y; |
193 | edit_box_draw stdcall(#notebox); |
188 | edit_box_draw stdcall(#notebox); |
194 | } |
189 | } |