Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8771 → Rev 8772

/programs/develop/cedit/SRC/CEdit.ob07
28,7 → 28,7
RW, Ini, box_lib, Icons;
 
CONST
header = "CEdit (03-jun-2021)";
header = "CEdit (06-jun-2021)";
 
ShellFilter = "";
EditFilter = "SH|ASM|TXT|INC|OB07|C|CPP|H|PAS|PP|LUA|INI";
118,6 → 118,7
menuExit = 15;
 
menuNumbers = 20;
menuFontSize = 21;
menuColors = 1000;
menuMaxColors = menuColors + Ini.MAX_SECTIONS - 1;
 
147,7 → 148,7
 
VAR
canvas: G.tCanvas;
font: G.tFont;
font, font1, font2: G.tFont;
text: T.tText;
winWidth, winHeight: INTEGER;
shift: SET;
461,23 → 462,25
 
PROCEDURE drawMainMenu (menu: Menu.tMenu; x: INTEGER; btn: INTEGER; caption: ARRAY OF WCHAR);
VAR
menuColor, n: INTEGER;
menuColor, textColor, n: INTEGER;
BEGIN
IF menu.tid # 0 THEN
menuColor := K.selMenuColor
menuColor := K.textColor;
textColor := K.winColor
ELSE
menuColor := K.winColor
menuColor := K.winColor;
textColor := K.textColor
END;
n := LENGTH(caption);
K.DrawRect(x, 0, n*fontWidth + 2, MainMenuHeight, menuColor);
K.CreateButton(btn + ORD({30}), x, 0, n*fontWidth + 2, MainMenuHeight, K.btnColor, "");
K.DrawText(x + 1, (MainMenuHeight - fontHeight) DIV 2 + 1, K.textColor, caption)
K.DrawText(x + 1, (MainMenuHeight - fontHeight) DIV 2 + 1, textColor, caption)
END drawMainMenu;
 
 
BEGIN
K.BeginDraw;
K.CreateWindow(50 + K.GetTickCount() MOD 128, 50 + K.GetTickCount() MOD 128, winWidth, winHeight, K.winColor, 73H, 0, 0, header);
K.CreateWindow(30 + K.GetTickCount() MOD 128, 30 + K.GetTickCount() MOD 128, winWidth, winHeight, K.winColor, 73H, 0, 0, header);
IF (text # NIL) & ~K.RolledUp() THEN
confirm := FALSE;
K.ClientSize(width, height);
891,6 → 894,13
EditBox_SetFocus(ReplaceEdit, FALSE)
|menuNumbers:
T.toggleNumbers(text)
|menuFontSize:
IF font = font1 THEN
font := font2
ELSE
font := font1
END;
resize
|menuNone:
T.setLang(text, Languages.langNone)
|menuC:
1053,6 → 1063,7
BEGIN
menu := List.create(NIL);
Menu.AddMenuItem(menu, menuNumbers, "line numbers");
Menu.AddMenuItem(menu, menuFontSize, "x2");
Menu.delimiter(menu);
 
colors := Ini.sections.first(Ini.tSection);
1172,6 → 1183,7
INC(x, menuEncodingX)
ELSIF menu = menuView THEN
Menu.setCheck(menu, menuNumbers, ORD(text.numbers));
Menu.setCheck(menu, menuFontSize, ORD(font = font2));
FOR i := 0 TO Ini.sections.count - 1 DO
Menu.setCheck(menu, menuColors + i, ORD(Ini.curSectionNum = i)*2)
END;
1205,7 → 1217,7
 
PROCEDURE main;
VAR
width, height, x, y, scrollX, scrollY: INTEGER;
width, height, x, y, scrollX, scrollY, i: INTEGER;
key: INTEGER;
msState: SET;
scroll: INTEGER;
1226,13 → 1238,18
LeftButtonUp;
resized := FALSE;
shift := {};
winWidth := minWinWidth;
winHeight := minWinHeight;
K.ScreenSize(winWidth, winHeight);
winWidth := (winWidth * 80) DIV 100 - (128 + 30);
winHeight := winHeight - (128 + 30);
winWidth := MAX(winWidth, minWinWidth);
winHeight := MAX(winHeight, minWinHeight);
cliWidth := winWidth;
cliHeight := winHeight;
LEFT := 10;
canvas := G.CreateCanvas(winWidth - (LEFT + RIGHT + 10), winHeight - (TOP + BOTTOM + 4) - K.SkinHeight());
font := G.CreateFont(1, "", {});
font1 := G.CreateFont(1, "", {});
font2 := G.CreateFont(2, "", {});
font := font1;
G.SetFont(canvas, font);
T.init(NIL);
T.setCanvas(canvas);
1280,6 → 1297,7
WHILE TRUE DO
CASE K.WaitForEvent() OF
|1:
FOR i := 0 TO 1 DO
K.GetSystemColors;
Icons.get(icons, grayIcons);
IF ~K.RolledUp() THEN
1288,7 → 1306,7
cliWidth := width;
cliHeight := height;
resize;
resized := TRUE
resized := TRUE;
END;
K.SetEventsMask({0, 1, 2, 5, 6, 31})
ELSE
1295,6 → 1313,8
K.SetEventsMask({0, 30, 31})
END;
draw_window
END
 
|2:
key := K.GetKey();
getKBState;
1301,8 → 1321,12
IF key DIV 65536 = 61 THEN (* F3 *)
key := -1;
IF search & (searchText # "") THEN
IF T.SHIFT IN shift THEN
notFound := ~T.findNext(text, ~box_lib.check_box_get_value(BKW))
ELSE
notFound := ~T.findNext(text, box_lib.check_box_get_value(BKW))
END
END
ELSIF key DIV 65536 = 67 THEN (* F9 *)
key := -1;
IF T.CTRL IN shift THEN
1310,6 → 1334,11
ELSE
Script(runScript)
END
ELSIF key DIV 65536 = 1 THEN
key := -1; (* Esc *)
IF search THEN
Search
END
ELSIF (key DIV 65536 = 55) & (key DIV 256 MOD 256 = 52) THEN
key := -1 (* PrtScn *)
ELSIF (T.CTRL IN shift) & (key DIV 65536 = 33) THEN