Rev 6640 | Rev 7252 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6640 | Rev 6678 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | 4 | ||
5 | #include "..\lib\gui.h" |
5 | #include "..\lib\gui.h" |
Line 6... | Line 6... | ||
6 | #include "..\lib\obj\box_lib.h" |
6 | #include "..\lib\obj\box_lib.h" |
7 | - | ||
8 | #ifdef LANG_RUS |
7 | |
9 | unsigned char *but_text[]={ |
8 | #ifdef LANG_RUS |
10 | "®¡ ¢¨âì ¤¨áª [Ins]", |
- | |
11 | "¤ «¨âì ¤¨áª [Del]", |
- | |
12 | "®¡ ¢¨âì [Ctrl+Enter]", |
- | |
13 | 0}; |
9 | ?define T_ADD_DISK " ®¡ ¢¨âì ¤¨áª [Ins]" |
14 | 10 | ?define T_DELETE_DISK " ¤ «¨âì ¤¨áª [Del]" |
|
15 | ?define INTRO_TEXT_1 "¤¥áì ¡ã¤¥â ®â®¡à ¦ âìáï ᯨ᮪" |
11 | ?define INTRO_TEXT_1 "¤¥áì ¡ã¤¥â ®â®¡à ¦ âìáï ᯨ᮪" |
16 | ?define INTRO_TEXT_2 "¢¨àâã «ìëå ¤¨áª®¢ ¢ á¨á⥬¥." |
12 | ?define INTRO_TEXT_2 "¢¨àâã «ìëå ¤¨áª®¢ ¢ á¨á⥬¥." |
17 | ?define INTRO_TEXT_3 "®¯à®¡ã©â¥ ¤®¡ ¢¨âì ®¤¨..." |
13 | ?define INTRO_TEXT_3 "®¯à®¡ã©â¥ ¤®¡ ¢¨âì ®¤¨..." |
18 | ?define SIZE_TEXT " §¬¥à:" |
14 | ?define SIZE_TEXT " §¬¥à:" |
19 | ?define NOTIFY_TEXT_NO_DISK "'«ï ç « ¤®¡ ¢ì⥠å®âï ¡ë ®¤¨ ¤¨áª' -W" |
15 | ?define NOTIFY_TEXT_NO_DISK "'«ï ç « ¤®¡ ¢ì⥠å®âï ¡ë ®¤¨ ¤¨áª' -W" |
Line 20... | Line 16... | ||
20 | ?define NOTIFY_TEXT_DISK_LIMIT "'®á⨣ã⠯।¥« ª®«¨ç¥á⢠¢¨àâã «ìëå ¤¨áª®¢' -W" |
16 | ?define NOTIFY_TEXT_DISK_LIMIT "'®á⨣ã⠯।¥« ª®«¨ç¥á⢠¢¨àâã «ìëå ¤¨áª®¢' -W" |
21 | ?define FREE_RAM_TEXT " §¬¥à ᢮¡®¤®© ®¯¥à ⨢®© ¯ ¬ïâ¨: " |
- | |
22 | 17 | ?define FREE_RAM_TEXT " §¬¥à ᢮¡®¤®© ®¯¥à ⨢®© ¯ ¬ïâ¨: " |
|
23 | #else |
18 | |
24 | unsigned char *but_text[]={ |
- | |
25 | "Add disk [Ins]", |
- | |
26 | "Delete disk [Del]", |
- | |
27 | "Add [Ctrl+Enter]", |
19 | #else |
28 | 0}; |
20 | ?define T_ADD_DISK " Add disk [Ins]" |
29 | 21 | ?define T_DELETE_DISK " Delete disk [Del]" |
|
30 | ?define INTRO_TEXT_1 " There will be list of mounted" |
22 | ?define INTRO_TEXT_1 " There will be list of mounted" |
31 | ?define INTRO_TEXT_2 " virtual disks." |
23 | ?define INTRO_TEXT_2 " virtual disks." |
Line 44... | Line 36... | ||
44 | char selected; |
36 | char selected; |
Line 45... | Line 37... | ||
45 | 37 | ||
Line 46... | Line 38... | ||
46 | proc_info Form; |
38 | proc_info Form; |
47 | 39 | ||
48 | unsigned char icons[] = FROM "icons.raw"; |
40 | unsigned char icons[] = FROM "icons.raw"; |
Line 49... | Line 41... | ||
49 | #define TOPPANELH 54 |
41 | #define TOPPANELH 68 |
50 | #define BOTPANELH 20 |
42 | #define BOTPANELH 26 |
51 | 43 | ||
Line 52... | Line 44... | ||
52 | int mouse_dd; |
44 | int mouse_dd; |
53 | char new_disk_size[5]; |
45 | char new_disk_size[5]; |
54 | edit_box edit_disk_size= {50,0,7,0xffffff,0x94AECE,0xFFFfff,0xffffff,0,4,#new_disk_size,#mouse_dd, 1000000000000010b}; |
46 | edit_box edit_disk_size= {50,0,7,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,4,#new_disk_size,#mouse_dd, 1000000000000010b}; |
55 | 47 | ||
Line 56... | Line -... | ||
56 | void Main_Window() |
- | |
57 | { |
48 | void Main_Window() |
58 | word id; |
49 | { |
59 | int i, x; |
50 | word id; |
60 | 51 | int x; |
|
61 | mem_Init(); |
52 | |
Line 142... | Line 133... | ||
142 | break; |
133 | break; |
143 | } |
134 | } |
144 | break; |
135 | break; |
145 | case evReDraw: |
136 | case evReDraw: |
146 | system.color.get(); |
137 | system.color.get(); |
147 | DefineAndDrawWindow(170,150,314,270,0x74,system.color.work,"Virtual Disk Manager 0.65",0); |
138 | DefineAndDrawWindow(170,150,405,290,0x74,system.color.work,"Virtual Disk Manager 0.66",0); |
148 | GetProcessInfo(#Form, SelfInfo); |
139 | GetProcessInfo(#Form, SelfInfo); |
149 | if (Form.status_window>2) break; |
140 | if (Form.status_window>2) break; |
Line 150... | Line 141... | ||
150 | 141 | ||
151 | DrawBar(0,0, Form.cwidth,TOPPANELH, system.color.work); |
142 | DrawBar(0,0, Form.cwidth,TOPPANELH, system.color.work); |
152 | DrawBar(0,TOPPANELH, Form.cwidth,1, system.color.work_graph); |
143 | DrawBar(0,TOPPANELH, Form.cwidth,1, system.color.work_graph); |
153 | WriteText(6, 6, 0x90, system.color.work_text, SIZE_TEXT); |
144 | WriteText(6, 9, 0x90, system.color.work_text, SIZE_TEXT); |
154 | WriteText(edit_disk_size.left + edit_disk_size.width + 12, 6, 0x90, system.color.work_text, "MB."); |
145 | WriteText(edit_disk_size.left + edit_disk_size.width + 12, 9, 0x90, system.color.work_text, "MB."); |
155 | DrawEditBox(#edit_disk_size); |
- | |
156 | for (i=0, x=6; i<2; i++, x+=strlen(but_text[i])*6+37) |
146 | DrawEditBox(#edit_disk_size); |
157 | { |
147 | x = 6; |
- | 148 | x = 6 + DrawStandartCaptButton(6, 36, 10, T_ADD_DISK); |
|
158 | DefineButton(x,29, strlen(but_text[i])*6+28,19, 10+i, system.color.work_button); |
149 | DrawStandartCaptButton(x, 36, 11, T_DELETE_DISK); |
159 | _PutImage(x+3,32, 14,14, i*14*14*3+#icons); |
150 | _PutImage(6+6, 42, 14,14, #icons); |
160 | WriteText(x+22,35, 0x80, system.color.work_button_text, but_text[i]); |
- | |
161 | } |
151 | _PutImage(x+6, 42, 14,14, 1*14*14*3+#icons); |
162 | GetDisks(); |
152 | GetDisks(); |
163 | DrawTmpDisks(); |
153 | DrawTmpDisks(); |
164 | } |
154 | } |
165 | } |
155 | } |
Line 210... | Line 200... | ||
210 | } |
200 | } |
211 | if (disk_num>12) disk_num=12; |
201 | if (disk_num>12) disk_num=12; |
212 | } |
202 | } |
Line 213... | Line 203... | ||
213 | 203 | ||
214 | 204 | ||
Line 215... | Line 205... | ||
215 | unsigned int disk_pos_x[]={13,13,13,85,85,85,157,157,157,229,229,229}; |
205 | unsigned int disk_pos_x[]={13,13,13,102,102,102,191,191,191,279,279,279}; |
216 | unsigned int disk_pos_y[]={60,95,130, 60, 95, 130, 60, 95,130, 60, 85,130}; |
206 | unsigned int disk_pos_y[]={79,127,175, 79,127,175, 79,127,175, 79,127,175}; |
217 | 207 | ||
218 | void DrawTmpDisks() |
208 | void DrawTmpDisks() |
Line 225... | Line 215... | ||
225 | int FreeRAM=GetFreeRAM()/1024; |
215 | int FreeRAM=GetFreeRAM()/1024; |
Line 226... | Line 216... | ||
226 | 216 | ||
227 | DrawBar(0,TOPPANELH+1, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF); |
217 | DrawBar(0,TOPPANELH+1, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF); |
228 | DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, system.color.work_graph); |
218 | DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, system.color.work_graph); |
229 | DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, system.color.work); |
219 | DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, system.color.work); |
230 | strcpy(#free_ram_text, FREE_RAM_TEXT); |
- | |
231 | strcat(#free_ram_text, itoa(FreeRAM)); |
- | |
232 | strcat(#free_ram_text, " MB"); |
220 | sprintf(#free_ram_text, "%s%i MB", FREE_RAM_TEXT, FreeRAM); |
233 | WriteText(10, Form.cheight-13, 0x80, system.color.work_text, #free_ram_text); |
221 | WriteText(10, Form.cheight-20, 0x90, system.color.work_text, #free_ram_text); |
234 | if (disk_num==0) |
222 | if (disk_num==0) |
235 | { |
223 | { |
236 | WriteText(17,65, 0x90, 0x777777, INTRO_TEXT_1); |
224 | WriteText(17,TOPPANELH+15, 0x90, 0x777777, INTRO_TEXT_1); |
237 | WriteText(17,65+15, 0x90, 0x777777, INTRO_TEXT_2); |
225 | WriteText(17,TOPPANELH+15+15, 0x90, 0x777777, INTRO_TEXT_2); |
238 | WriteText(17,65+42, 0x90, 0x777777, INTRO_TEXT_3); |
226 | WriteText(17,TOPPANELH+15+42, 0x90, 0x777777, INTRO_TEXT_3); |
239 | return; |
227 | return; |
240 | }; |
228 | }; |
241 | if (selected>=disk_num) selected=disk_num-1; //restore selected |
229 | if (selected>=disk_num) selected=disk_num-1; //restore selected |
242 | for (i=0; i<10; i++) DeleteButton(20+i); |
230 | for (i=0; i<10; i++) DeleteButton(20+i); |
243 | for (i=0; i |
231 | for (i=0; i |
244 | { |
232 | { |
245 | DefineButton(disk_pos_x[i], disk_pos_y[i], 65, 30, 20+i, 0xFFFfff); |
233 | DefineButton(disk_pos_x[i], disk_pos_y[i], 80, 40, 20+i, 0xFFFfff); |
246 | WriteText(disk_pos_x[i]+25,disk_pos_y[i]+2, 10110000b, 0, #disk_list[i].Item); |
234 | WriteText(disk_pos_x[i]+26,disk_pos_y[i]+6, 10110000b, 0x222222, #disk_list[i].Item); |
247 | real_id = disk_list[i].Item[3] - '0'; |
235 | real_id = disk_list[i].Item[3] - '0'; |
248 | WriteText(disk_pos_x[i]+25,disk_pos_y[i]+19, 0x80, 0x888888, ConvertSize(disk_sizes[real_id])); |
236 | WriteText(disk_pos_x[i]+27,disk_pos_y[i]+24, 0x80, 0x555555, ConvertSize(disk_sizes[real_id])); |
249 | _PutImage(disk_pos_x[i]+5,disk_pos_y[i]+4, 14,14, 2*14*14*3+#icons); |
237 | _PutImage(disk_pos_x[i]+6,disk_pos_y[i]+6, 14,14, 2*14*14*3+#icons); |
250 | if (selected==i) { |
238 | if (selected==i) { |
251 | if ( !asm test edit_disk_size.flags, 2) selection_color = selection_active; else selection_color = selection_inactive; |
239 | if ( !asm test edit_disk_size.flags, 2) selection_color = selection_active; else selection_color = selection_inactive; |
252 | DrawWideRectangle(disk_pos_x[i], disk_pos_y[i], 65, 30, 2, selection_color); |
240 | DrawWideRectangle(disk_pos_x[i], disk_pos_y[i], 80, 40, 2, selection_color); |
253 | PutPixel(disk_pos_x[i], disk_pos_y[i], 0xFFFfff); |
241 | PutPixel(disk_pos_x[i], disk_pos_y[i], 0xFFFfff); |
254 | } |
242 | } |
255 | } |
243 | } |