/programs/develop/cedit/CEDIT |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/programs/develop/cedit/SHORTCUT.TXT |
---|
33,7 → 33,8 |
ctrl+S сохранить |
ctrl+O открыть |
ctrl+N создать новый |
ctrl+N, |
ctrl+T создать новый |
ctrl+W закрыть файл |
ctrl+Tab переключиться на следующую вкладку |
/programs/develop/cedit/SRC/CEdit.ob07 |
---|
28,7 → 28,7 |
RW, Ini, EB := EditBox, Icons, Tabs, Timer; |
CONST |
HEADER = "CEdit (11-dec-2021)"; |
HEADER = "CEdit (17-dec-2021)"; |
ShellFilter = ""; |
EditFilter = "SH|INC|TXT|ASM|OB07|C|CPP|H|PAS|PP|LUA|INI|JSON"; |
916,8 → 916,10 |
IF nov = NIL THEN |
error("error opening file") |
ELSE |
T.SetPos(nov, 0, 0); |
insert(textsCount, nov); |
T.SetPos(nov, 0, 0) |
Scroll.setValue(hScroll, 0); |
Scroll.setValue(vScroll, 0) |
END |
ELSE |
SwitchTab(n) |
1814,7 → 1816,8 |
|45: key := ORD("X") |
|46: key := ORD("C") |
|47: key := ORD("V") |
|49: key := -1; |
|49, |
20: key := -1; |
NewFile |
ELSE |
key := -1 |
2011,6 → 2014,10 |
leftButton := FALSE; |
T.selectWord(text); |
repaint |
ELSIF Tabs.DblClicked(tabs, x + LEFT, y + TOP) THEN |
leftButton := FALSE; |
NewFile; |
repaint |
END |
ELSE |
firstClickX := x; |
/programs/develop/cedit/SRC/CheckBox.ob07 |
---|
26,6 → 26,8 |
padding = 4; |
fontWidth = K.fontWidth; |
fontHeight = K.fontHeight; |
bColor = 0FFFFFFH; |
fColor = 0008000H; |
TYPE |
43,21 → 45,30 |
PROCEDURE paint* (chkbox: tCheckBox); |
VAR |
canvas: G.tCanvas; |
(*r1, r2, g1, g2, b1, b2: BYTE;*) |
BEGIN |
canvas := chkbox.canvas; |
IF canvas # NIL THEN |
G.SetColor(canvas, K.winColor); |
G.clear(canvas); |
G.SetColor(canvas, 0FFFFFFH); |
G.SetColor(canvas, bColor); |
G.FillRect(canvas, 0, 0, fontHeight - 1, fontHeight - 1); |
G.SetColor(canvas, K.borderColor); |
G.Rect(canvas, 0, 0, fontHeight - 1, fontHeight - 1); |
IF chkbox.value THEN |
G.SetColor(canvas, 0008000H); |
G.SetColor(canvas, fColor); |
G.DLine(canvas, 2, 6, 6, -1); |
G.DLine(canvas, 2, 6, 7, -1); |
G.DLine(canvas, 7, 13, 9, 1); |
G.DLine(canvas, 7, 13, 10, 1) |
G.DLine(canvas, 7, 13, 10, 1); |
(*G.getRGB(bColor, r1, g1, b1); |
G.getRGB(fColor, r2, g2, b2); |
G.SetColor(canvas, (b1 + b2) DIV 2 + ((g1 + g2) DIV 2)*256 + ((r1 + r2) DIV 2)*65536); |
*) |
G.DLine(canvas, 2, 6, 8, -1); |
G.DLine(canvas, 7, 13, 11, 1); |
G.DLine(canvas, 2, 6, 5, -1); |
G.DLine(canvas, 7, 13, 8, 1); |
END; |
G.SetTextColor(canvas, K.textColor); |
G.SetBkColor(canvas, K.winColor); |
/programs/develop/cedit/SRC/Graph.ob07 |
---|
51,6 → 51,14 |
END; |
PROCEDURE getRGB* (color: INTEGER; VAR r, g, b: BYTE); |
BEGIN |
b := color MOD 256; |
g := color DIV 256 MOD 256; |
r := color DIV 65536 MOD 256 |
END getRGB; |
PROCEDURE DrawCanvas* (canvas: tCanvas; x, y: INTEGER); |
BEGIN |
K.sysfunc7(65, canvas.bitmap, canvas.width*65536 + canvas.height, x*65536 + y, 32, 0, 0); |
/programs/develop/cedit/SRC/Icons.ob07 |
---|
20,7 → 20,7 |
MODULE Icons; |
IMPORT |
LibImg, K := KolibriOS, SYSTEM; |
LibImg, K := KolibriOS, Graph, SYSTEM; |
CONST |
fileName = "/rd/1/Icons16.png"; |
93,9 → 93,7 |
SYSTEM.GET8(data + 1, g); |
SYSTEM.GET8(data + 2, r); |
IF b + g + r = 765 THEN |
b := K.toolbarColor MOD 256; |
g := K.toolbarColor DIV 256 MOD 256; |
r := K.toolbarColor DIV 65536 MOD 256 |
Graph.getRGB(K.toolbarColor, r, g, b) |
END; |
SYSTEM.PUT8(data, b); |
SYSTEM.PUT8(data + 1, g); |
/programs/develop/cedit/SRC/Tabs.ob07 |
---|
19,7 → 19,7 |
MODULE Tabs; |
IMPORT List, K := KolibriOS, RW; |
IMPORT List, K := KolibriOS, RW, U := Utils; |
CONST |
42,11 → 42,16 |
strings: List.tList; |
first, current: INTEGER; |
width, height: INTEGER; |
x, y: INTEGER |
x, y, freeX: INTEGER |
END; |
PROCEDURE DblClicked* (t: tTabs; x, y: INTEGER): BOOLEAN; |
RETURN (x > t.freeX) & U.between(t.y, y, t.y + t.height - 1) |
END DblClicked; |
PROCEDURE drawTab (t: tTabs; id, x, y, width, height: INTEGER; s: ARRAY OF CHAR; modified: BOOLEAN); |
VAR |
x2, y2, color: INTEGER; |
102,7 → 107,7 |
PROCEDURE draw* (t: tTabs); |
VAR |
x, y, xmax, n, width: INTEGER; |
x, y, xmax, n, width, i: INTEGER; |
item: List.tItem; |
scroll: BOOLEAN; |
BEGIN |
111,8 → 116,10 |
K.DrawRect(x, y - (curTabHeight - tabHeight), t.width + (2*scrWidth + 2), t.height + (curTabHeight - tabHeight) - 1, K.winColor); |
IF Width(t, 0, t.strings.count - 1) > t.width THEN |
INC(x, 2*scrWidth); |
K.CreateButton(btnID - 1, t.x, t.y, scrWidth, t.height - 1, K.btnColor, "<"); |
K.CreateButton(btnID - 2, t.x + scrWidth, t.y, scrWidth, t.height - 1, K.btnColor, ">"); |
K.DeleteButton(btnID - 1); |
K.DeleteButton(btnID - 2); |
K.CreateButton(btnID - 1, t.x, y, scrWidth, t.height - 1, K.btnColor, "<"); |
K.CreateButton(btnID - 2, t.x + scrWidth, y, scrWidth, t.height - 1, K.btnColor, ">"); |
scroll := TRUE |
ELSE |
t.first := 0; |
121,6 → 128,9 |
xmax := x + t.width - 1; |
n := t.strings.count - 1; |
FOR i := 0 TO n DO |
K.DeleteButton(i + btnID) |
END; |
WHILE (n >= 0) & (Width(t, n, t.strings.count - 1) <= t.width) DO |
DEC(n) |
END; |
140,12 → 150,15 |
WHILE (item # NIL) & (x <= xmax) DO |
width := tabWidth(item(tItem)); |
IF x + width - 1 <= xmax THEN |
drawTab(t, n, x + 1, y, width, t.height, item(tItem).val, item(tItem).modified) |
END; |
drawTab(t, n, x + 1, y, width, t.height, item(tItem).val, item(tItem).modified); |
INC(n); |
INC(x, width); |
item := item.next |
ELSE |
item := NIL |
END |
END; |
t.freeX := x |
END draw; |
/programs/develop/cedit/SRC/scroll.ob07 |
---|
106,7 → 106,7 |
width := scroll.width; |
height := scroll.height; |
canvas := scroll.canvas; |
G.SetColor(canvas, K.winColor); |
G.SetColor(canvas, K.lightColor); |
G.clear(canvas); |
G.SetColor(canvas, K.borderColor); |
G.Rect(canvas, 0, 0, width - 1, height - 1); |