Subversion Repositories Kolibri OS

Rev

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

Rev 9630 Rev 9659
Line 32... Line 32...
32
 
32
 
33
TYPE
33
TYPE
Line 34... Line 34...
34
	tCheckBox* = RECORD
34
	tCheckBox* = RECORD
35
 
-
 
36
		left*, top*: INTEGER;
35
 
37
		width, height: INTEGER;
36
		left*, top*: INTEGER;
38
		value*, mouse: BOOLEAN;
37
		value*, mouse: BOOLEAN;
Line 39... Line 38...
39
		text: ARRAY 32 OF WCHAR;
38
		text: ARRAY 32 OF WCHAR;
Line 82... Line 81...
82
	res.value := FALSE;
81
	res.value := FALSE;
83
	res.mouse := FALSE;
82
	res.mouse := FALSE;
84
	COPY(text, res.text);
83
	COPY(text, res.text);
85
	res.canvas := G.CreateCanvas(fontHeight + padding + LENGTH(res.text)*fontWidth, fontHeight + 1);
84
	res.canvas := G.CreateCanvas(fontHeight + padding + LENGTH(res.text)*fontWidth, fontHeight + 1);
86
	G.SetFont(res.canvas, G.CreateFont(1, "", {}));
85
	G.SetFont(res.canvas, G.CreateFont(1, "", {}));
87
	res.width := res.canvas.width;
-
 
88
	res.height := res.canvas.height;
-
 
89
	chkbox := res
86
	chkbox := res
90
END create;
87
END create;
Line 91... Line 88...
91
 
88
 
Line 99... Line 96...
99
	IF 0 IN msState THEN
96
	IF 0 IN msState THEN
100
		IF (chkbox.canvas # NIL) & ~chkbox.mouse THEN
97
		IF (chkbox.canvas # NIL) & ~chkbox.mouse THEN
101
			DEC(x, chkbox.left);
98
			DEC(x, chkbox.left);
102
			DEC(y, chkbox.top);
99
			DEC(y, chkbox.top);
103
			chkbox.mouse := TRUE;
100
			chkbox.mouse := TRUE;
104
			IF U.between(0, x, chkbox.width - 1) & U.between(0, y, chkbox.height - 1) THEN
101
			IF U.between(0, x, chkbox.canvas.width - 1) & U.between(0, y, chkbox.canvas.height - 1) THEN
105
				chkbox.value := ~chkbox.value;
102
				chkbox.value := ~chkbox.value
106
			END;
103
			END;
107
			draw(chkbox)
104
			draw(chkbox)
108
		END
105
		END
109
	ELSE
106
	ELSE
110
		chkbox.mouse := FALSE
107
		chkbox.mouse := FALSE