CEdit: fixed window redrawing

git-svn-id: svn://kolibrios.org@9526 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Anton Krotov 2021-12-30 11:11:45 +00:00
parent df6ac3618c
commit 2a142bd532
3 changed files with 28 additions and 27 deletions

Binary file not shown.

View File

@ -28,7 +28,7 @@ IMPORT
RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar; RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar;
CONST CONST
HEADER = "CEdit (29-dec-2021)"; HEADER = "CEdit (30-dec-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";
@ -171,6 +171,7 @@ CONST
VAR VAR
header: RW.tFileName;
canvas: G.tCanvas; canvas: G.tCanvas;
font, font1, font2: G.tFont; font, font1, font2: G.tFont;
@ -330,14 +331,17 @@ END getIdx;
PROCEDURE SetCaption (fileName: RW.tFileName); PROCEDURE SetCaption (fileName: RW.tFileName);
VAR VAR
header: RW.tFileName; newHeader: RW.tFileName;
BEGIN BEGIN
header := HEADER; newHeader := HEADER;
IF text.fileName # "" THEN IF text.fileName # "" THEN
U.append8(header, " - "); U.append8(newHeader, " - ");
U.append8(header, text.fileName) U.append8(newHeader, text.fileName)
END; END;
IF newHeader # header THEN
header := newHeader;
K.SetCaption(header) K.SetCaption(header)
END
END SetCaption; END SetCaption;
@ -502,10 +506,10 @@ BEGIN
confirm := FALSE; confirm := FALSE;
K.ClientSize(width, height); K.ClientSize(width, height);
K.DrawRect(0, 0, width, TOP, K.winColor); K.DrawRect(0, 0, width, TOP - 1, K.winColor);
K.DrawRect(0, 0, LEFT, height, K.winColor); K.DrawRect(0, 0, LEFT, height, K.winColor);
K.DrawRect(width - RIGHT_PADDING, 0, RIGHT_PADDING, height, K.winColor); K.DrawRect(width - RIGHT_PADDING, 0, RIGHT_PADDING, height, K.winColor);
K.DrawRect(LEFT + canvas.width + 1, TOP + canvas.height, scrollWidth - 1, scrollWidth, K.winColor); K.DrawRect(LEFT + canvas.width + 1, TOP + canvas.height + 1, scrollWidth - 1, scrollWidth - 1, K.winColor);
Menu.DrawMain(mainMenu); Menu.DrawMain(mainMenu);
Toolbar.draw(toolbar); Toolbar.draw(toolbar);
@ -1906,11 +1910,8 @@ END MouseEvent;
PROCEDURE Redraw (VAR resized: BOOLEAN; VAR width, height, cliWidth, cliHeight: INTEGER); PROCEDURE Redraw (VAR resized: BOOLEAN; VAR width, height, cliWidth, cliHeight: INTEGER);
VAR
i: INTEGER;
BEGIN BEGIN
K.GetSystemColors; K.GetSystemColors;
FOR i := 0 TO 1 DO
IF ~K.RolledUp() THEN IF ~K.RolledUp() THEN
K.ClientSize(width, height); K.ClientSize(width, height);
IF (width # cliWidth) OR (height # cliHeight) THEN IF (width # cliWidth) OR (height # cliHeight) THEN
@ -1925,7 +1926,6 @@ BEGIN
K.SetEventsMask({0, 30, 31}) K.SetEventsMask({0, 30, 31})
END; END;
draw_window draw_window
END
END Redraw; END Redraw;
@ -1951,6 +1951,7 @@ VAR
resized: BOOLEAN; resized: BOOLEAN;
firstClickX, firstClickY, time: INTEGER; firstClickX, firstClickY, time: INTEGER;
BEGIN BEGIN
header := "";
K.GetSystemColors; K.GetSystemColors;
switch := FALSE; switch := FALSE;
closing := FALSE; closing := FALSE;
@ -2044,7 +2045,7 @@ BEGIN
insert(0, text); insert(0, text);
Scroll.init(ScrollChange); Scroll.init(ScrollChange);
Scroll.create(FALSE, canvas.width + 1, scrollWidth, scrollWidth, scrollWidth*3 DIV 2, hScroll); Scroll.create(FALSE, canvas.width + 1, scrollWidth, scrollWidth, scrollWidth*3 DIV 2, hScroll);
Scroll.create(TRUE, scrollWidth, canvas.height + 1, scrollWidth, scrollWidth*3 DIV 2, vScroll); Scroll.create(TRUE, scrollWidth, canvas.height + 2, scrollWidth, scrollWidth*3 DIV 2, vScroll);
T.resize(canvas.width, canvas.height); T.resize(canvas.width, canvas.height);
T.SetPos(text, 0, 0); T.SetPos(text, 0, 0);
confirm := FALSE; confirm := FALSE;

View File

@ -69,7 +69,7 @@ BEGIN
x2 := x + width - 1; x2 := x + width - 1;
y2 := y + height - 1; y2 := y + height - 1;
K.DrawRect(x, y, width, height,color); K.DrawRect(x, y, width, height, color);
K.DrawLine(x, y, x2, y, K.borderColor); K.DrawLine(x, y, x2, y, K.borderColor);
K.DrawLine(x2, y, x2, y2, K.borderColor); K.DrawLine(x2, y, x2, y2, K.borderColor);
IF id # t.current THEN IF id # t.current THEN