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:
Anton Krotov 2021-11-21 16:54:07 +00:00
parent 53fd96fe51
commit 413de97517
5 changed files with 22 additions and 19 deletions

Binary file not shown.

View File

@ -28,7 +28,7 @@ IMPORT
RW, Ini, EB := EditBox, Icons, Tabs, Timer; RW, Ini, EB := EditBox, Icons, Tabs, Timer;
CONST CONST
HEADER = "CEdit (03-oct-2021)"; HEADER = "CEdit (21-nov-2021)";
ShellFilter = ""; ShellFilter = "";
EditFilter = "SH|INC|TXT|ASM|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON"; EditFilter = "SH|INC|TXT|ASM|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON";
@ -2010,6 +2010,7 @@ VAR
i: INTEGER; i: INTEGER;
BEGIN BEGIN
K.GetSystemColors; K.GetSystemColors;
Icons.get(icons, grayIcons);
FOR i := 0 TO 1 DO FOR i := 0 TO 1 DO
IF ~K.RolledUp() THEN IF ~K.RolledUp() THEN
K.ClientSize(width, height); K.ClientSize(width, height);

View File

@ -105,7 +105,7 @@ BEGIN
X2 := MIN(MAX(x1, x2), canvas.width - 1); X2 := MIN(MAX(x1, x2), canvas.width - 1);
IF (0 <= y) & (y < canvas.height) THEN IF (0 <= y) & (y < canvas.height) THEN
color := canvas.color; 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 FOR i := X1 TO X2 DO
SYSTEM.PUT32(ptr, color); SYSTEM.PUT32(ptr, color);
INC(ptr, 4) INC(ptr, 4)
@ -124,7 +124,7 @@ BEGIN
Y2 := MIN(MAX(y1, y2), canvas.height - 1); Y2 := MIN(MAX(y1, y2), canvas.height - 1);
IF (0 <= x) & (x < canvas.width) THEN IF (0 <= x) & (x < canvas.width) THEN
color := canvas.color; 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 FOR i := Y1 TO Y2 DO
IF canvas.mode = modeNOT THEN IF canvas.mode = modeNOT THEN
SYSTEM.GET32(ptr, color); SYSTEM.GET32(ptr, color);
@ -168,11 +168,11 @@ VAR
d: INTEGER; d: INTEGER;
BEGIN BEGIN
color := canvas.color; color := canvas.color;
ptr := canvas.bitmap + y*canvas.width*4 + x1*4; ptr := canvas.bitmap + 4*(y*canvas.width + x1);
IF k = -1 THEN IF k = -1 THEN
d := canvas.width*4 + 4 d := 4*(canvas.width + 1)
ELSIF k = 1 THEN ELSIF k = 1 THEN
d := 4 - canvas.width*4 d := 4*(1 - canvas.width)
END; END;
WHILE x1 <= x2 DO WHILE x1 <= x2 DO
SYSTEM.PUT32(ptr, color); SYSTEM.PUT32(ptr, color);

View File

@ -30,7 +30,7 @@ VAR
winColor*, textColor*, btnColor*, btnTextColor*, winColor*, textColor*, btnColor*, btnTextColor*,
toolbarColor*, scrollColor*, scrollBkColor*, toolbarColor*, scrollColor*, scrollBkColor*,
borderColor*, shadowColor*, darkColor*, lightColor*, borderColor*, shadowColor*, (*darkColor,*) lightColor*,
caseColor*, disCaseColor*: INTEGER; caseColor*, disCaseColor*: INTEGER;
@ -343,7 +343,7 @@ BEGIN
ASSERT(LEN(buf) >= 10); ASSERT(LEN(buf) >= 10);
KOSAPI.sysfunc4(48, 3, SYSTEM.ADR(buf[0]), 40); KOSAPI.sysfunc4(48, 3, SYSTEM.ADR(buf[0]), 40);
darkColor := buf[2]; (*darkColor := buf[2];*)
lightColor := buf[3]; lightColor := buf[3];
winColor := buf[5]; winColor := buf[5];
textColor := buf[8]; textColor := buf[8];
@ -353,10 +353,10 @@ BEGIN
scrollBkColor := winColor; scrollBkColor := winColor;
borderColor := buf[9]; borderColor := buf[9];
toolbarColor := 0DFDFDFH; toolbarColor := lightColor;(*0DFDFDFH;*)
shadowColor := 0808080H; shadowColor := borderColor;(*0808080H;*)
caseColor := 00000FFH; caseColor := 00000FFH;
disCaseColor := 0808080H; disCaseColor := borderColor;(*0808080H*)
END GetSystemColors; END GetSystemColors;

View File

@ -1965,17 +1965,19 @@ END selectWord;
PROCEDURE cursor (text: tText); PROCEDURE cursor (text: tText);
VAR VAR
x, y, h: INTEGER; x, y1, y2, scrollX, scrollY: INTEGER;
cursor: pPoint; cursor: pPoint;
BEGIN BEGIN
cursor := text.cursor; cursor := text.cursor;
IF ~((text.scroll.Y > cursor.Y) OR (text.scroll.Y + textsize.Y <= cursor.Y) OR scrollX := text.scroll.X;
(text.scroll.X > cursor.X) OR (text.scroll.X + textsize.X <= cursor.X)) THEN scrollY := text.scroll.Y;
x := (cursor.X - text.scroll.X)*charWidth + padding.left; IF ~((scrollY > cursor.Y) OR (scrollY + textsize.Y <= cursor.Y) OR
y := (cursor.Y - text.scroll.Y)*charHeight + 1 + padding.top; (scrollX > cursor.X) OR (scrollX + textsize.X <= cursor.X)) THEN
h := charHeight - 2; x := (cursor.X - scrollX)*charWidth + padding.left;
G.notVLine(canvas, x, y + inter DIV 2, y + h - inter DIV 2); y1 := (cursor.Y - scrollY)*charHeight + padding.top + (inter DIV 2 + 1);
G.notVLine(canvas, x - 1, y + inter DIV 2, y + h - inter DIV 2) y2 := y1 + charHeight - (inter + 2);
G.notVLine(canvas, x, y1, y2);
G.notVLine(canvas, x - 1, y1, y2)
END END
END cursor; END cursor;