Rev 3965 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3965 | Rev 3975 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | ?define INTRO_TEXT_3 "®¯à®¡ã©â¥ ¤®¡ ¢¨âì ®¤¨..." |
15 | ?define INTRO_TEXT_3 "®¯à®¡ã©â¥ ¤®¡ ¢¨âì ®¤¨..." |
16 | ?define INTRO_TEXT_4 " §¬¥à:" |
16 | ?define INTRO_TEXT_4 " §¬¥à:" |
Line 17... | Line 17... | ||
17 | 17 | ||
18 | ?define NOTIFY_TEXT_NO_DISK "«ï ç « ¤®¡ ¢ì⥠å®âï ¡ë ®¤¨ ¤¨áª" |
18 | ?define NOTIFY_TEXT_NO_DISK "«ï ç « ¤®¡ ¢ì⥠å®âï ¡ë ®¤¨ ¤¨áª" |
- | 19 | ?define NOTIFY_TEXT_DISK_LIMIT "®á⨣ã⠯।¥« ª®«¨ç¥á⢠¢¨àâã «ìëå ¤¨áª®¢" |
|
Line 19... | Line 20... | ||
19 | ?define NOTIFY_TEXT_DISK_LIMIT "®á⨣ã⠯।¥« ª®«¨ç¥á⢠¢¨àâã «ìëå ¤¨áª®¢" |
20 | ?define FREE_RAM_TEXT " §¬¥à ᢮¡®¤®© ®¯¥à ⨢®© ¯ ¬ïâ¨: " |
20 | 21 | ||
21 | #else |
22 | #else |
22 | unsigned char *but_text[]={ |
23 | unsigned char *but_text[]={ |
Line 30... | Line 31... | ||
30 | ?define INTRO_TEXT_3 " Try to add one..." |
31 | ?define INTRO_TEXT_3 " Try to add one..." |
31 | ?define INTRO_TEXT_4 "Size:" |
32 | ?define INTRO_TEXT_4 "Size:" |
Line 32... | Line 33... | ||
32 | 33 | ||
33 | ?define NOTIFY_TEXT_NO_DISK "You need to have at least one disk" |
34 | ?define NOTIFY_TEXT_NO_DISK "You need to have at least one disk" |
- | 35 | ?define NOTIFY_TEXT_DISK_LIMIT "Reached the limit of the number of virtual disks" |
|
34 | ?define NOTIFY_TEXT_DISK_LIMIT "Reached the limit of the number of virtual disks" |
36 | ?define FREE_RAM_TEXT "Free RAM size: " |
Line 35... | Line 37... | ||
35 | #endif |
37 | #endif |
36 | 38 | ||
Line 49... | Line 51... | ||
49 | unsigned char icons[14*56] = FROM "icons.raw"; |
51 | unsigned char icons[14*56] = FROM "icons.raw"; |
50 | #define TOPPANELH 50 |
52 | #define TOPPANELH 50 |
51 | #define BOTPANELH 20 |
53 | #define BOTPANELH 20 |
Line 52... | Line 54... | ||
52 | 54 | ||
53 | int mouse_dd; |
55 | int mouse_dd; |
54 | char disk_size[30]="\0"; |
- | |
55 | #ifdef LANG_RUS |
- | |
56 | edit_box edit_disk_size= {60,50,5,0xffffff,0x94AECE,0x000000,0xffffff,0,sizeof(disk_size)+2,#disk_size,#mouse_dd, 0b100000000000000}; |
- | |
57 | #else |
56 | char disk_size[30]; |
58 | edit_box edit_disk_size= {60,40,5,0xffffff,0x94AECE,0x000000,0xffffff,0,sizeof(disk_size)+2,#disk_size,#mouse_dd, 0b100000000000000}; |
- | |
Line 59... | Line 57... | ||
59 | #endif |
57 | edit_box edit_disk_size= {50,0,5,0xffffff,0x94AECE,0x000000,0xffffff,0,4,#disk_size,#mouse_dd, 1000000000000010b}; |
60 | 58 | ||
61 | void Main_Window() |
59 | void Main_Window() |
62 | { |
60 | { |
Line 67... | Line 65... | ||
67 | if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading GUI library /sys/lib/boxlib.obj"); |
65 | if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading GUI library /sys/lib/boxlib.obj"); |
68 | fr = GetFreeRAM() / 5; |
66 | fr = GetFreeRAM() / 5; |
69 | fr = itoa(fr / 2048); |
67 | fr = itoa(fr / 2048); |
70 | strcat(#disk_size, fr); |
68 | strcat(#disk_size, fr); |
71 | edit_disk_size.size = strlen(#disk_size); |
69 | edit_disk_size.size = strlen(#disk_size); |
- | 70 | edit_disk_size.left = strlen(INTRO_TEXT_4)*6 + 10; |
|
72 | SetEventMask(0x27); |
71 | SetEventMask(0x27); |
73 | loop() |
72 | loop() |
74 | { |
73 | { |
75 | switch(WaitEvent()) |
74 | switch(WaitEvent()) |
76 | { |
75 | { |
77 | case evMouse: |
76 | case evMouse: |
78 | IF (GetProcessSlot(Form.ID)-GetActiveProcess()!=0) break; |
77 | if (GetProcessSlot(Form.ID)-GetActiveProcess()!=0) break; |
79 | edit_box_mouse stdcall (#edit_disk_size); |
78 | edit_box_mouse stdcall (#edit_disk_size); |
80 | break; |
79 | break; |
Line 81... | Line 80... | ||
81 | 80 | ||
82 | case evButton: |
81 | case evButton: |
Line 155... | Line 154... | ||
155 | //EAX=key<<8; |
154 | //EAX=key<<8; |
156 | //edit_box_key stdcall(#edit_disk_size); |
155 | //edit_box_key stdcall(#edit_disk_size); |
157 | break; |
156 | break; |
158 | case evReDraw: |
157 | case evReDraw: |
159 | sc.get(); |
158 | sc.get(); |
160 | DefineAndDrawWindow(170,150,314,270,0x74,sc.work,"Virtual Disk Manager 0.47",0); |
159 | DefineAndDrawWindow(170,150,314,270,0x74,sc.work,"Virtual Disk Manager 0.5",0); |
161 | GetProcessInfo(#Form, SelfInfo); |
160 | GetProcessInfo(#Form, SelfInfo); |
162 | if (Form.status_window>2) break; |
161 | if (Form.status_window>2) break; |
Line 163... | Line 162... | ||
163 | 162 | ||
164 | DrawBar(0,0, Form.cwidth,TOPPANELH, sc.work); |
163 | DrawBar(0,0, Form.cwidth,TOPPANELH, sc.work); |
165 | DrawBar(0,TOPPANELH, Form.cwidth,1, sc.work_graph); |
- | |
166 | #ifdef LANG_RUS |
164 | DrawBar(0,TOPPANELH, Form.cwidth,1, sc.work_graph); |
167 | WriteText(6, 9, 0x80, sc.work_text, INTRO_TEXT_4); |
- | |
168 | WriteText(117, 9, 0x80, sc.work_text, "MB."); |
- | |
169 | #else |
- | |
170 | WriteText(6, 9, 0x80, sc.work_text, INTRO_TEXT_4); |
165 | WriteText(6, 9, 0x80, sc.work_text, INTRO_TEXT_4); |
171 | WriteText(107, 9, 0x80, sc.work_text, "MB."); |
- | |
172 | #endif |
166 | WriteText(edit_disk_size.left + edit_disk_size.width + 8, 9, 0x80, sc.work_text, "MB."); |
173 | edit_box_draw stdcall (#edit_disk_size); |
- | |
174 | x=6; |
167 | edit_box_draw stdcall (#edit_disk_size); |
175 | for (i=0; i<2; i++) |
168 | for (i=0, x=6; i<2; i++, x+=strlen(but_text[i])*6+37) |
176 | { |
169 | { |
177 | DefineButton(x,25, strlen(but_text[i])*6+28,19, 10+i, sc.work_button); |
170 | DefineButton(x,25, strlen(but_text[i])*6+28,19, 10+i, sc.work_button); |
178 | _PutImage(x+3,28, 14,14, i*14*14*3+#icons); |
171 | _PutImage(x+3,28, 14,14, i*14*14*3+#icons); |
179 | WriteText(x+22,31, 0x80, sc.work_button_text, but_text[i]); |
- | |
180 | x+=strlen(but_text[i])*6+37; |
172 | WriteText(x+22,31, 0x80, sc.work_button_text, but_text[i]); |
181 | } |
173 | } |
182 | GetDisks(); |
174 | GetDisks(); |
183 | DrawTmpDisks(); |
175 | DrawTmpDisks(); |
184 | } |
176 | } |
Line 224... | Line 216... | ||
224 | unsigned int disk_pos_x[]={13,13,13,83,83,83,153,153,153,223,223,223}; |
216 | unsigned int disk_pos_x[]={13,13,13,83,83,83,153,153,153,223,223,223}; |
225 | unsigned int disk_pos_y[]={60,85,110,60,85,110,60,85,110,60,85,110}; |
217 | unsigned int disk_pos_y[]={60,85,110,60,85,110,60,85,110,60,85,110}; |
Line 226... | Line 218... | ||
226 | 218 | ||
227 | void DrawTmpDisks() |
219 | void DrawTmpDisks() |
- | 220 | { |
|
228 | { |
221 | char free_ram_text[60]; |
229 | int i,FreeRAM=GetFreeRAM()/1024; |
222 | int i,FreeRAM=GetFreeRAM()/1024; |
230 | DrawBar(0,51, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF); |
223 | DrawBar(0,51, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF); |
231 | DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, sc.work_graph); |
224 | DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, sc.work_graph); |
232 | DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, sc.work); |
225 | DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, sc.work); |
233 | WriteText(10, Form.cheight-13, 0x80, sc.work_text, "Free RAM size:"); |
226 | strcpy(#free_ram_text, FREE_RAM_TEXT); |
- | 227 | strcat(#free_ram_text, itoa(FreeRAM)); |
|
234 | WriteText(100, Form.cheight-13, 0x80, sc.work_text, itoa(FreeRAM)); |
228 | strcat(#free_ram_text, " MB"); |
235 | WriteText(strlen(itoa(FreeRAM))*6 + 100, Form.cheight-13, 0x80, sc.work_text, " MB"); |
229 | WriteText(10, Form.cheight-13, 0x80, sc.work_text, #free_ram_text); |
236 | if (disk_num==0) |
230 | if (disk_num==0) |
237 | { |
231 | { |
238 | WriteText(17,65, 0x90, 0x777777, INTRO_TEXT_1); |
232 | WriteText(17,65, 0x90, 0x777777, INTRO_TEXT_1); |
239 | WriteText(17,65+15, 0x90, 0x777777, INTRO_TEXT_2); |
233 | WriteText(17,65+15, 0x90, 0x777777, INTRO_TEXT_2); |