diff --git a/programs/develop/cedit/BUILD.SH b/programs/develop/cedit/BUILD.SH new file mode 100644 index 0000000000..87bfae436b --- /dev/null +++ b/programs/develop/cedit/BUILD.SH @@ -0,0 +1,3 @@ +#SHS +/kolibrios/develop/oberon07/compiler.kex ./src/cedit.ob07 kosexe -out /tmp0/1/cedit.kex -stk 1 -nochk a +exit \ No newline at end of file diff --git a/programs/develop/cedit/CEDIT b/programs/develop/cedit/CEDIT index 8a78321d38..923bd11556 100644 Binary files a/programs/develop/cedit/CEDIT and b/programs/develop/cedit/CEDIT differ diff --git a/programs/develop/cedit/RUN.SH b/programs/develop/cedit/RUN.SH new file mode 100644 index 0000000000..fa89aeba44 --- /dev/null +++ b/programs/develop/cedit/RUN.SH @@ -0,0 +1,3 @@ +#SHS +/tmp0/1/cedit.kex +exit \ No newline at end of file diff --git a/programs/develop/cedit/SRC/CEdit.ob07 b/programs/develop/cedit/SRC/CEdit.ob07 index 67e5cb17be..bca7532794 100644 --- a/programs/develop/cedit/SRC/CEdit.ob07 +++ b/programs/develop/cedit/SRC/CEdit.ob07 @@ -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; diff --git a/programs/develop/cedit/SRC/CheckBox.ob07 b/programs/develop/cedit/SRC/CheckBox.ob07 index ec10a3dec8..a492fbbdd4 100644 --- a/programs/develop/cedit/SRC/CheckBox.ob07 +++ b/programs/develop/cedit/SRC/CheckBox.ob07 @@ -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 diff --git a/programs/develop/cedit/SRC/EditBox.ob07 b/programs/develop/cedit/SRC/EditBox.ob07 index cc6735dfb3..b48c2e96b8 100644 --- a/programs/develop/cedit/SRC/EditBox.ob07 +++ b/programs/develop/cedit/SRC/EditBox.ob07 @@ -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"); diff --git a/programs/develop/cedit/SRC/KolibriOS.ob07 b/programs/develop/cedit/SRC/KolibriOS.ob07 index 9ab2121fa6..0b155d29e6 100644 --- a/programs/develop/cedit/SRC/KolibriOS.ob07 +++ b/programs/develop/cedit/SRC/KolibriOS.ob07 @@ -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) diff --git a/programs/develop/cedit/SRC/scroll.ob07 b/programs/develop/cedit/SRC/scroll.ob07 index b304c59483..d2a7af5d3a 100644 --- a/programs/develop/cedit/SRC/scroll.ob07 +++ b/programs/develop/cedit/SRC/scroll.ob07 @@ -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;