Subversion Repositories Kolibri OS

Rev

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

Rev 7031 Rev 7086
Line 11... Line 11...
11
 
11
 
12
#ifndef INCLUDE_RGB_H
12
#ifndef INCLUDE_RGB_H
13
#include "../lib/patterns/rgb.h"
13
#include "../lib/patterns/rgb.h"
Line -... Line 14...
-
 
14
#endif
-
 
15
 
-
 
16
#ifndef INCLUDE_MATH_H
-
 
17
#include "../lib/math.h"
14
#endif
18
#endif
15
 
19
 
16
:void DrawRectangle(dword x,y,w,h,color1)
20
:void DrawRectangle(dword x,y,w,h,color1)
17
{
21
{
18
	if (w<=0) || (h<=0) return;
22
	if (w<=0) || (h<=0) return;
Line 399... Line 403...
399
	if (N==active_tab) return false;
403
	if (N==active_tab) return false;
400
	active_tab = N;
404
	active_tab = N;
401
	return true;
405
	return true;
402
}
406
}
Line -... Line 407...
-
 
407
 
-
 
408
/*=========================================================
-
 
409
==
-
 
410
==                   MORE LESS BOX
-
 
411
==
-
 
412
/========================================================*/
-
 
413
 
-
 
414
struct more_less_box
-
 
415
{
-
 
416
	signed x,y;
-
 
417
	unsigned value, min, max;
-
 
418
	unsigned bt_id_more, bt_id_less;
-
 
419
	dword text;
-
 
420
	void click();
-
 
421
	void draw();
-
 
422
};
-
 
423
 
-
 
424
void more_less_box::click(unsigned id)
-
 
425
{
-
 
426
	if (id==bt_id_less) { value = math.max(value-1, min); draw(); }
-
 
427
	if (id==bt_id_more) { value = math.min(value+1, max); draw(); }
-
 
428
}
-
 
429
 
-
 
430
void more_less_box::draw()
-
 
431
{
-
 
432
	#define VALUE_FIELD_W 34
-
 
433
	#define SIZE 18
-
 
434
	dword value_text = itoa(value);
-
 
435
 
-
 
436
	DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph);
-
 
437
	DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff);
-
 
438
	DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
-
 
439
	WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text);
-
 
440
 
-
 
441
	DrawCaptButton(VALUE_FIELD_W + x + 1,    y, SIZE, SIZE, bt_id_more, system.color.work_button, system.color.work_button_text, "+");
-
 
442
	DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, bt_id_less, system.color.work_button, system.color.work_button_text, "-");
-
 
443
	EDI = system.color.work;
-
 
444
	WriteText(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text);
-
 
445
	DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
-
 
446
}
-
 
447
 
Line 403... Line 448...
403
 
448
 
404
 
449