Subversion Repositories Kolibri OS

Rev

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

Rev 9730 Rev 9731
Line 146... Line 146...
146
PROCEDURE drawMainItem (item: tMainItem);
146
PROCEDURE drawMainItem (item: tMainItem);
147
VAR
147
VAR
148
    menuColor, textColor, n: INTEGER;
148
	menuColor, textColor, n: INTEGER;
149
    canvas: G.tCanvas;
149
	canvas: G.tCanvas;
150
BEGIN
150
BEGIN
151
    IF item.menu.tid # 0 THEN
151
	IF item.selected OR (item.menu.tid # 0) THEN
152
        menuColor := K.colors.work_text;
-
 
153
        textColor := K.colors.work
-
 
154
    ELSE
-
 
155
    	IF item.selected THEN
-
 
156
	        menuColor := K.colors.button;
152
		menuColor := K.colors.button;
157
	        textColor := K.colors.button_text
153
		textColor := K.colors.button_text
158
    	ELSE
154
	ELSE
159
	        menuColor := K.colors.work;
155
		menuColor := K.colors.work;
160
	        textColor := K.colors.work_text
156
		textColor := K.colors.work_text
161
        END
-
 
162
    END;
157
	END;
163
    n := LENGTH(item.text);
158
	n := LENGTH(item.text);
164
    canvas := item.main.canvas;
159
	canvas := item.main.canvas;
165
    G.SetColor(canvas, menuColor);
160
	G.SetColor(canvas, menuColor);
166
    G.FillRect(canvas, item.x, 0, item.x + n*fontWidth + 2, MainMenuHeight - 1);
161
	G.FillRect(canvas, item.x, 0, item.x + n*fontWidth + 2, MainMenuHeight - 1);
Line 191... Line 186...
191
	item: tMainItem;
186
	item: tMainItem;
192
BEGIN
187
BEGIN
193
	item := main.first(tMainItem);
188
	item := main.first(tMainItem);
194
	WHILE item # NIL DO
189
	WHILE item # NIL DO
195
		item.selected :=
190
		item.selected :=
196
			U.between(item.x, x, item.x + LENGTH(item.text)*fontWidth - 1) &
191
			U.between(item.x, x, item.x + LENGTH(item.text)*fontWidth + 1) &
197
				U.between(0, y, MainMenuHeight - 1);
192
				U.between(0, y, MainMenuHeight - 1);
198
		drawMainItem(item);
193
		drawMainItem(item);
199
		item := item.next(tMainItem)
194
		item := item.next(tMainItem)
200
	END;
195
	END;
201
	G.DrawCanvas(main.canvas, 0, 0)
196
	G.DrawCanvas(main.canvas, 0, 0)