forked from KolibriOS/kolibrios
CEdit: toolbar uses system colors, disabled runtime checking
git-svn-id: svn://kolibrios.org@9295 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
53fd96fe51
commit
413de97517
Binary file not shown.
@ -28,7 +28,7 @@ IMPORT
|
||||
RW, Ini, EB := EditBox, Icons, Tabs, Timer;
|
||||
|
||||
CONST
|
||||
HEADER = "CEdit (03-oct-2021)";
|
||||
HEADER = "CEdit (21-nov-2021)";
|
||||
|
||||
ShellFilter = "";
|
||||
EditFilter = "SH|INC|TXT|ASM|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON";
|
||||
@ -2010,6 +2010,7 @@ VAR
|
||||
i: INTEGER;
|
||||
BEGIN
|
||||
K.GetSystemColors;
|
||||
Icons.get(icons, grayIcons);
|
||||
FOR i := 0 TO 1 DO
|
||||
IF ~K.RolledUp() THEN
|
||||
K.ClientSize(width, height);
|
||||
|
@ -105,7 +105,7 @@ BEGIN
|
||||
X2 := MIN(MAX(x1, x2), canvas.width - 1);
|
||||
IF (0 <= y) & (y < canvas.height) THEN
|
||||
color := canvas.color;
|
||||
ptr := canvas.bitmap + y*canvas.width*4 + X1*4;
|
||||
ptr := canvas.bitmap + 4*(y*canvas.width + X1);
|
||||
FOR i := X1 TO X2 DO
|
||||
SYSTEM.PUT32(ptr, color);
|
||||
INC(ptr, 4)
|
||||
@ -124,7 +124,7 @@ BEGIN
|
||||
Y2 := MIN(MAX(y1, y2), canvas.height - 1);
|
||||
IF (0 <= x) & (x < canvas.width) THEN
|
||||
color := canvas.color;
|
||||
ptr := canvas.bitmap + Y1*canvas.width*4 + x*4;
|
||||
ptr := canvas.bitmap + 4*(Y1*canvas.width + x);
|
||||
FOR i := Y1 TO Y2 DO
|
||||
IF canvas.mode = modeNOT THEN
|
||||
SYSTEM.GET32(ptr, color);
|
||||
@ -168,11 +168,11 @@ VAR
|
||||
d: INTEGER;
|
||||
BEGIN
|
||||
color := canvas.color;
|
||||
ptr := canvas.bitmap + y*canvas.width*4 + x1*4;
|
||||
ptr := canvas.bitmap + 4*(y*canvas.width + x1);
|
||||
IF k = -1 THEN
|
||||
d := canvas.width*4 + 4
|
||||
d := 4*(canvas.width + 1)
|
||||
ELSIF k = 1 THEN
|
||||
d := 4 - canvas.width*4
|
||||
d := 4*(1 - canvas.width)
|
||||
END;
|
||||
WHILE x1 <= x2 DO
|
||||
SYSTEM.PUT32(ptr, color);
|
||||
|
@ -30,7 +30,7 @@ VAR
|
||||
|
||||
winColor*, textColor*, btnColor*, btnTextColor*,
|
||||
toolbarColor*, scrollColor*, scrollBkColor*,
|
||||
borderColor*, shadowColor*, darkColor*, lightColor*,
|
||||
borderColor*, shadowColor*, (*darkColor,*) lightColor*,
|
||||
caseColor*, disCaseColor*: INTEGER;
|
||||
|
||||
|
||||
@ -343,7 +343,7 @@ BEGIN
|
||||
ASSERT(LEN(buf) >= 10);
|
||||
KOSAPI.sysfunc4(48, 3, SYSTEM.ADR(buf[0]), 40);
|
||||
|
||||
darkColor := buf[2];
|
||||
(*darkColor := buf[2];*)
|
||||
lightColor := buf[3];
|
||||
winColor := buf[5];
|
||||
textColor := buf[8];
|
||||
@ -353,10 +353,10 @@ BEGIN
|
||||
scrollBkColor := winColor;
|
||||
borderColor := buf[9];
|
||||
|
||||
toolbarColor := 0DFDFDFH;
|
||||
shadowColor := 0808080H;
|
||||
toolbarColor := lightColor;(*0DFDFDFH;*)
|
||||
shadowColor := borderColor;(*0808080H;*)
|
||||
caseColor := 00000FFH;
|
||||
disCaseColor := 0808080H;
|
||||
disCaseColor := borderColor;(*0808080H*)
|
||||
END GetSystemColors;
|
||||
|
||||
|
||||
|
@ -1965,17 +1965,19 @@ END selectWord;
|
||||
|
||||
PROCEDURE cursor (text: tText);
|
||||
VAR
|
||||
x, y, h: INTEGER;
|
||||
x, y1, y2, scrollX, scrollY: INTEGER;
|
||||
cursor: pPoint;
|
||||
BEGIN
|
||||
cursor := text.cursor;
|
||||
IF ~((text.scroll.Y > cursor.Y) OR (text.scroll.Y + textsize.Y <= cursor.Y) OR
|
||||
(text.scroll.X > cursor.X) OR (text.scroll.X + textsize.X <= cursor.X)) THEN
|
||||
x := (cursor.X - text.scroll.X)*charWidth + padding.left;
|
||||
y := (cursor.Y - text.scroll.Y)*charHeight + 1 + padding.top;
|
||||
h := charHeight - 2;
|
||||
G.notVLine(canvas, x, y + inter DIV 2, y + h - inter DIV 2);
|
||||
G.notVLine(canvas, x - 1, y + inter DIV 2, y + h - inter DIV 2)
|
||||
scrollX := text.scroll.X;
|
||||
scrollY := text.scroll.Y;
|
||||
IF ~((scrollY > cursor.Y) OR (scrollY + textsize.Y <= cursor.Y) OR
|
||||
(scrollX > cursor.X) OR (scrollX + textsize.X <= cursor.X)) THEN
|
||||
x := (cursor.X - scrollX)*charWidth + padding.left;
|
||||
y1 := (cursor.Y - scrollY)*charHeight + padding.top + (inter DIV 2 + 1);
|
||||
y2 := y1 + charHeight - (inter + 2);
|
||||
G.notVLine(canvas, x, y1, y2);
|
||||
G.notVLine(canvas, x - 1, y1, y2)
|
||||
END
|
||||
END cursor;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user