Subversion Repositories Kolibri OS

Rev

Rev 7611 | Rev 7613 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7611 Rev 7612
Line 32... Line 32...
32
	?define T_SELECT_FOLDER "‚ë¡à âì ¯ ¯ªã"
32
	?define T_SELECT_FOLDER "‚ë¡à âì ¯ ¯ªã"
33
	?define MENU_LIST "Žâªàëâì ä ©«   Enter\n“¤ «¨âì ä ©«     Del"
33
	?define MENU_LIST "Žâªàëâì ä ©«   Enter\n“¤ «¨âì ä ©«     Del"
34
	?define T_PICTURE_MODE " ®«®¦¥­¨¥ ª à⨭ª¨ "
34
	?define T_PICTURE_MODE " ®«®¦¥­¨¥ ª à⨭ª¨ "
35
	?define T_CHECKBOX_STRETCH " áâï­ãâì"
35
	?define T_CHECKBOX_STRETCH " áâï­ãâì"
36
	?define T_CHECKBOX_TILED "‡ ¬®áâ¨âì"
36
	?define T_CHECKBOX_TILED "‡ ¬®áâ¨âì"
-
 
37
	?define T_UPDATE_DOCK "Ž¡­®¢«ïâì Dock-¯ ­¥«ì"
37
#else
38
#else
38
	?define WINDOW_HEADER "Appearance"
39
	?define WINDOW_HEADER "Appearance"
39
	?define T_SKINS       "Skins"
40
	?define T_SKINS       "Skins"
40
	?define T_WALLPAPERS  "Wallpapers"
41
	?define T_WALLPAPERS  "Wallpapers"
41
	?define T_SELECT_FOLDER "Select folder"
42
	?define T_SELECT_FOLDER "Select folder"
42
	?define MENU_LIST "Open file      Enter\nDelete file      Del"
43
	?define MENU_LIST "Open file      Enter\nDelete file      Del"
43
	?define T_PICTURE_MODE " Picture Mode "
44
	?define T_PICTURE_MODE " Picture Mode "
44
	?define T_CHECKBOX_STRETCH "Stretch"
45
	?define T_CHECKBOX_STRETCH "Stretch"
45
	?define T_CHECKBOX_TILED "Tiled"
46
	?define T_CHECKBOX_TILED "Tiled"
-
 
47
	?define T_UPDATE_DOCK "Update Dock"
46
#endif
48
#endif
Line 47... Line 49...
47
 
49
 
48
#define PANEL_H 40
50
#define PANEL_H 40
49
#define LP 10 //LIST_PADDING
51
#define LP 10 //LIST_PADDING
Line 67... Line 69...
67
proc_info Form;
69
proc_info Form;
68
block skp;
70
block skp;
Line 69... Line 71...
69
 
71
 
Line -... Line 72...
-
 
72
_tabs tabs = { LP, LP, NULL, NULL, SKINS };
70
_tabs tabs = { LP, LP, NULL, NULL, SKINS };
73
 
71
 
74
checkbox update_docky = { T_UPDATE_DOCK, false };
72
checkbox checkbox1 = { "Checkbox", true };
75
checkbox checkbox1 = { "Checkbox", true };
73
more_less_box spinbox1 = { 23, 0, 999, "SpinBox" };
76
more_less_box spinbox1 = { 23, 0, 999, "SpinBox" };
Line 139... Line 142...
139
			if (id==SKINS) EventTabClick(SKINS);
142
			if (id==SKINS) EventTabClick(SKINS);
140
			if (id==WALLPAPERS) EventTabClick(WALLPAPERS);
143
			if (id==WALLPAPERS) EventTabClick(WALLPAPERS);
141
			if (id==BTN_SELECT_WALLP_FOLDER) EventSelectWallpFolder();
144
			if (id==BTN_SELECT_WALLP_FOLDER) EventSelectWallpFolder();
142
			checkbox1.click(id);
145
			checkbox1.click(id);
143
			spinbox1.click(id);
146
			spinbox1.click(id);
-
 
147
			if (update_docky.click(id)) EventUpdateDocky();
144
			if (!optionbox_stretch.checked) && (optionbox_stretch.click(id)) EventSetWallpMode_Stretch();
148
			if (!optionbox_stretch.checked) && (optionbox_stretch.click(id)) EventSetWallpMode_Stretch();
145
			if (!optionbox_tiled.checked) && (optionbox_tiled.click(id)) EventSetWallpMode_Tiled();
149
			if (!optionbox_tiled.checked) && (optionbox_tiled.click(id)) EventSetWallpMode_Tiled();
146
			break;
150
			break;
Line 147... Line 151...
147
	  
151
	  
Line 185... Line 189...
185
   }
189
   }
186
}
190
}
Line 187... Line 191...
187
 
191
 
