CEdit: setting current folder when running script; added build/run scripts

git-svn-id: svn://kolibrios.org@9630 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Anton Krotov 2022-01-13 15:13:47 +00:00
parent 235d20b0d6
commit 28e207c0cc
8 changed files with 38 additions and 24 deletions

View File

@ -0,0 +1,3 @@
#SHS
/kolibrios/develop/oberon07/compiler.kex ./src/cedit.ob07 kosexe -out /tmp0/1/cedit.kex -stk 1 -nochk a
exit

Binary file not shown.

View File

@ -0,0 +1,3 @@
#SHS
/tmp0/1/cedit.kex
exit

View File

@ -182,7 +182,7 @@ VAR
winWidth, winHeight: INTEGER;
SkinHeight: INTEGER;
AppPath, runScript, buildScript, debugScript: RW.tFileName;
AppPath, runScript, buildScript, debugScript, CurFolder: RW.tFileName;
OD: OpenDlg.Dialog;
confirm, notFound, menuFindClicked, search, searchOpened: BOOLEAN;
@ -243,7 +243,7 @@ BEGIN
EXCL(edit.flags, 1)
END;
IF search & searchOpened THEN
EB.paint(edit)
EB.draw(edit)
END
END EditBox_SetFocus;
@ -367,7 +367,7 @@ BEGIN
scroll.left := left;
scroll.top := top;
Scroll.setValue(scroll, value);
Scroll.paint(scroll)
Scroll.draw(scroll)
END DrawScroll;
@ -400,9 +400,9 @@ BEGIN
DrawScroll(vScroll, LEFT + canvas.width, TOP - 1, scrollY, text.count - 1);
DrawScroll(hScroll, LEFT, TOP + canvas.height, scrollX, text.maxLength);
IF search & searchOpened THEN
CheckBox.paint(BKW);
CheckBox.paint(CS);
CheckBox.paint(WH);
CheckBox.draw(BKW);
CheckBox.draw(CS);
CheckBox.draw(WH);
END;
G.SetColor(canvas, K.colors.line);
@ -485,9 +485,9 @@ BEGIN
FindEdit.left := left;
ReplaceEdit.left := left;
GotoEdit.left := left;
EB.paint(FindEdit);
EB.paint(ReplaceEdit);
EB.paint(GotoEdit);
EB.draw(FindEdit);
EB.draw(ReplaceEdit);
EB.draw(GotoEdit);
y := top + 200;
K.CreateButton(btnFindNext, left, y, btnWidth, btnHeight, K.colors.button, "next"); INC(y, btnHeight + 10);
K.CreateButton(btnReplace, left, y, btnWidth, btnHeight, K.colors.button, "replace"); INC(y, btnHeight + 10);
@ -948,6 +948,8 @@ END goto;
PROCEDURE Script (script: ARRAY OF CHAR);
BEGIN
IF script # "" THEN
U.getPath(script, CurFolder);
K.SetCurFolder(CurFolder);
K.Run("/sys/@open", script)
END
END Script;

View File

@ -42,7 +42,7 @@ TYPE
END;
PROCEDURE paint* (chkbox: tCheckBox);
PROCEDURE draw* (chkbox: tCheckBox);
VAR
canvas: G.tCanvas;
BEGIN
@ -70,7 +70,7 @@ BEGIN
G.TextOut2(canvas, fontHeight + padding, 0, chkbox.text, LENGTH(chkbox.text));
G.DrawCanvas(canvas, chkbox.left, chkbox.top)
END
END paint;
END draw;
PROCEDURE create* (text: ARRAY OF WCHAR; VAR chkbox: tCheckBox);
@ -104,7 +104,7 @@ BEGIN
IF U.between(0, x, chkbox.width - 1) & U.between(0, y, chkbox.height - 1) THEN
chkbox.value := ~chkbox.value;
END;
paint(chkbox)
draw(chkbox)
END
ELSE
chkbox.mouse := FALSE

View File

@ -51,7 +51,7 @@ TYPE
VAR
paint *: PROCEDURE (eb: tEditBox);
draw *: PROCEDURE (eb: tEditBox);
mouse *: PROCEDURE (eb: tEditBox);
_setValue : PROCEDURE (eb: tEditBox; text: INTEGER);
key *: PROCEDURE (eb: tEditBox; key: INTEGER);
@ -124,7 +124,7 @@ VAR
BEGIN
Lib := KOSAPI.LoadLib("/sys/lib/box_lib.obj");
ASSERT(Lib # 0);
GetProc(Lib, SYSTEM.ADR(paint), "edit_box_draw");
GetProc(Lib, SYSTEM.ADR(draw), "edit_box_draw");
GetProc(Lib, SYSTEM.ADR(key), "edit_box_key_safe");
GetProc(Lib, SYSTEM.ADR(mouse), "edit_box_mouse");
GetProc(Lib, SYSTEM.ADR(_setValue), "edit_box_set_text");

View File

@ -268,6 +268,12 @@ BEGIN
END Run;
PROCEDURE SetCurFolder* (folder: ARRAY OF CHAR);
BEGIN
KOSAPI.sysfunc3(30, 1, SYSTEM.ADR(folder[0]));
END SetCurFolder;
PROCEDURE DrawRect* (x, y, width, height, color: INTEGER);
BEGIN
KOSAPI.sysfunc4(13, x*65536 + width, y*65536 + height, color)

View File

@ -81,7 +81,7 @@ BEGIN
END Rect;
PROCEDURE _paint (scroll: tScroll);
PROCEDURE _draw (scroll: tScroll);
VAR
canvas: G.tCanvas;
x, y, d, x1, x2, y1, y2,
@ -164,15 +164,15 @@ BEGIN
G.Triangle(canvas, x, y1 - 1, x, y2, G.triRight);
END;
G.DrawCanvas(scroll.canvas, scroll.left, scroll.top)
END _paint;
END _draw;
PROCEDURE paint* (scroll: tScroll);
PROCEDURE draw* (scroll: tScroll);
BEGIN
IF scroll.canvas # NIL THEN
_paint(scroll)
_draw(scroll)
END
END paint;
END draw;
PROCEDURE resize* (VAR scroll: tScroll; width, height: INTEGER);
@ -181,7 +181,7 @@ BEGIN
scroll.canvas := G.CreateCanvas(width, height);
scroll.width := width;
scroll.height := height;
paint(scroll)
draw(scroll)
END resize;
@ -226,7 +226,7 @@ BEGIN
ELSIF scroll.Dec THEN
setValue(scroll, scroll.value - 1)
END;
paint(scroll)
draw(scroll)
END change;
@ -302,7 +302,7 @@ BEGIN
c := x - scroll.left
END;
setPos(scroll, scroll.pos0 + c - scroll.Slider);
paint(scroll)
draw(scroll)
END MouseMove;
@ -368,7 +368,7 @@ BEGIN
setPos(scroll, c - scroll.btnSize - scroll.sliderSize DIV 2);
scroll.pos0 := scroll.pos;
scroll.Slider := c;
paint(scroll)
draw(scroll)
END
END
END MouseDown;
@ -388,7 +388,7 @@ BEGIN
END
ELSIF scroll.mouse THEN
MouseUp(scroll);
paint(scroll)
draw(scroll)
END
END mouse;