Rev 8946 | Rev 8951 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3399 | leency | 1 | |
6034 | leency | 2 | { |
3 | collection list; |
||
4 | int dev_num; |
||
7422 | leency | 5 | void Get(); |
6 | void Draw(); |
||
6034 | leency | 7 | void DrawSelect(); |
8854 | leency | 8 | void DrawOptions(); |
9 | void Click(); |
||
6034 | leency | 10 | } SystemDiscs=0; |
7972 | leency | 11 | |
3848 | punk_joker | 12 | |
7422 | leency | 13 | { |
3363 | leency | 14 | bool kolibrios_exists=false; |
7428 | leency | 15 | char dev_name[10], sys_discs[10]; |
5150 | leency | 16 | int i1, j1, dev_num_i, dev_disc_num; |
7422 | leency | 17 | dword devbuf, diskbuf; |
8872 | leency | 18 | |
5734 | leency | 19 | |
6034 | leency | 20 | devbuf = malloc(10000); |
5960 | leency | 21 | ReadDir(19, devbuf, "/"); |
3363 | leency | 22 | dev_num = dev_num_i = EBX; |
7422 | leency | 23 | for (i1=0; i1 |
24 | { |
||
7310 | pavelyakov | 25 | sprintf(#dev_name,"/%s",i1*304+ devbuf+72); |
6635 | leency | 26 | GetDir(#diskbuf, #dev_disc_num, #dev_name, DIRS_NOROOT); |
8872 | leency | 27 | for (j1=0; j1 |
3363 | leency | 28 | { |
29 | sprintf(#sys_discs,"%s/%s",#dev_name,j1*304+ diskbuf+72); |
||
8872 | leency | 30 | if (sys_discs[1]=='c') || (dir_exists(#sys_discs)) list.add(#sys_discs); |
7992 | leency | 31 | } |
3363 | leency | 32 | if (!strcmp(#sys_discs, "/rd/1")) |
6635 | leency | 33 | { |
3956 | leency | 34 | if (dir_exists("/kolibrios")) && (!kolibrios_exists) { |
7428 | leency | 35 | kolibrios_exists=true; |
36 | list.add("/kolibrios"); |
||
7422 | leency | 37 | dev_num++; |
38 | } |
||
39 | } |
||
4225 | punk_joker | 40 | } |
3363 | leency | 41 | free(devbuf); |
5960 | leency | 42 | free(diskbuf); |
8872 | leency | 43 | } |
3363 | leency | 44 | |
45 | |||
8949 | leency | 46 | { |
47 | int i; |
||
48 | for (i=0; devinfo[i]!=0; i+=3) { |
||
49 | if (disk_first_letter == ESBYTE[devinfo[i]]) { |
||
50 | ESBYTE[dev_icon] = devinfo[i+1]; |
||
51 | strcpy(disc_name, devinfo[i+2]); |
||
52 | return; |
||
53 | } |
||
54 | } |
||
55 | ESBYTE[dev_icon]=5; |
||
56 | strcpy(disc_name, T_UNC); |
||
57 | } |
||
58 | |||
59 | |||
60 | #define DDW 120 |
||
8854 | leency | 61 | #define KFM2_DEVH 20 |
8949 | leency | 62 | |
8854 | leency | 63 | |
6034 | leency | 64 | { |
3363 | leency | 65 | char dev_name[15], disc_name[100], i, dev_icon; |
8949 | leency | 66 | bool is_active=0; |
67 | int draw_y, draw_x; |
||
7989 | leency | 68 | |
3363 | leency | 69 | |
5960 | leency | 70 | |
6034 | leency | 71 | |
8854 | leency | 72 | DrawSelect(Form.cwidth/2-DDW, KFM_DEV_DROPDOWN_1, location[0]); |
8949 | leency | 73 | DrawSelect(Form.cwidth-DDW-2, KFM_DEV_DROPDOWN_2, location[sizeof(dword)]); |
74 | files.y = 40 + 17; |
||
8854 | leency | 75 | } else { |
76 | draw_y = 74; |
||
77 | draw_x = 17; |
||
78 | for (i=0;i |
||
79 | strcpy(#dev_name, list.get(i)); |
||
80 | GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
||
81 | if (strstr(path, #dev_name)==path) is_active=true; else is_active=false; |
||
8949 | leency | 82 | |
6034 | leency | 83 | |
7989 | leency | 84 | DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF); |
85 | DefineHiddenButton(draw_x,draw_y,159,16,100+i); |
||
8949 | leency | 86 | if (show_dev_name.checked) |
7244 | leency | 87 | { |
5698 | leency | 88 | strcat(#disc_name, #dev_name); |
89 | if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#disc_name); |
||
6034 | leency | 90 | WriteText(draw_x+29,draw_y+5,0x80,0,#disc_name); |
7806 | leency | 91 | //if (is_active) kfont.bold = true; |
8854 | leency | 92 | //kfont.WriteIntoWindow(draw_x + 29, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #disc_name); |
93 | //kfont.bold = false; |
||
94 | } else { |
||
7806 | leency | 95 | if (is_active) WriteText(draw_x+30,draw_y+5,0x80,0x555555,#dev_name); |
6034 | leency | 96 | WriteText(draw_x+29,draw_y+5,0x80,0,#dev_name); |
97 | } |
||
5698 | leency | 98 | _PutImage(draw_x+6,draw_y, 18,17, is_active*7+dev_icon*17*18*3+#devices); |
7989 | leency | 99 | draw_y += DEV_H; |
8854 | leency | 100 | } |
5633 | leency | 101 | DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff); |
7989 | leency | 102 | } |
5703 | leency | 103 | } |
3363 | leency | 104 | |
105 | |||
8949 | leency | 106 | { |
8854 | leency | 107 | #define SELECTY 10 |
8949 | leency | 108 | char dev_name[15], disc_name[100], i, dev_icon; |
109 | |||
110 | |||
111 | strcpy(#dev_name, "/root"); |
||
8854 | leency | 112 | dev_icon = 0; |
113 | } else if (chrnum(_path, '/')==1) { |
||
8949 | leency | 114 | strcpy(#dev_name, _path); |
115 | GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
||
8854 | leency | 116 | } else for (i=0;i |
117 | strcpy(#dev_name, list.get(i)); |
||
118 | GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
||
119 | if (strstr(_path, #dev_name)-_path==0) break; |
||
8949 | leency | 120 | } |
8854 | leency | 121 | DrawRectangle(draw_x-1, SELECTY-1, DDW+2-KFM2_DEVH, KFM2_DEVH+1, sc.work_graph); |
8949 | leency | 122 | DrawBar(draw_x, SELECTY, DDW+1-KFM2_DEVH, KFM2_DEVH, 0xFFFFFF); |
123 | _PutImage(draw_x + 5, SELECTY+2, 18,17, dev_icon*17*18*3+#devices); |
||
124 | kfont.WriteIntoWindow(draw_x + 24, math.max(KFM2_DEVH-kfont.height/2+SELECTY,0), 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1); |
||
125 | DefineHiddenButton(draw_x, SELECTY, DDW-1, KFM2_DEVH-1, btid+1); |
||
126 | DrawFlatButtonSmall(draw_x+DDW-KFM2_DEVH+1, SELECTY-1, KFM2_DEVH-1, KFM2_DEVH+1, btid, "\x19"); |
||
127 | } |
||
8854 | leency | 128 | |
129 | |||
8949 | leency | 130 | { |
8854 | leency | 131 | int optionsy = SELECTY+KFM2_DEVH+1; |
8949 | leency | 132 | char dev_name[15], disc_name[100], i, dev_icon, is_active=0; |
8854 | leency | 133 | |
134 | |||
135 | |||
136 | |||
8949 | leency | 137 | |
8854 | leency | 138 | |
139 | strcpy(#dev_name, list.get(i)); |
||
140 | GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); |
||
141 | if (strstr(path, #dev_name)!=0) is_active=true; else is_active=false; |
||
8949 | leency | 142 | |
8854 | leency | 143 | |
8949 | leency | 144 | DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF); |
145 | _PutImage(draw_x + 5, optionsy+2, 18,17, is_active*7+dev_icon*17*18*3+#devices); |
||
146 | if (is_active) kfont.bold = true; |
||
8854 | leency | 147 | kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1); |
8949 | leency | 148 | kfont.bold = false; |
8854 | leency | 149 | optionsy += KFM2_DEVH; |
8949 | leency | 150 | } |
8854 | leency | 151 | } |
152 | |||
153 | |||
6034 | leency | 154 | { |
155 | strcpy(path, list.get(n)); |
||
8949 | leency | 156 | files.KeyHome(); |
6034 | leency | 157 | Open_Dir(path,WITH_REDRAW); |
8949 | leency | 158 | } |
6034 | leency | 159 | |
5698 | leency | 160 | |
6034 | leency | 161 | |
162 | |||
163 | { |
||
164 | Tip(56, T_DEVICES, 55, "="); |
||
165 | SystemDiscs.Draw(); |
||
166 | ActionsDraw(); |
||
167 | DrawLeftPanelBg(); |
||
168 | } |
||
169 | |||
170 | |||
7462 | leency | 171 | 0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1}; |
172 | void DrawFilledBarInner(dword x, y, w, h) |
||
173 | { |
||
174 | int i, fill_h; |
||
175 | if (h <= 14) fill_h = h; else fill_h = 14; |
||
176 | for (i=0; i |
||
177 | DrawBar(x, y+i, w, h-fill_h, col_palette_inner[14-i]); |
||
178 | } |
||
179 | |||
180 | |||
6034 | leency | 181 | { |
182 | if (col.def) { |
||
7647 | leency | 183 | DrawBar(17,y,160,1,0xEFEDEE); |
184 | DrawFilledBarInner(17, y+1, 160, 16); |
||
185 | DrawBar(17,y+17,160,1,0x7E87A3); |
||
186 | } else { |
||
187 | DrawBar(17,y,160,1,sc.work_graph); |
||
7806 | leency | 188 | DrawBar(17,y+1,160,16,col.list_bg); |
7647 | leency | 189 | DrawBar(17,y+17,160,1,sc.work_graph); |
7806 | leency | 190 | } |
7647 | leency | 191 | WriteText(25,y+5,0x80,col.list_gb_text,caption); |
192 | if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button |
||
6034 | leency | 193 | WriteText(165,y+5,0x80,col.list_gb_text,arrow); //arrow |
7647 | leency | 194 | } |
6034 | leency | 195 | |
196 | |||
3434 | leency | 197 | { |
3363 | leency | 198 | int i; |
7422 | leency | 199 | int actions_y= SystemDiscs.list.count*DEV_H+108; |
7989 | leency | 200 | Tip(actions_y-18, T_ACTIONS, 77, ""); |
8240 | leency | 201 | for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H) |
7989 | leency | 202 | { |
3363 | leency | 203 | DrawBar(17,actions_y,160,DEV_H,0xFFFFFF); //белое |
7989 | leency | 204 | DefineButton(17,actions_y,159,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1); |
205 | WriteText(45,actions_y+4,0x80,0,actions[i*3+1]); |
||
3434 | leency | 206 | WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]); |
207 | _PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions); |
||
5149 | leency | 208 | } |
3363 | leency | 209 | } |
210 | |||
211 | |||
5441 | leency | 212 | { |
3363 | leency | 213 | int actions_y = SystemDiscs.list.count*DEV_H; |
7989 | leency | 214 | int start_y = actions_y+159; |
215 | int area_h; |
||
6987 | leency | 216 | DrawBar(2,41,190,15,waves_pal[0]); //above devices block |
8949 | leency | 217 | DrawBar(17,actions_y+75,160,15,EDX); //below devices block |
218 | DrawBar(2,56,15,actions_y+103,EDX); //on the left |
||
219 | DrawBar(177,56,15,actions_y+103,EDX); //on the right |
||
220 | area_h = Form.cheight-start_y-2 - status_bar_h; |
||
6987 | leency | 221 | if (area_h < 268){ |
8240 | leency | 222 | PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal); |
223 | } else { |
||
224 | DrawBar(2,start_y,190, area_h-268, waves_pal[0]); |
||
225 | PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal); |
||
226 | } |
||
5743 | leency | 227 | PutShadow(17,actions_y+75,160,1,1,3); |
8949 | leency | 228 | PutShadow(18,actions_y+75+1,158,1,1,1); |
229 | PutShadow(17,start_y,160,1,1,3); |
||
3877 | leency | 230 | PutShadow(18,start_y+1,158,1,1,1); |
3434 | leency | 231 | }>=>30;>30;> |
5698 | leency | 232 |