188
void draw_window()
192
void draw_window()
189
{
-
 
190
	system.color.get();	
193
{
191
	DefineAndDrawWindow(screen.width-600/2,80,630,404+skin_height,0x74,0xE4DFE1,WINDOW_HEADER,0);
194
	DefineAndDrawWindow(screen.width-600/2,80,630,504+skin_height,0x74,NULL,WINDOW_HEADER,0);
192
	GetProcessInfo(#Form, SelfInfo);
195
	GetProcessInfo(#Form, SelfInfo);
193
	IF (Form.status_window>=2) return;
196
	IF (Form.status_window>=2) return;
194
	DrawWindowContent();
197
	DrawWindowContent();
Line 198... Line 201...
198
{
201
{
199
	int id;
202
	int id;
200
	incn y;
203
	incn y;
201
	int list_w;
204
	int list_w;
Line -... Line 205...
-
 
205
 
-
 
206
	system.color.get();	
202
 
207
 
Line 203... Line 208...
203
	if (tabs.active_tab == SKINS) list_w=250; else list_w=350;
208
	if (tabs.active_tab == SKINS) list_w=250; else list_w=350;
Line 204... Line 209...
204
 
209
 
Line 221... Line 226...
221
		);
226
		);
222
	select_list.cur_y = id;
227
	select_list.cur_y = id;
Line 223... Line 228...
223
 
228
 
224
	skp.set_size(
229
	skp.set_size(
225
		select_list.x + select_list.w + TAB_PADDING + scroll1.size_x + 20,
230
		select_list.x + select_list.w + TAB_PADDING + scroll1.size_x + 20,
226
		select_list.y + 30,
231
		select_list.y + 30 + 50,
227
		list_w,
232
		list_w,
228
		select_list.h - 50
233
		230 //select_list.h - 50 - 50
Line 229... Line 234...
229
	);
234
	);
230
 
235
 
Line 231... Line 236...
231
	SelectList_Draw();
236
	SelectList_Draw();
232
	SelectList_DrawBorder();
237
	SelectList_DrawBorder();
233
 
238
 
234
	if (tabs.active_tab == SKINS)
239
	if (tabs.active_tab == SKINS)
-
 
240
	{
235
	{
241
		DrawBar(skp.x-20, select_list.y, skp.w+40, select_list.h, system.color.work);
236
		DrawBar(skp.x-20, select_list.y, skp.w+40, select_list.h, system.color.work);
242
		DrawRectangle(skp.x-20, select_list.y, skp.w+40, select_list.h, system.color.work_graph);
237
		DrawRectangle(skp.x-20, select_list.y, skp.w+40, select_list.h, system.color.work_graph);
-
 
238
		y.n = skp.y;
243
		update_docky.draw(skp.x, select_list.y+15);
239
		DrawFrame(skp.x, skp.y, skp.w, skp.h, " Components Preview ");
244
		y.n = skp.y;
240
		checkbox1.draw(skp.x+20, y.inc(30));
245
		DrawFrame(skp.x, skp.y, skp.w, skp.h, " Components Preview ");
241
		spinbox1.draw(skp.x+20, y.inc(30));
246
		spinbox1.draw(skp.x+20, y.inc(30));
242
		WriteText(skp.x+20, y.inc(30), 0x90, system.color.work_text, "C-- Edit");
247
		WriteText(skp.x+20, y.inc(30), 0x90, system.color.work_text, "C-- Edit");
Line 388... Line 393...
388
	optionbox_stretch.checked = false;
393
	optionbox_stretch.checked = false;
389
	optionbox_stretch.redraw();
394
	optionbox_stretch.redraw();
390
	EventApply();
395
	EventApply();
391
}
396
}
Line -... Line 397...
-
 
397
 
392
 
398
#include "..\lib\patterns\restart_process.h"
393
void EventApply()
399
void EventApply()
394
{
400
{
395
	char kivpath[4096+10];
401
	char kivpath[4096+10];
396
	EventSetNewCurrent();
402
	EventSetNewCurrent();
397
	if (tabs.active_tab==SKINS)
403
	if (tabs.active_tab==SKINS)
398
	{
-
 
399
		draw_window();
404
	{
400
		cur = select_list.cur_y;
405
		cur = select_list.cur_y;
-
 
406
		SetSystemSkin(#cur_file_path);
401
		SetSystemSkin(#cur_file_path);
407
		SelectList_Draw();
-
 
408
		strcpy(#cur_skin_path, #cur_file_path);
402
		strcpy(#cur_skin_path, #cur_file_path);
409
		EventUpdateDocky();
403
	} 
410
	} 
404
	if (tabs.active_tab==WALLPAPERS)
411
	if (tabs.active_tab==WALLPAPERS)
405
	{
412
	{
406
		SelectList_Draw();
413
		SelectList_Draw();
Line 409... Line 416...
409
		strcat(#kivpath, #cur_file_path);
416
		strcat(#kivpath, #cur_file_path);
410
		RunProgram("/sys/media/kiv", #kivpath);
417
		RunProgram("/sys/media/kiv", #kivpath);
411
	}
418
	}
412
}
419
}
Line -... Line 420...
-
 
420
 
-
 
421
void EventUpdateDocky()
-
 
422
{
-
 
423
	if (!update_docky.checked) return;
-
 
424
	KillProcessByName("@docky", MULTIPLE);
-
 
425
	RunProgram("/sys/@docky",NULL);
-
 
426
	pause(50);
-
 
427
	ActivateWindow(GetProcessSlot(Form.ID));
-
 
428
}
413
 
429
 
414
void EventOpenFile()
430
void EventOpenFile()
415
{
431
{
416
	if (tabs.active_tab==SKINS) RunProgram("/sys/skincfg", #cur_file_path);
432
	if (tabs.active_tab==SKINS) RunProgram("/sys/skincfg", #cur_file_path);
417
	if (tabs.active_tab==WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path);
433
	if (tabs.active_tab==WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path);