Rev 8354 | Rev 8425 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8354 | Rev 8413 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define MEMSIZE 1024 * 100 |
1 | #define MEMSIZE 1024 * 40 |
2 | //Copyright 2020 by Leency |
2 | //Copyright 2020 by Leency |
3 | #include "../lib/gui.h" |
3 | #include "../lib/gui.h" |
4 | #include "../lib/random.h" |
4 | #include "../lib/random.h" |
5 | #include "../lib/obj/box_lib.h" |
5 | #include "../lib/obj/box_lib.h" |
6 | #include "../lib/obj/http.h" |
6 | #include "../lib/obj/http.h" |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | #include "const.h" |
8 | #include "const.h" |
- | 9 | ||
Line 9... | Line 10... | ||
9 | 10 | bool exit_param = false; |
|
Line 10... | Line 11... | ||
10 | bool exit_param = false; |
11 | bool open_file = false; |
Line 29... | Line 30... | ||
29 | 30 | ||
30 | if (!dir_exists(#save_dir)) CreateDir(#save_dir); |
31 | if (!dir_exists(#save_dir)) CreateDir(#save_dir); |
Line 31... | Line 32... | ||
31 | SetCurDir(#save_dir); |
32 | SetCurDir(#save_dir); |
32 | 33 | ||
33 | if (param) { |
34 | if (param) { |
34 | if (!strncmp(#param, "-exit ", 6)) { |
35 | if (streqrp(#param, "-e ")) { |
- | 36 | exit_param = true; |
|
- | 37 | param += 3; |
|
- | 38 | } |
|
- | 39 | if (streqrp(#param, "-eo ")) { |
|
- | 40 | exit_param = true; |
|
35 | exit_param = true; |
41 | open_file = true; |
Line 36... | Line 42... | ||
36 | param += 6; |
42 | param += 4; |
37 | } |
43 | } |
38 | 44 | ||
Line 50... | Line 56... | ||
50 | @SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK); |
56 | @SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK); |
51 | @SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP); |
57 | @SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP); |
52 | loop() switch(@WaitEvent()) |
58 | loop() switch(@WaitEvent()) |
53 | { |
59 | { |
54 | case evMouse: edit_box_mouse stdcall (#ed); break; |
60 | case evMouse: edit_box_mouse stdcall (#ed); break; |
55 | case evButton: ProcessButtonClick(); break; |
61 | case evButton: ProcessButtonClick(@GetButtonID()); break; |
56 | case evKey: ProcessKeyPress(); break; |
62 | case evKey: ProcessKeyPress(); break; |
57 | case evReDraw: DrawWindow(); break; |
63 | case evReDraw: DrawWindow(); break; |
58 | default: MonitorProgress(); |
64 | default: MonitorProgress(); |
59 | } |
65 | } |
60 | } |
66 | } |
Line 61... | Line 67... | ||
61 | 67 | ||
62 | void ProcessButtonClick() |
68 | void ProcessButtonClick(int id) |
63 | { |
- | |
64 | int id = @GetButtonID(); |
69 | { |
65 | autoclose.click(id); |
70 | autoclose.click(id); |
66 | if (id==BTN_EXIT) { StopDownloading(); ExitProcess(); } |
71 | if (id==BTN_EXIT) { StopDownloading(); ExitProcess(); } |
67 | if (id==BTN_START) StartDownloading(); |
72 | if (id==BTN_START) StartDownloading(); |
68 | if (id==BTN_STOP) StopDownloading(); |
73 | if (id==BTN_STOP) StopDownloading(); |
Line 215... | Line 220... | ||
215 | } else { |
220 | } else { |
216 | miniprintf(#notify_message, FILE_NOT_SAVED, #filepath); |
221 | miniprintf(#notify_message, FILE_NOT_SAVED, #filepath); |
217 | } |
222 | } |
Line 218... | Line 223... | ||
218 | 223 | ||
- | 224 | if (!exit_param) notify(#notify_message); |
|
219 | if (!exit_param) notify(#notify_message); |
225 | if (open_file) ProcessButtonClick(BTN_RUN); |
220 | if (autoclose.checked) ExitProcess(); |
226 | if (autoclose.checked) ExitProcess(); |
Line 221... | Line 227... | ||
221 | } |
227 | } |