Rev 5417 | Rev 5435 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5417 | Rev 5428 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //Leency 2008-2013 |
1 | //Leency 2008-2015 |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | #define EDITOR_PATH "/sys/tinypad" |
- | |
4 | #define BROWSER_PATH "/sys/htmlv" |
- | |
Line 5... | Line 3... | ||
5 | #define BROWSER_LINK "http://kolibri-n.org/index.php" |
3 | #define EDITOR_PATH "/sys/tinypad" |
6 | 4 | ||
7 | #ifdef LANG_RUS |
5 | #ifdef LANG_RUS |
8 | ?define TITLE_SETT " áâனª¨" |
- | |
9 | ?define SET_1 "®ª §ë¢ âì ¨¬¥ ãáâனáâ¢" |
- | |
10 | ?define SET_2 "¥ «ìë¥ ¨¬¥ " |
- | |
11 | ?define SET_3 "ëá®â ¢ë¤¥«¥¨ï" |
- | |
12 | ?define CANCEL_T "⬥ " |
- | |
13 | ?define APPLY_T "ਬ¥¨âì" |
- | |
14 | #elif LANG_EST |
6 | ?define TITLE_SETT " áâனª¨" |
15 | ?define TITLE_SETT " áâனª¨" |
- | |
16 | ?define SET_1 "®ª §ë¢ âì ¨¬¥ ãáâனáâ¢" |
7 | ?define SET_1 "뢮¤¨âì §¢ ¨ï ª« áá ãáâனáâ¢" |
17 | ?define SET_2 "¥ «ìë¥ ¨¬¥ " |
8 | ?define SET_2 "®ª §ë¢ âì ¨¬¥ ä ©«®¢ ¥ ¬¥ïï ॣ¨áâà" |
18 | ?define SET_3 "ëá®â ¢ë¤¥«¥¨ï" |
9 | ?define SET_3 "ëá®â áâப¨ ¢ ᯨ᪥" |
19 | ?define CANCEL_T "⬥ " |
10 | ?define CANCEL_T "⬥ " |
20 | ?define APPLY_T "ਬ¥¨âì" |
11 | ?define APPLY_T "ਬ¥¨âì" |
21 | #else |
12 | #else |
22 | ?define TITLE_SETT " áâனª¨" |
13 | ?define TITLE_SETT "Settings" |
23 | ?define SET_1 "®ª §ë¢ âì ¨¬¥ ãáâனáâ¢" |
14 | ?define SET_1 "Show device class name" |
24 | ?define SET_2 "¥ «ìë¥ ¨¬¥ " |
15 | ?define SET_2 "Show real file names without changing case" |
25 | ?define SET_3 "ëá®â ¢ë¤¥«¥¨ï" |
16 | ?define SET_3 "List line height" |
26 | ?define CANCEL_T "⬥ " |
17 | ?define CANCEL_T "Cancel" |
Line 27... | Line 18... | ||
27 | ?define APPLY_T "ਬ¥¨âì" |
18 | ?define APPLY_T "Apply" |
28 | #endif |
19 | #endif |
29 | 20 | ||
30 | int mouse_ddd; |
21 | int mouse_ddd; |
31 | char lineh_s[30]="18\0"; |
22 | char lineh_s[30]="18\0"; |
Line 32... | Line 23... | ||
32 | edit_box LineHeight_ed = {50,10,70,0xffffff,0x94AECE,0x000000,0x000000,2,4,#lineh_s,#mouse_ddd, 1000000000000010b,2,2}; |
23 | edit_box LineHeight_ed = {50,10,70,0xffffff,0x94AECE,0x9098B0,0x9098B0,2,4,#lineh_s,#mouse_ddd, 1000000000000010b,2,2}; |
33 | checkbox2 ShowDeviceName_chb = {10*65536+15, 10*65536+15, 5, 0xffffff, 0x000000, 0x80000000, SET_1, 110b}; |
24 | checkbox2 ShowDeviceName_chb = {10*65536+15, 10*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_1, 110b}; |
34 | checkbox2 RealFileNamesCase_chb = {10*65536+15, 30*65536+15, 5, 0xffffff, 0x000000, 0x80000000, SET_2, 100b}; |
25 | checkbox2 RealFileNamesCase_chb = {10*65536+15, 30*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_2, 100b}; |
35 | 26 | ||
36 | void settings_dialog() |
27 | void settings_dialog() |
37 | { |
28 | { |
38 | byte id; |
29 | byte id; |
39 | unsigned int key; |
30 | unsigned int key; |
40 | dword eolite_ini_path = abspath("Eolite.ini"); |
31 | dword eolite_ini_path = abspath("Eolite.ini"); |
41 | IF (active_about) ExitProcess(); |
32 | if (active_about) ExitProcess(); |
42 | active_about=1; |
33 | active_about=1; |
43 | SetEventMask(0x27); |
34 | SetEventMask(0x27); |
44 | loop() switch(WaitEvent()) |
35 | loop() switch(WaitEvent()) |
45 | { |
36 | { |
46 | case evButton: |
37 | case evButton: |
47 | id=GetButtonID(); |
38 | id=GetButtonID(); |
48 | if (id==10) |
39 | if (id==10) |
49 | { |
40 | { |
50 | IF ( asm test ShowDeviceName_chb.flags, 2) ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1); |
41 | if ( asm test ShowDeviceName_chb.flags, 2) ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1); |
51 | ELSE ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 0); |
42 | ELSE ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 0); |
- | 43 | if ( asm test RealFileNamesCase_chb.flags, 2) ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 1); |
|
52 | IF ( asm test RealFileNamesCase_chb.flags, 2) ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 1); |
44 | ELSE ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0); |
53 | ELSE ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0); |
45 | if (LineHeight_ed.size) ini_set_int stdcall (eolite_ini_path, "Config", "LineHeight", atoi(#lineh_s)); |
54 | IF (LineHeight_ed.size) ini_set_int stdcall (eolite_ini_path, "Config", "LineHeight", atoi(#lineh_s)); |
46 | active_about=0; |
55 | active_about=0; |
47 | action_buf = 300; |
56 | ExitProcess(); |
48 | ExitProcess(); |
57 | } |
49 | } |
58 | IF (id==1) || (id==11) |
50 | if (id==1) || (id==11) |
59 | { |
- | |
60 | active_about=0; |
51 | { |
Line 61... | Line 52... | ||
61 | ExitProcess(); |
52 | active_about=0; |
62 | } |
53 | ExitProcess(); |
63 | IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK); |
54 | } |
64 | break; |
55 | break; |
65 | 56 | ||
- | 57 | case evKey: |
|
66 | case evKey: |
58 | key = GetKey(); |
67 | key = GetKey(); |
59 | if (key==27) |
68 | IF (key==27) |
60 | { |
69 | { |
61 | active_about=0; |
70 | active_about=0; |
62 | action_buf = 300; |
Line 79... | Line 71... | ||
79 | check_box_mouse stdcall (#RealFileNamesCase_chb); |
71 | check_box_mouse stdcall (#RealFileNamesCase_chb); |
80 | edit_box_mouse stdcall (#LineHeight_ed); |
72 | edit_box_mouse stdcall (#LineHeight_ed); |
81 | break; |
73 | break; |
Line 82... | Line 74... | ||
82 | 74 | ||
83 | case evReDraw: |
75 | case evReDraw: |
Line 84... | Line 76... | ||
84 | DefineAndDrawWindow(600,150,281,228+GetSkinHeight(),0x34,sc.work,TITLE_SETT); |
76 | DefineAndDrawWindow(Form.left + 100, 150, 300, 200+GetSkinHeight(),0x34,sc.work,TITLE_SETT); |
85 | 77 | ||
Line 86... | Line 78... | ||
86 | IF (show_dev_name) ShowDeviceName_chb.flags = 110b; |
78 | if (show_dev_name) ShowDeviceName_chb.flags = 110b; |
87 | ELSE ShowDeviceName_chb.flags = 100b; |
79 | ELSE ShowDeviceName_chb.flags = 100b; |
Line 88... | Line 80... | ||
88 | 80 | ||
89 | IF (real_files_names_case) RealFileNamesCase_chb.flags = 110b; |
81 | if (real_files_names_case) RealFileNamesCase_chb.flags = 110b; |
Line 90... | Line 82... | ||
90 | ELSE RealFileNamesCase_chb.flags = 100b; |
82 | ELSE RealFileNamesCase_chb.flags = 100b; |
91 | 83 | ||
92 | key = itoa(files.line_h); |
84 | key = itoa(files.line_h); |
93 | strcpy(#lineh_s, key); |
85 | strcpy(#lineh_s, key); |
94 | 86 | ||
95 | check_box_draw stdcall (#ShowDeviceName_chb); |
87 | check_box_draw stdcall (#ShowDeviceName_chb); |
- | 88 | check_box_draw stdcall (#RealFileNamesCase_chb); |
|
96 | check_box_draw stdcall (#RealFileNamesCase_chb); |
89 | edit_box_draw stdcall (#LineHeight_ed); |
- | 90 | WriteText(10, 55, 0x80, 0x000000, SET_3); |
|
- | 91 | DrawFlatButton(128,160,70,22,10,0xE4DFE1, APPLY_T); |
|
- | 92 | DrawFlatButton(208,160,70,22,11,0xE4DFE1, CANCEL_T); |
|
- | 93 | } |
|
- | 94 | } |
|
- | 95 | ||
- | 96 | ||
- | 97 | void GetIni() |
|
- | 98 | { |
|
- | 99 | dword eolite_ini_path = abspath("Eolite.ini"); |
|
- | 100 | ini_get_color stdcall (eolite_ini_path, "Config", "SelectionColor", 0x94AECE); |
|
- | 101 | edit2.shift_color = EAX; |
|
- | 102 | col_selec = EAX; |
|
- | 103 | ini_get_int stdcall (eolite_ini_path, "Config", "LineHeight", 18); |
|
- | 104 | files.line_h = EAX; |
|
- | 105 | ini_get_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1); |
|
- | 106 | show_dev_name = EAX; |
|
- | 107 | ini_get_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0); |
|
- | 108 | real_files_names_case = EAX; |
|
- | 109 | } |
|
- | 110 | ||
- | 111 | ||
- | 112 | void Write_Error(int error_number) |
|
- | 113 | { |
|
- | 114 | char error_message[500]; |
|
- | 115 | dword ii; |
|
- | 116 | if (files.current>=0) Line_ReDraw(0xFF0000, files.current); |
|
- | 117 | pause(5); |
|
- | 118 | strcpy(#error_message, "\"Eolite\n"); |
|
- | 119 | ii = get_error(error_number); |
|
- | 120 | strcat(#error_message, ii); |
|
- | 121 | strcat(#error_message, "\" -tE"); |
|
- | 122 | notify(#error_message); |
|
- | 123 | } |
|
- | 124 | ||
- | 125 | ||
- | 126 | void SetAppColors() |
|
- | 127 | { |
|
- | 128 | sc.work = 0xE4DFE1; |
|
- | 129 | sc.work_text = 0; |
|
- | 130 | sc.work_graph = 0x9098B0; //A0A0B8; //0x819FC5; |
|
- | 131 | sc.work_button_text = 0x000000; |
|
- | 132 | col_padding = 0xC8C9C9; |
|
- | 133 | //col_selec = 0x94AECE; |
|
- | 134 | col_lpanel = 0x00699C; |
|
- | 135 | /* |
|
- | 136 | sc.get(); |
|
97 | edit_box_draw stdcall (#LineHeight_ed); |
137 | for (i=0; i<=14; i++) col_palette[i] = sc.work; |
98 | WriteText(10, 55, 0x80, 0x000000, SET_3); |
138 | toolbar_pal[0]= goto_about_pal[0] = sc.work = sc.work; |