Subversion Repositories Kolibri OS

Rev

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

Rev 7781 Rev 7806
Line 155... Line 155...
155
	load_dll(boxlib, #box_lib_init,0);
155
	load_dll(boxlib, #box_lib_init,0);
Line 156... Line 156...
156
 
156
 
157
	Libimg_LoadImage(#top_icons, "/sys/icons16.png");
157
	Libimg_LoadImage(#top_icons, "/sys/icons16.png");
Line 158... Line 158...
158
	Libimg_LoadImage(#left_icons, "/sys/icons16.png");
158
	Libimg_LoadImage(#left_icons, "/sys/icons16.png");
159
 
159
 
160
	system.color.get();
160
	sc.get();
Line 161... Line 161...
161
	bg_col = system.color.work;
161
	bg_col = sc.work;
162
	bg_dark = skin_is_dark();
162
	bg_dark = skin_is_dark();
163
 
163
 
Line 164... Line 164...
164
	semi_white = MixColors(system.color.work, 0xFFFfff, bg_dark*90 + 96);
164
	semi_white = MixColors(sc.work, 0xFFFfff, bg_dark*90 + 96);
165
	Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white);
165
	Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white);
Line 166... Line 166...
166
	Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220));
166
	Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220));
167
 
167
 
Line 168... Line 168...
168
	Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffFFFfff, system.color.work);
168
	Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffFFFfff, sc.work);
Line 284... Line 284...
284
}
284
}
Line 285... Line 285...
285
 
285
 
