Rev 4081 | Rev 4410 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4081 | Rev 4085 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //11.03.12 - start! |
1 | //11.03.12 - start! |
Line -... | Line 2... | ||
- | 2 | ||
- | 3 | #ifndef AUTOBUILD |
|
- | 4 | ?include "lang.h--" |
|
- | 5 | #endif |
|
2 | 6 | ||
3 | #define MEMSIZE 0xFE800 |
7 | #define MEMSIZE 0xFE800 |
4 | #include "..\lib\kolibri.h" |
8 | #include "..\lib\kolibri.h" |
5 | #include "..\lib\mem.h" |
- | |
6 | #include "..\lib\file_system.h" |
9 | #include "..\lib\mem.h" |
- | 10 | #include "..\lib\strings.h" |
|
- | 11 | #include "..\lib\dll.h" |
|
7 | #include "..\lib\strings.h" |
12 | #include "..\lib\file_system.h" |
8 | #include "..\lib\list_box.h" |
13 | #include "..\lib\list_box.h" |
- | 14 | #include "..\lib\figures.h" |
|
- | 15 | #include "..\lib\lib.obj\box_lib.h" |
|
- | 16 | ||
- | 17 | #ifdef LANG_RUS |
|
- | 18 | ?define WINDOW_HEADER "á¯à ¢«¥¨¥ ⥬®©" |
|
- | 19 | ?define T_SKINS "ª " |
|
- | 20 | ?define T_WALLPAPERS "¡®¨ à ¡®ç¥£® á⮫ " |
|
- | 21 | #else |
|
- | 22 | ?define WINDOW_HEADER "Appearance" |
|
- | 23 | ?define T_SKINS "Skins" |
|
- | 24 | ?define T_WALLPAPERS "Wallpappers" |
|
Line 9... | Line -... | ||
9 | #include "..\lib\figures.h" |
- | |
Line 10... | Line 25... | ||
10 | 25 | #endif |
|
11 | #define WINDOW_HEADER "Appearance" |
26 | |
12 | 27 | ||
Line 27... | Line 42... | ||
27 | int cur; |
42 | int cur; |
Line 28... | Line 43... | ||
28 | 43 | ||
29 | system_colors sc; |
44 | system_colors sc; |
Line 30... | Line -... | ||
30 | proc_info Form; |
- | |
31 | - | ||
32 | #include "other.h" |
- | |
- | 45 | proc_info Form; |
|
Line -... | Line 46... | ||
- | 46 | ||
Line 33... | Line 47... | ||
33 | 47 | scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; |
|
- | 48 | ||
Line 34... | Line 49... | ||
34 | //ADD PaNEL |
49 | #include "other.h" |
35 | 50 | ||
36 | 51 | //icons configurate, delete from list, delete from disk, make default |
|
Line 59... | Line 74... | ||
59 | } |
74 | } |
Line 60... | Line 75... | ||
60 | 75 | ||
61 | void Draw_List() |
76 | void Draw_List() |
62 | { |
77 | { |
63 | int i; |
78 | int i; |
64 | list[SKINS].SetSizes(0, PANEL_H, Form.cwidth, Form.cheight-PANEL_H, 40, 20); |
79 | list[SKINS].SetSizes(0, PANEL_H, Form.cwidth-scroll1.size_x-1, Form.cheight-PANEL_H, 40, 20); |
Line 65... | Line 80... | ||
65 | list[WALLPAPERS].SetSizes(0, PANEL_H, Form.cwidth, Form.cheight-PANEL_H, 40, 20); |
80 | list[WALLPAPERS].SetSizes(0, PANEL_H, Form.cwidth-scroll1.size_x-1, Form.cheight-PANEL_H, 40, 20); |
66 | 81 | ||
67 | for (i=0; i |
82 | for (i=0; i |
68 | { |
83 | { |
Line 87... | Line 102... | ||
87 | DrawBar(0,i*list[active].line_h+list[active].y,list[active].w, list[active].line_h, 0xFFFfff); |
102 | DrawBar(0,i*list[active].line_h+list[active].y,list[active].w, list[active].line_h, 0xFFFfff); |
88 | WriteText(11,i*list[active].line_h+list[active].text_y+list[active].y,0x80,0, #temp_filename); |
103 | WriteText(11,i*list[active].line_h+list[active].text_y+list[active].y,0x80,0, #temp_filename); |
89 | } |
104 | } |
90 | } |
105 | } |
91 | DrawBar(0,list[active].visible*list[active].line_h+list[active].y, list[active].w, -list[active].visible*list[active].line_h+ list[active].h, 0xFFFfff); |
106 | DrawBar(0,list[active].visible*list[active].line_h+list[active].y, list[active].w, -list[active].visible*list[active].line_h+ list[active].h, 0xFFFfff); |
- | 107 | DrawScroller(); |
|
92 | } |
108 | } |
Line 93... | Line 109... | ||
93 | 109 | ||
94 | void GetFiles(int set_active) |
110 | void GetFiles(int set_active) |
95 | { |
111 | { |
Line 139... | Line 155... | ||
139 | { |
155 | { |
140 | int id, key, mouse_clicked; |
156 | int id, key, mouse_clicked; |
141 | mouse mm; |
157 | mouse mm; |
Line 142... | Line 158... | ||
142 | 158 | ||
143 | mem_Init(); |
159 | mem_Init(); |
144 | if (param) strcpy(#folder_path, #param); |
160 | if (load_dll2(boxlib, #box_lib_init,0)!=0) {notify("Fatal Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();} |
145 | list[SKINS].current = list[WALLPAPERS].current = -1; |
161 | list[SKINS].current = list[WALLPAPERS].current = -1; |
146 | list[SKINS].first = list[WALLPAPERS].first = 0; |
162 | list[SKINS].first = list[WALLPAPERS].first = 0; |
147 | GetFiles(WALLPAPERS); |
163 | GetFiles(WALLPAPERS); |
148 | list[active].SetSizes(0, 230, 350, 400-PANEL_H, 40, 18); |
164 | list[active].SetSizes(0, 230, 350, 400-PANEL_H, 40, 18); |
149 | SetEventMask(0x27); |
165 | SetEventMask(0x27); |
150 | loop() |
166 | loop() |
151 | { |
167 | { |
152 | switch(WaitEvent()) |
168 | switch(WaitEvent()) |
153 | { |
169 | { |
- | 170 | case evMouse: |
|
- | 171 | if (!CheckActiveProcess(Form.ID)) break; |
|
- | 172 | scrollbar_v_mouse (#scroll1); |
|
- | 173 | if (list[active].first <> scroll1.position) |
|
- | 174 | { |
|
- | 175 | list[active].first = scroll1.position; |
|
- | 176 | Draw_List(); |
|
- | 177 | break; |
|
- | 178 | } |
|
154 | case evMouse: |
179 | |
155 | mm.get(); |
180 | mm.get(); |
156 | if (mm.vert) && (list[active].MouseScroll(mm.vert)) Draw_List(); |
181 | if (mm.vert) && (list[active].MouseScroll(mm.vert)) Draw_List(); |
157 | if (mouse_clicked) |
182 | if (mouse_clicked) |
158 | { |
183 | { |
Line 207... | Line 232... | ||
207 | dword col_bg, col_text; |
232 | dword col_bg, col_text; |
208 | DrawBar(0,0, Form.cwidth, PANEL_H-1, sc.work); |
233 | DrawBar(0,0, Form.cwidth, PANEL_H-1, sc.work); |
Line 209... | Line 234... | ||
209 | 234 | ||
210 | if (active==SKINS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;} |
235 | if (active==SKINS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;} |
211 | DrawRectangle(10-1,7-1, 65+2, 21+2, sc.work_graph); |
236 | DrawRectangle(10-1,7-1, 65+2, 21+2, sc.work_graph); |
212 | DrawCaptButton(10,7, 65, 21, 2, col_bg, col_text, "Skins"); //вокруг рисовать пмятоуг |
237 | DrawCaptButton(10,7, 65, 21, 2, col_bg, col_text, T_SKINS); //¢®ªà㣠à¨á®¢ âì ¯¬ïâ®ã£ |
213 | if (active==WALLPAPERS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;} |
238 | if (active==WALLPAPERS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;} |
214 | DrawRectangle(90-1,7-1, 95+2, 21+2, sc.work_graph); |
239 | DrawRectangle(90-1,7-1, strlen(T_WALLPAPERS)*6+16+2, 21+2, sc.work_graph); |
Line 215... | Line 240... | ||
215 | DrawCaptButton(90,7, 95, 21, 3, col_bg, col_text, "Wallpappers"); |
240 | DrawCaptButton(90,7, strlen(T_WALLPAPERS)*6+16, 21, 3, col_bg, col_text, T_WALLPAPERS); |
216 | 241 | ||
217 | DrawBar(0,PANEL_H-2, Form.cwidth, 1, sc.work_graph); |
242 | DrawBar(0,PANEL_H-2, Form.cwidth, 1, sc.work_graph); |
Line 224... | Line 249... | ||
224 | DrawTabs(); |
249 | DrawTabs(); |
225 | Draw_List(); |
250 | Draw_List(); |
226 | } |
251 | } |
Line -... | Line 252... | ||
- | 252 | ||
- | 253 | ||
- | 254 | void DrawScroller() |
|
- | 255 | { |
|
- | 256 | scroll1.bckg_col = 0xBBBbbb; |
|
- | 257 | scroll1.frnt_col = sc.work; |
|
- | 258 | scroll1.line_col = sc.work_graph; |
|
- | 259 | ||
- | 260 | scroll1.max_area = list[active].count; |
|
- | 261 | scroll1.cur_area = list[active].visible; |
|
- | 262 | scroll1.position = list[active].first; |
|
- | 263 | ||
- | 264 | scroll1.all_redraw=1; |
|
- | 265 | scroll1.start_x = list[active].x + list[active].w; |
|
- | 266 | scroll1.start_y = list[active].y-2; |
|
- | 267 | scroll1.size_y = list[active].h+2; |
|
- | 268 | ||
Line 227... | Line 269... | ||
227 | 269 | scrollbar_v_draw(#scroll1); |