Rev 7230 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7230 | Rev 7286 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define MEMSIZE 4096*25 |
1 | #define MEMSIZE 4096*25 |
Line 2... | Line -... | ||
2 | - | ||
3 | #include "../lib/kfont.h" |
2 | |
4 | #include "../lib/io.h" |
3 | #include "../lib/io.h" |
5 | #include "../lib/gui.h" |
4 | #include "../lib/gui.h" |
6 | #include "../lib/list_box.h" |
5 | #include "../lib/list_box.h" |
- | 6 | #include "../lib/menu.h" |
|
Line 7... | Line 7... | ||
7 | #include "../lib/menu.h" |
7 | #include "../lib/kfont.h" |
8 | 8 | ||
9 | #include "../lib/obj/box_lib.h" |
9 | #include "../lib/obj/box_lib.h" |
10 | #include "../lib/obj/libini.h" |
10 | #include "../lib/obj/libini.h" |
Line 34... | Line 34... | ||
34 | Ctrl+E - edit current document |
34 | Ctrl+E - edit current document |
Line 35... | Line 35... | ||
35 | 35 | ||
Line 36... | Line 36... | ||
36 | Press any key..." |
36 | Press any key..." |
37 | 37 | ||
Line 38... | Line 38... | ||
38 | char default_dir[] = "/rd/1"; |
38 | char default_dir[] = "/rd/1"; |
39 | od_filter filter2 = {0,0}; |
39 | od_filter filter2 = { 8, "TXT\0\0" }; |
Line 40... | Line 40... | ||
40 | 40 | ||
Line 77... | Line 77... | ||
77 | 77 | ||
78 | void main() |
78 | void main() |
79 | { |
79 | { |
80 | InitDlls(); |
80 | InitDlls(); |
- | 81 | OpenDialog_init stdcall (#o_dialog); |
|
81 | OpenDialog_init stdcall (#o_dialog); |
82 | LoadIniSettings(); |
82 | kfont.init(DEFAULT_FONT); |
83 | kfont.init(DEFAULT_FONT); |
83 | Libimg_LoadImage(#skin, abspath("toolbar.png")); |
- | |
84 | LoadIniSettings(); |
84 | Libimg_LoadImage(#skin, abspath("toolbar.png")); |
85 | OpenFile(#param); |
85 | OpenFile(#param); |
86 | list.no_selection = true; |
86 | list.no_selection = true; |
87 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
87 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
88 | loop() |
88 | loop() |
Line 207... | Line 207... | ||
207 | /* ----------------------------------------------------- */ |
207 | /* ----------------------------------------------------- */ |
Line 208... | Line 208... | ||
208 | 208 | ||
209 | void EventOpenFile() |
209 | void EventOpenFile() |
210 | { |
210 | { |
- | 211 | OpenDialog_start stdcall (#o_dialog); |
|
211 | OpenDialog_start stdcall (#o_dialog); |
212 | if (o_dialog.status) { |
212 | OpenFile(#openfile_path); |
213 | OpenFile(#openfile_path); |
213 | PreparePage(); |
214 | PreparePage(); |
- | 215 | } |
|
Line 214... | Line 216... | ||
214 | } |
216 | } |
215 | 217 | ||
216 | void EventShowFileProperties() |
218 | void EventShowFileProperties() |
217 | { |
219 | { |
Line 321... | Line 323... | ||
321 | void DrawPage() |
323 | void DrawPage() |
322 | { |
324 | { |
323 | kfont.ShowBufferPart(list.x, list.y, list.w, list.h, list.first*list.item_h*list.w); |
325 | kfont.ShowBufferPart(list.x, list.y, list.w, list.h, list.first*list.item_h*list.w); |
324 | DrawScroller(); |
326 | DrawScroller(); |
325 | }>> |
327 | } |
326 | 328 | ||
- | 329 | void DrawToolbarButton(char image_id, int x) |
|
- | 330 | { |
|
- | 331 | DefineButton(x+1, 6, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0); |
|
- | 332 | img_draw stdcall(skin.image, x, 5, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT); |
|
- | 333 | } |
|
- | 334 | ||
- | 335 | void DrawScroller() |
|
- | 336 | { |
|
- | 337 | scroll.max_area = list.count; |
|
- | 338 | scroll.cur_area = list.visible; |
|
- | 339 | scroll.position = list.first; |
|
- | 340 | scroll.all_redraw = 0; |
|
- | 341 | scroll.start_x = list.x + list.w; |
|
- | 342 | scroll.start_y = list.y; |
|
- | 343 | scroll.size_y = list.h; |
|
- | 344 | scrollbar_v_draw(#scroll); |
|
- | 345 | }>> |
|
- | 346 | ||
327 | 347 |