286
void DrawTopPanelButton(dword _event, _hotkey, _x, _icon_n)
286
void DrawTopPanelButton(dword _event, _hotkey, _x, _icon_n)
287
{
287
{
288
	DrawWideRectangle(_x, 4, 22, 22, 3, semi_white);
288
	DrawWideRectangle(_x, 4, 22, 22, 3, semi_white);
289
	PutPixel(_x,4,system.color.work);
289
	PutPixel(_x,4,sc.work);
290
	PutPixel(_x,4+21,system.color.work);
290
	PutPixel(_x,4+21,sc.work);
291
	PutPixel(_x+21,4,system.color.work);
291
	PutPixel(_x+21,4,sc.work);
292
	PutPixel(_x+21,4+21,system.color.work);
292
	PutPixel(_x+21,4+21,sc.work);
293
	DefineHiddenButton(_x, 4, 21, 21, button.add(_event));
293
	DefineHiddenButton(_x, 4, 21, 21, button.add(_event));
294
	img_draw stdcall(top_icons.image, _x+3, 7, 16, 16, 0, _icon_n*16);
294
	img_draw stdcall(top_icons.image, _x+3, 7, 16, 16, 0, _icon_n*16);
295
	if (_hotkey) key.add_n(_hotkey, _event);
295
	if (_hotkey) key.add_n(_hotkey, _event);
Line 299... Line 299...
299
int DrawFlatPanelButton(dword _id, _x, _y, _text)
299
int DrawFlatPanelButton(dword _id, _x, _y, _text)
300
{
300
{
301
	#define P 10
301
	#define P 10
302
	int w = strlen(_text)*6 + P + P;
302
	int w = strlen(_text)*6 + P + P;
303
	DrawBar(_x, _y, w, 22, semi_white);
303
	DrawBar(_x, _y, w, 22, semi_white);
304
	PutPixel(_x,_y,system.color.work);
304
	PutPixel(_x,_y,sc.work);
305
	PutPixel(_x,_y+21,system.color.work);
305
	PutPixel(_x,_y+21,sc.work);
306
	PutPixel(_x+w-1,_y,system.color.work);
306
	PutPixel(_x+w-1,_y,sc.work);
307
	PutPixel(_x+w-1,_y+21,system.color.work);
307
	PutPixel(_x+w-1,_y+21,sc.work);
308
	DefineHiddenButton(_x, _y, w, 21, _id);
308
	DefineHiddenButton(_x, _y, w, 21, _id);
309
	WriteText(_x+P, _y+7, 0x80, system.color.work_text, _text);
309
	WriteText(_x+P, _y+7, 0x80, sc.work_text, _text);
310
	return w;
310
	return w;
311
}
311
}
Line 312... Line 312...
312
 
312
 
313
void DrawLeftPanelButton(dword _event, _hotkey, _y, _icon_n)
313
void DrawLeftPanelButton(dword _event, _hotkey, _y, _icon_n)
314
{
314
{
315
	int x = 5;
315
	int x = 5;
316
	DrawRectangle(x, _y, 22-1, 22-1, system.color.work);
316
	DrawRectangle(x, _y, 22-1, 22-1, sc.work);
317
	DefineHiddenButton(x, _y, 21, 21, button.add(_event));
317
	DefineHiddenButton(x, _y, 21, 21, button.add(_event));
318
	img_draw stdcall(left_icons.image, x+3, _y+3, 16, 16, 0, _icon_n*16);
318
	img_draw stdcall(left_icons.image, x+3, _y+3, 16, 16, 0, _icon_n*16);
319
	key.add_n(_hotkey, _event);
319
	key.add_n(_hotkey, _event);
320
}
320
}
Line 327... Line 327...
327
		wrapper.x+wrapper.w-calc(strlen(#param)*8) -6 - 1,
327
		wrapper.x+wrapper.w-calc(strlen(#param)*8) -6 - 1,
328
		zoom.y,
328
		zoom.y,
329
		calc(strlen(#param)*8)+6,
329
		calc(strlen(#param)*8)+6,
330
		18,
330
		18,
331
		button.add(#EventCanvasResize),
331
		button.add(#EventCanvasResize),
332
		system.color.work_button,
332
		sc.button,
333
		system.color.work_button_text,
333
		sc.button_text,
334
		#param
334
		#param
335
		);
335
		);
336
}
336
}
Line 341... Line 341...
341
	#define GAPH 27
341
	#define GAPH 27
342
	#define GAPV 28
342
	#define GAPV 28
343
	#define BLOCK_SPACE 10
343
	#define BLOCK_SPACE 10
344
	incn tx;
344
	incn tx;
345
	incn ty;
345
	incn ty;
346
	system.color.get();
346
	sc.get();
347
	DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x73, NULL, T_TITLE, 0);
347
	DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x73, NULL, T_TITLE, 0);
348
	GetProcessInfo(#Form, SelfInfo);
348
	GetProcessInfo(#Form, SelfInfo);
349
	if (Form.status_window>2) return;
349
	if (Form.status_window>2) return;
350
	if (Form.width  < 560) { MoveSize(OLD,OLD,560,OLD); return; }
350
	if (Form.width  < 560) { MoveSize(OLD,OLD,560,OLD); return; }
351
	if (Form.height < 430) { MoveSize(OLD,OLD,OLD,430); return; }
351
	if (Form.height < 430) { MoveSize(OLD,OLD,OLD,430); return; }
352
	button.init(40);
352
	button.init(40);
353
	key.init(40);
353
	key.init(40);
Line 354... Line 354...
354
 
354
 
355
	right_bar.x = Form.cwidth - right_bar.w;
355
	right_bar.x = Form.cwidth - right_bar.w;
356
	b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x;
356
	b_color_gradient.x = b_last_colors.x = b_default_palette.x = right_bar.x;
357
	DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, system.color.work);
357
	DrawBar(0, 0, Form.cwidth, TOPBAR_H-1, sc.work);
Line 358... Line 358...
358
	DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, system.color.work_graph);
358
	DrawBar(0, TOPBAR_H-1, Form.cwidth, 1, sc.work_graph);
359
 
359
 
360
	tx.n = 5-GAPH;
360
	tx.n = 5-GAPH;
361
	DrawTopPanelButton(#EventCreateNewIcon,  ECTRL + SCAN_CODE_KEY_N, tx.inc(GAPH), 2);
361
	DrawTopPanelButton(#EventCreateNewIcon,  ECTRL + SCAN_CODE_KEY_N, tx.inc(GAPH), 2);
Line 376... Line 376...
376
	image_menu_btn.w = DrawFlatPanelButton(button.add(#EventShowImageMenu), image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE);
376
	image_menu_btn.w = DrawFlatPanelButton(button.add(#EventShowImageMenu), image_menu_btn.x, image_menu_btn.y, T_MENU_IMAGE);
377
	//tx.inc(image_menu_btn.w + BLOCK_SPACE);
377
	//tx.inc(image_menu_btn.w + BLOCK_SPACE);
Line 378... Line 378...
378
	
378
	
Line 379... Line 379...
379
	DrawEditArea();
379
	DrawEditArea();
Line 380... Line 380...
380
 
380
 
Line 381... Line 381...
381
	DrawBar(0, TOPBAR_H, LEFTBAR_W-1, Form.cheight - TOPBAR_H, system.color.work);
381
	DrawBar(0, TOPBAR_H, LEFTBAR_W-1, Form.cheight - TOPBAR_H, sc.work);
382
 
382
 
Line 393... Line 393...
393
	DrawLeftPanelSelection();
393
	DrawLeftPanelSelection();
Line 394... Line 394...
394
 
394
 
Line 395... Line 395...
395
	button.add_n(1, #EventExitIconEdit);
395
	button.add_n(1, #EventExitIconEdit);
396
 
396
 
397
	DrawBar(wrapper.x+wrapper.w, TOPBAR_H, Form.cwidth-wrapper.x-wrapper.w,
397
	DrawBar(wrapper.x+wrapper.w, TOPBAR_H, Form.cwidth-wrapper.x-wrapper.w,
398
		Form.cheight - TOPBAR_H, system.color.work);
398
		Form.cheight - TOPBAR_H, sc.work);
399
	DrawActiveColor(right_bar.y);
399
	DrawActiveColor(right_bar.y);
Line 400... Line 400...
400
	DrawColorPallets();
400
	DrawColorPallets();
401
	DrawPreview();
401
	DrawPreview();
402
 
402
 
403
	DrawBar(LEFTBAR_W-1, wrapper.y + wrapper.h, wrapper.w+1, 
403
	DrawBar(LEFTBAR_W-1, wrapper.y + wrapper.h, wrapper.w+1, 
Line 404... Line 404...
404
		Form.cheight - wrapper.y - wrapper.h, system.color.work);
404
		Form.cheight - wrapper.y - wrapper.h, sc.work);
405
	DrawStatusBar();
405
	DrawStatusBar();
406
}
406
}
407
 
407
 
408
void DrawLeftPanelSelection()
408
void DrawLeftPanelSelection()
Line 409... Line 409...
409
{
409
{
410
	if (previousTool!=-1) DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, 16+3+2, 16+3+2, system.color.work, system.color.work);
410
	if (previousTool!=-1) DrawRectangle3D(5, previousTool*GAPV+right_bar.y-2, 16+3+2, 16+3+2, sc.work, sc.work);
Line 435... Line 435...
435
	//}
435
	//}
Line 436... Line 436...
436
 
436
 
437
	left_side = canvas.x-wrapper.x-1;
437
	left_side = canvas.x-wrapper.x-1;
Line 438... Line 438...
438
	top_side = canvas.y-wrapper.y-1;
438
	top_side = canvas.y-wrapper.y-1;
Line 439... Line 439...
439
 
439
 
440
	DrawRectangle(wrapper.x-1, wrapper.y-1, wrapper.w, wrapper.h, system.color.work_graph);
440
	DrawRectangle(wrapper.x-1, wrapper.y-1, wrapper.w, wrapper.h, sc.work_graph);
441
 
441
 
442
	if (left_side>0)
442
	if (left_side>0)
Line 466... Line 466...
466
 
466
 
467
	DrawFrame(right_bar.x+CELL+5, outy, CELL, CELL, NULL);
467
	DrawFrame(right_bar.x+CELL+5, outy, CELL, CELL, NULL);
Line 468... Line 468...
468
	DrawBar(right_bar.x+CELL+5+2, outy+2, CELL-4, CELL-4, color2);
468
	DrawBar(right_bar.x+CELL+5+2, outy+2, CELL-4, CELL-4, color2);
469
 
469
 
470
	//sprintf(#param, "%A", color1);
470
	//sprintf(#param, "%A", color1);
471
	//WriteTextWithBg(right_bar.x+30, outy+3, 0xD0, system.color.work_text, #param+4, system.color.work);
471
	//WriteTextWithBg(right_bar.x+30, outy+3, 0xD0, sc.work_text, #param+4, sc.work);
Line 472... Line 472...
472
	DrawCurrentColorGradient();
472
	DrawCurrentColorGradient();
473
}
473
}
Line 508... Line 508...
508
{
508
{
509
	int i;
509
	int i;
510
	for (i=0 ; i
510
	for (i=0 ; i
511
		DrawBar(b_color_gradient.x+i, b_color_gradient.y, 1, b_color_gradient.h, linear_gradient[i]);		
511
		DrawBar(b_color_gradient.x+i, b_color_gradient.y, 1, b_color_gradient.h, linear_gradient[i]);		
512
	}
512
	}
513
	DrawGradientMarker(old_marker_pos, system.color.work);
513
	DrawGradientMarker(old_marker_pos, sc.work);
514
	old_marker_pos = DrawGradientMarker(lmax, 0xFFFfff * bg_dark);
514
	old_marker_pos = DrawGradientMarker(lmax, 0xFFFfff * bg_dark);
515
}
515
}
Line 516... Line 516...
516
 
516
 
517
void DrawColorPallets()
517
void DrawColorPallets()
Line 618... Line 618...
618
			DefineAndDrawWindow(Form.left+100, Form.top+100, preview_size*2+9,
618
			DefineAndDrawWindow(Form.left+100, Form.top+100, preview_size*2+9,
619
				preview_size*2+skin_height+4, 0x74, NULL, T_TEST_ICON, 0);
619
				preview_size*2+skin_height+4, 0x74, NULL, T_TEST_ICON, 0);
620
			DrawImageWithBg(0, 0, 0x000000);
620
			DrawImageWithBg(0, 0, 0x000000);
621
			DrawImageWithBg(1, 0, 0xFFFfff);
621
			DrawImageWithBg(1, 0, 0xFFFfff);
622
			DrawImageWithBg(0, 1, GetPixelColorFromScreen(0, 0));
622
			DrawImageWithBg(0, 1, GetPixelColorFromScreen(0, 0));
623
			DrawImageWithBg(1, 1, system.color.work);
623
			DrawImageWithBg(1, 1, sc.work);
624
			break;
624
			break;
625
	}
625
	}
626
}
626
}
Line 627... Line 627...
627
 
627