Rev 3399 | Rev 3440 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3399 | Rev 3434 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | 14 | ||
15 | path_string disk_list[30]; |
15 | path_string disk_list[30]; |
16 | int disc_num; |
16 | int disc_num; |
Line 17... | Line 17... | ||
17 | dword devbuf; |
17 | dword devbuf; |
18 | 18 | ||
19 | void GetSystemDiscs() |
19 | void SystemDiscsGet() |
20 | { |
20 | { |
Line 21... | Line 21... | ||
21 | unsigned char dev_name[10], sys_discs[10]; |
21 | unsigned char dev_name[10], sys_discs[10]; |
Line 30... | Line 30... | ||
30 | { |
30 | { |
31 | strcpy(#dev_name, "/"); // / |
31 | strcpy(#dev_name, "/"); // / |
32 | strcat(#dev_name, i1*304+ devbuf+72); // /rd |
32 | strcat(#dev_name, i1*304+ devbuf+72); // /rd |
33 | strcat(#dev_name, "/"); // /rd/ |
33 | strcat(#dev_name, "/"); // /rd/ |
34 | Open_Dir(#dev_name, ONLY_OPEN); |
34 | Open_Dir(#dev_name, ONLY_OPEN); |
35 | dev_disc_num = count; |
35 | dev_disc_num = files.count; |
36 | //if (count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else |
36 | //if (files.count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else |
37 | for (j1=0; j1 |
37 | for (j1=0; j1 |
38 | { |
38 | { |
39 | strcpy(#sys_discs, #dev_name); // /rd/ |
39 | strcpy(#sys_discs, #dev_name); // /rd/ |
40 | strcat(#sys_discs, j1*304+ buf+72); // /rd/1 |
40 | strcat(#sys_discs, j1*304+ buf+72); // /rd/1 |
41 | strcat(#sys_discs, "/"); // /rd/1/ |
41 | strcat(#sys_discs, "/"); // /rd/1/ |
Line 44... | Line 44... | ||
44 | } |
44 | } |
45 | } |
45 | } |
46 | } |
46 | } |
Line 47... | Line 47... | ||
47 | 47 | ||
48 | 48 | ||
49 | void DrawSystemDiscs() |
- | |
50 | { |
- | |
51 | byte disc_icon; |
49 | void SystemDiscsDraw() |
52 | char dev_name[10]; |
50 | { |
Line 53... | Line -... | ||
53 | char disc_name[100]; |
- | |
54 | int i, dev_icon; |
- | |
55 | 51 | char dev_name[10], disc_name[100]; |
|
- | 52 | int i, dev_icon; |
|
56 | for (i=0; i<20; i++) DeleteButton(100+i); |
53 | |
57 | //ñïèñîê äèñêîâ |
54 | Tip(56, "Devices", 78, "="); |
58 | Tip(56, "Devices", 78, "="); |
55 | for (i=0; i<20; i++) DeleteButton(100+i); |
59 | for (i=0;i |
56 | for (i=0;i |
60 | { |
57 | { |
61 | DrawBar(17,i*16+74,160,17,0xFFFFFF); //ôîí |
58 | DrawBar(17,i*16+74,160,17,0xFFFFFF); |
62 | DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ |
59 | DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF); |
63 | strcpy(#dev_name, #disk_list[i].Item); |
60 | strcpy(#dev_name, #disk_list[i].Item); |
64 | dev_name[strlen(#dev_name)-1]=NULL; |
61 | dev_name[strlen(#dev_name)-1]=NULL; |
Line 105... | Line 102... | ||
105 | else WriteText(45,i*16+79,0x80,0,#dev_name); |
102 | else WriteText(45,i*16+79,0x80,0,#dev_name); |
106 | _PutImage(21,i*16+76, 14,13, dev_icon*14*13*3+#devices); |
103 | _PutImage(21,i*16+76, 14,13, dev_icon*14*13*3+#devices); |
107 | } |
104 | } |
108 | } |
105 | } |
Line 109... | Line -... | ||
109 | - | ||
110 | void FileMenu() |
- | |
111 | { |
- | |
112 | word id, key; |
- | |
113 | loop() switch(WaitEvent()) |
- | |
114 | { |
- | |
115 | case evButton: |
- | |
116 | id=GetButtonID(); |
- | |
117 | ExitProcess(); |
- | |
118 | break; |
- | |
119 | - | ||
120 | case evKey: |
- | |
121 | IF (GetKey()==27) ExitProcess(); |
- | |
122 | break; |
- | |
123 | - | ||
124 | case evReDraw: |
- | |
125 | DefineAndDrawWindow(m.x+1+Form.left,m.y+Form.top,159,90,0x01,0xEEEeee,0x01fffFFF); |
- | |
126 | DrawBar(1,18,160,51,0xFFFFFF); //áåëîå |
- | |
127 | _PutImage(1,23, 16,44, #factions); //èêîíêè |
- | |
128 | //rename file |
- | |
129 | DefineButton(1,18,159,16,80+BT_HIDE,0xE4DFE1); |
- | |
130 | WriteText(26,23,0x80,0,"Rename file"); |
- | |
131 | WriteText(134,23,0x80,0x999999,"[F2]"); |
- | |
132 | //delete file |
- | |
133 | DefineButton(1,35,159,16,81+BT_HIDE,0xE4DFE1); |
- | |
134 | WriteText(26,40,0x80,0,"Delete file"); |
- | |
135 | WriteText(144,40,0x80,0x999999,"[Del]"); |
- | |
136 | //create folder |
- | |
137 | DefineButton(1,52,159,16,82+BT_HIDE,0xE4DFE1); |
- | |
138 | WriteText(26,57,0x80,0,"Create folder"); |
- | |
139 | WriteText(134,57,0x80,0x999999,"[F6]"); |
- | |
140 | } |
- | |
Line -... | Line 106... | ||
- | 106 | ||
- | 107 | ||
- | 108 | char *actions[] = { |
|
- | 109 | 57, "New file", "F7", |
|
- | 110 | 56, "New folder", "F6", |
|
- | 111 | 60, "Options", "F10", |
|
141 | } |
112 | 0,0,0 |
142 | 113 | }; |
|
143 | void Actions() |
114 | void ActionsDraw() |
144 | { |
- | |
145 | int actions_y=disc_num*16; |
- | |
146 | - | ||
147 | DeleteButton(80); |
- | |
148 | DeleteButton(81); |
- | |
149 | DeleteButton(82); |
115 | { |
150 | 116 | int actions_y=disc_num*16+108, lineh=16; |
|
151 | if (!show_actions) |
- | |
152 | Tip(actions_y+90, "Actions", 77, "\x18"); |
117 | Tip(actions_y-18, "Actions", 77, ""); //çàãîëîâîê |
153 | else |
- | |
154 | { |
118 | for (i=0; actions[i*3]!=0; i++, actions_y+=lineh) |
155 | Tip(actions_y+90, "Actions", 77, "\x19"); //çàãîëîâîê |
- | |
156 | DrawBar(17,actions_y+108,160,51,0xFFFFFF); //áåëîå |
- | |
157 | _PutImage(21,actions_y+113, 16,44, #factions); //èêîíêè |
119 | { |
158 | //rename file |
120 | DrawBar(17,actions_y,160,lineh,0xFFFFFF); //áåëîå |
159 | DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1); |
121 | DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1); |
160 | WriteText(42,actions_y+113,0x80,0,"Rename file"); |
- | |
161 | WriteText(150,actions_y+113,0x80,0x999999,"[F2]"); |
- | |
162 | //delete file |
- | |
163 | DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1); |
- | |
164 | WriteText(42,actions_y+130,0x80,0,"Delete file"); |
- | |
165 | WriteText(144,actions_y+130,0x80,0x999999,"[Del]"); |
- | |
166 | //create folder |
122 | WriteText(45,actions_y+4,0x80,0,actions[i*3+1]); |
167 | DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1); |
- | |
168 | WriteText(42,actions_y+147,0x80,0,"Create folder"); |
123 | WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]); |
169 | WriteText(150,actions_y+147,0x80,0x999999,"[F6]"); |
124 | _PutImage(21,actions_y+2, 14,13, i*14*13*3+#factions); |
Line 170... | Line 125... | ||
170 | } |
125 | } |
171 | } |
126 | } |
172 | 127 | ||
173 | 128 | ||
174 | void LeftPanelBackground() |
129 | void LeftPanelBgDraw() |
175 | { |
130 | { |
- | 131 | int actions_y=disc_num*16; |
|
- | 132 | int start_y = actions_y+156; |
|
176 | int actions_y=disc_num*16; |
133 | DrawBar(2,41,190,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè |
177 | int start_y = show_actions*51+actions_y+108; |
134 | DrawBar(17,actions_y+75,160,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè |
178 | DrawBar(2,41,190,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè |
135 | PutShadow(17,actions_y+75,160,1,1,2); |
179 | DrawBar(17,actions_y+75,160,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè |
136 | PutShadow(18,actions_y+75+1,158,1,1,1); |
180 | DrawBar(2,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà |
137 | DrawBar(2,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà |
181 | DrawBar(177,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà |
138 | DrawBar(177,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà |
182 | if (onTop(start_y, 6) < 268) |
139 | if (onTop(start_y, 6) < 268) |
183 | PutPaletteImage(#blue_hl, 190, onTop(start_y, 6), 2, start_y, 8, #blue_hl_pal); |
140 | PutPaletteImage(#blue_hl, 190, onTop(start_y, 6), 2, start_y, 8, #blue_hl_pal); |
184 | else |
141 | else |
- | 142 | { |
|
- | 143 | DrawBar(2,start_y,190,onTop(start_y,6+268),col_lpanel); |
|
185 | { |
144 | PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), 8, #blue_hl_pal); |
Line 186... | Line 145... | ||
186 | DrawBar(2,start_y,190,onTop(start_y,6+268),col_lpanel); |
145 | } |
187 | PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), 8, #blue_hl_pal); |
146 | PutShadow(17,start_y,160,1,1,2); |
188 | } |
147 | PutShadow(18,start_y+1,158,1,1,1); |
189 | } |
148 | } |
190 | 149 | ||
191 | 150 |