Subversion Repositories Kolibri OS

Rev

Rev 9599 | Rev 9630 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9599 Rev 9628
Line 18... Line 18...
18
*)
18
*)
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
MODULE CEdit;
20
MODULE CEdit;
21
 
21
 
22
IMPORT
22
IMPORT
23
    OpenDlg, K := KolibriOS,
23
    OpenDlg, K := KolibriOS, Args,
24
    U := Utils, Lines, Menu, List,
24
    U := Utils, Lines, Menu, List,
25
    G := Graph, T := Text, E := Encodings,
25
    G := Graph, T := Text, E := Encodings,
26
    CB := Clipboard, Languages,
26
    CB := Clipboard, Languages,
Line 27... Line 27...
27
    ChangeLog, Scroll, CheckBox,
27
    ChangeLog, Scroll, CheckBox,
28
    RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar;
28
    RW, Ini, EB := EditBox, Tabs, Toolbar, SB := StatusBar;
Line 29... Line 29...
29
 
29
 
30
CONST
30
CONST
Line 31... Line 31...
31
    HEADER = "CEdit (08-jan-2022)";
31
    HEADER = "CEdit (13-jan-2022)";
Line 179... Line 179...
179
    text: T.tText;
179
    text: T.tText;
180
    texts: ARRAY maxTexts OF T.tText;
180
    texts: ARRAY maxTexts OF T.tText;
181
    textsCount, curText: INTEGER;
181
    textsCount, curText: INTEGER;
Line 182... Line 182...
182
 
182
 
-
 
183
    winWidth, winHeight: INTEGER;
183
    winWidth, winHeight: INTEGER;
184
    SkinHeight: INTEGER;
184
    AppPath, runScript, buildScript, debugScript: RW.tFileName;
185
    AppPath, runScript, buildScript, debugScript: RW.tFileName;
185
    OD: OpenDlg.Dialog;
186
    OD: OpenDlg.Dialog;
Line 186... Line 187...
186
    confirm, notFound, menuFindClicked, search, searchOpened: BOOLEAN;
187
    confirm, notFound, menuFindClicked, search, searchOpened: BOOLEAN;
Line 280... Line 281...
280
    top := (canvas.height - height) DIV 2 + TOP;
281
    top := (canvas.height - height) DIV 2 + TOP;
281
    bottom := top + height - 1;
282
    bottom := top + height - 1;
282
    right := left + width - 1;
283
    right := left + width - 1;
283
    x := minWidth DIV 2 + left;
284
    x := minWidth DIV 2 + left;
284
    y := (height - fontHeight) DIV 2 + top;
285
    y := (height - fontHeight) DIV 2 + top;
285
    K.DrawRect(left, top, width, height, K.winColor);
286
    K.DrawRect(left, top, width, height, K.colors.work);
286
    Rect(left, top, right, bottom, K.borderColor);
287
    Rect(left, top, right, bottom, K.colors.line);
287
    K.DrawText(x, y, K.textColor, s);
288
    K.DrawText(x, y, K.colors.work_text, s);
288
END Message;
289
END Message;
Line 289... Line 290...
289
 
290
 
290
 
291
 
Line 402... Line 403...
402
	        CheckBox.paint(BKW);
403
	        CheckBox.paint(BKW);
403
	        CheckBox.paint(CS);
404
	        CheckBox.paint(CS);
404
	        CheckBox.paint(WH);
405
	        CheckBox.paint(WH);
405
        END;
406
        END;
Line 406... Line 407...
406
 
407
 
407
		G.SetColor(canvas, K.borderColor);
408
		G.SetColor(canvas, K.colors.line);
408
		G.VLine(canvas, 0, 0, canvas.height - 1);
409
		G.VLine(canvas, 0, 0, canvas.height - 1);
409
        G.DrawCanvas(canvas, LEFT, TOP);
410
        G.DrawCanvas(canvas, LEFT, TOP);
410
        NotFound;
411
        NotFound;
411
        Replaced;
412
        Replaced;
Line 451... Line 452...
451
    y, right, bottom: INTEGER;
452
    y, right, bottom: INTEGER;
452
BEGIN
453
BEGIN
453
    DEC(top, Tabs.tabHeight);
454
    DEC(top, Tabs.tabHeight);
454
    right := left + EditBox_Width + SEARCH_PADDING*2;
455
    right := left + EditBox_Width + SEARCH_PADDING*2;
455
    bottom := top + 395 + btnHeight + SEARCH_PADDING;
456
    bottom := top + 395 + btnHeight + SEARCH_PADDING;
456
    Rect(left, top, right, bottom, K.borderColor);
457
    Rect(left, top, right, bottom, K.colors.line);
Line 457... Line 458...
457
 
458
 
458
    K.CreateButton(btnCloseSearch, right - 20, top, 20, 20, 0EF999FH, "");
459
    K.CreateButton(btnCloseSearch, right - 20, top, 20, 20, 0EF999FH, "");
459
    K.DrawLine(right - 14, top + 5, right - 5, top + 14, 0FFFFFFH);
460
    K.DrawLine(right - 14, top + 5, right - 5, top + 14, 0FFFFFFH);
460
    K.DrawLine(right - 15, top + 5, right - 5, top + 15, 0FFFFFFH);
461
    K.DrawLine(right - 15, top + 5, right - 5, top + 15, 0FFFFFFH);
461
    K.DrawLine(right - 15, top + 6, right - 6, top + 15, 0FFFFFFH);
462
    K.DrawLine(right - 15, top + 6, right - 6, top + 15, 0FFFFFFH);
462
    K.DrawLine(right - 15, top + 14, right - 6, top + 5, 0FFFFFFH);
463
    K.DrawLine(right - 15, top + 14, right - 6, top + 5, 0FFFFFFH);
463
    K.DrawLine(right - 15, top + 15, right - 5, top + 5, 0FFFFFFH);
464
    K.DrawLine(right - 15, top + 15, right - 5, top + 5, 0FFFFFFH);
Line 464... Line 465...
464
    K.DrawLine(right - 14, top + 15, right - 5, top + 6, 0FFFFFFH);
465
    K.DrawLine(right - 14, top + 15, right - 5, top + 6, 0FFFFFFH);
465
 
466
 
466
    K.CreateButton(btnHideSearch, right - 40, top, 20, 20, K.btnColor, "");
467
    K.CreateButton(btnHideSearch, right - 40, top, 20, 20, K.colors.button, "");
Line 467... Line 468...
467
    K.DrawLine(right - 34, top + 14, right - 26, top + 14, K.btnTextColor);
468
    K.DrawLine(right - 34, top + 14, right - 26, top + 14, K.colors.button_text);
468
    K.DrawLine(right - 34, top + 15, right - 26, top + 15, K.btnTextColor);
469
    K.DrawLine(right - 34, top + 15, right - 26, top + 15, K.colors.button_text);
469
 
470
 
470
    INC(top, 15);
471
    INC(top, 15);
471
    INC(left, SEARCH_PADDING);
472
    INC(left, SEARCH_PADDING);
472
    K.DrawText866(left, top, K.textColor, "find");
473
    K.DrawText866(left, top, K.colors.work_text, "find");
473
    K.DrawText866(left, top + 55, K.textColor, "replace with");
474
    K.DrawText866(left, top + 55, K.colors.work_text, "replace with");
474
    K.DrawText866(left, top + 330, K.textColor, "go to line");
475
    K.DrawText866(left, top + 330, K.colors.work_text, "go to line");
475
    BKW.top := top + 110;
476
    BKW.top := top + 110;
476
    BKW.left := left;
477
    BKW.left := left;
Line 486... Line 487...
486
    GotoEdit.left := left;
487
    GotoEdit.left := left;
487
    EB.paint(FindEdit);
488
    EB.paint(FindEdit);
488
    EB.paint(ReplaceEdit);
489
    EB.paint(ReplaceEdit);
489
    EB.paint(GotoEdit);
490
    EB.paint(GotoEdit);
490
    y := top + 200;
491
    y := top + 200;
491
    K.CreateButton(btnFindNext, left, y, btnWidth, btnHeight, K.btnColor, "next"); INC(y, btnHeight + 10);
492
    K.CreateButton(btnFindNext, left, y, btnWidth, btnHeight, K.colors.button, "next"); INC(y, btnHeight + 10);
492
    K.CreateButton(btnReplace, left, y, btnWidth, btnHeight, K.btnColor, "replace"); INC(y, btnHeight + 10);
493
    K.CreateButton(btnReplace, left, y, btnWidth, btnHeight, K.colors.button, "replace"); INC(y, btnHeight + 10);
493
    K.CreateButton(btnReplaceAll, left, y, btnWidth + 5*fontWidth - 2, btnHeight, K.btnColor, "replace all");
494
    K.CreateButton(btnReplaceAll, left, y, btnWidth + 5*fontWidth - 2, btnHeight, K.colors.button, "replace all");
494
    K.CreateButton(btnGoto, left, top + 380, btnWidth, btnHeight, K.btnColor, "go");
495
    K.CreateButton(btnGoto, left, top + 380, btnWidth, btnHeight, K.colors.button, "go");
495
END SearchPanel;
496
END SearchPanel;
Line 496... Line 497...
496
 
497
 
497
 
498
 
498
PROCEDURE draw_window;
499
PROCEDURE draw_window;
499
VAR
500
VAR
500
    width, height: INTEGER;
501
    width, height: INTEGER;
501
BEGIN
502
BEGIN
502
    K.BeginDraw;
503
    K.BeginDraw;
503
    K.CreateWindow(30 + K.GetTickCount() MOD 128, 30 + K.GetTickCount() MOD 128, winWidth, winHeight, K.winColor, 73H, 0, 0, "");
504
    K.CreateWindow(30 + K.GetTickCount() MOD 128, 30 + K.GetTickCount() MOD 128, winWidth, winHeight, K.colors.work, 73H, 0, 0, "");
504
    IF (text # NIL) & ~K.RolledUp() THEN
505
    IF (text # NIL) & ~K.RolledUp() THEN
505
    	IF confirm THEN
506
    	IF confirm THEN
506
    		resetTimer
507
    		resetTimer
507
    	END;
508
    	END;
Line 508... Line 509...
508
        confirm := FALSE;
509
        confirm := FALSE;
509
        K.ClientSize(width, height);
510
        K.ClientSize(width, height);
510
 
511
 
511
        K.DrawRect(0, 0, width, TOP - 1, K.winColor);
512
        K.DrawRect(0, 0, width, TOP - 1, K.colors.work);
512
        K.DrawRect(0, 0, LEFT, height, K.winColor);
513
        K.DrawRect(0, 0, LEFT, height, K.colors.work);
Line 513... Line 514...
513
        K.DrawRect(width - RIGHT_PADDING, 0, RIGHT_PADDING, height, K.winColor);
514
        K.DrawRect(width - RIGHT_PADDING, 0, RIGHT_PADDING, height, K.colors.work);
514
        K.DrawRect(LEFT + canvas.width + 1, TOP + canvas.height + 1, scrollWidth - 1, scrollWidth - 1, K.winColor);
515
        K.DrawRect(LEFT + canvas.width + 1, TOP + canvas.height + 1, scrollWidth - 1, scrollWidth - 1, K.colors.work);
515
        Menu.DrawMain(mainMenu);
516
        Menu.DrawMain(mainMenu);
Line 686... Line 687...
686
    confirm := TRUE;
687
    confirm := TRUE;
687
    left := (canvas.width - width) DIV 2 + LEFT;
688
    left := (canvas.width - width) DIV 2 + LEFT;
688
    top := (canvas.height - height) DIV 2 + TOP;
689
    top := (canvas.height - height) DIV 2 + TOP;
689
    right := left + width - 1;
690
    right := left + width - 1;
690
    bottom := top + height - 1;
691
    bottom := top + height - 1;
691
    K.DrawRect(left, top, width, height, K.winColor);
692
    K.DrawRect(left, top, width, height, K.colors.work);
692
    Rect(left, top, right, bottom, K.borderColor);
693
    Rect(left, top, right, bottom, K.colors.line);
693
    K.DrawText866(left + (width - 10*fontWidth) DIV 2, top + 10, K.textColor, "save file?");
694
    K.DrawText866(left + (width - 10*fontWidth) DIV 2, top + 10, K.colors.work_text, "save file?");
694
    K.CreateButton(btnYes, left + 10, top + 35, btnWidth, btnHeight, K.btnColor, "yes");
695
    K.CreateButton(btnYes, left + 10, top + 35, btnWidth, btnHeight, K.colors.button, "yes");
695
    K.CreateButton(btnNo, left + 20 + btnWidth, top + 35, btnWidth, btnHeight, K.btnColor, "no");
696
    K.CreateButton(btnNo, left + 20 + btnWidth, top + 35, btnWidth, btnHeight, K.colors.button, "no");
696
END Confirm;
697
END Confirm;
Line 697... Line 698...
697
 
698
 
698
 
699
 
Line 771... Line 772...
771
    resetTimer;
772
    resetTimer;
772
    draw_window
773
    draw_window
773
END SwitchTab;
774
END SwitchTab;
Line 774... Line 775...
774
 
775
 
775
 
776
 
776
PROCEDURE open;
777
PROCEDURE open (_fileName: RW.tFileName): BOOLEAN;
777
VAR
778
VAR
778
    fileName: RW.tFileName;
779
	fileName: RW.tFileName;
-
 
780
    nov: T.tText;
779
    nov: T.tText;
781
    err, n: INTEGER;
-
 
782
    res: BOOLEAN;
780
    err, n: INTEGER;
783
BEGIN
-
 
784
	res := TRUE;
-
 
785
    IF textsCount < maxTexts THEN
781
BEGIN
786
    	fileName := _fileName;
782
    IF textsCount < maxTexts THEN
787
    	IF fileName = "" THEN
-
 
788
        	OD._type := OpenDlg.topen;
783
        OD._type := OpenDlg.topen;
789
        	OpenFile(fileName, EditFilter)
784
        OpenFile(fileName, EditFilter);
790
        END;
785
        IF fileName # "" THEN
791
        IF fileName # "" THEN
786
            n := getFileNum(fileName);
792
            n := getFileNum(fileName);
787
            IF n = -1 THEN
793
            IF n = -1 THEN
788
                nov := T.open(fileName, err);
794
                nov := T.open(fileName, err);
-
 
795
                IF nov = NIL THEN
-
 
796
                    error("error opening file");
789
                IF nov = NIL THEN
797
                    SwitchTab(curText);
790
                    error("error opening file")
798
                    res := FALSE
791
                ELSE
799
                ELSE
792
                	T.SetPos(nov, 0, 0);
800
                	T.SetPos(nov, 0, 0);
793
                    insert(textsCount, nov);
801
                    insert(textsCount, nov);
Line 797... Line 805...
797
            ELSE
805
            ELSE
798
                SwitchTab(n)
806
                SwitchTab(n)
799
            END
807
            END
800
        END
808
        END
801
    ELSE
809
    ELSE
802
        error("too many files")
810
        error("too many files");
-
 
811
        res := FALSE
803
    END
812
    END
-
 
813
    RETURN res
804
END open;
814
END open;
Line -... Line 815...
-
 
815
 
-
 
816
 
-
 
817
PROCEDURE OpenDial;
-
 
818
VAR
-
 
819
	res: BOOLEAN;
-
 
820
BEGIN
-
 
821
	res := open("")
-
 
822
END OpenDial;
805
 
823
 
806
 
824
 
807
PROCEDURE createSearchForm;
825
PROCEDURE createSearchForm;
808
BEGIN
826
BEGIN
809
	EB.create(LEFT_PADDING, TOP + 20, EditBox_Width, EDITBOX_MAXCHARS, FindEdit);
827
	EB.create(LEFT_PADDING, TOP + 20, EditBox_Width, EDITBOX_MAXCHARS, FindEdit);
Line 1130... Line 1148...
1130
	    |menuSelectAll: T.key(text, ORD("A"), FALSE, TRUE)
1148
	    |menuSelectAll: T.key(text, ORD("A"), FALSE, TRUE)
Line 1131... Line 1149...
1131
 
1149
 
1132
	    |menuNew:
1150
	    |menuNew:
1133
	        NewFile
1151
	        NewFile
1134
	    |menuOpen:
1152
	    |menuOpen:
1135
	        open
1153
	        OpenDial
1136
	    |menuSave:
1154
	    |menuSave:
1137
	        save(text);
1155
	        save(text);
1138
	        repaint
1156
	        repaint
1139
	    |menuSaveAs:
1157
	    |menuSaveAs:
Line 1670... Line 1688...
1670
                             key := -2
1688
                             key := -2
1671
                        |21: T.redo(text);
1689
                        |21: T.redo(text);
1672
                             key := -1
1690
                             key := -1
1673
                        |22: key := ORD("U")
1691
                        |22: key := ORD("U")
1674
                        |24: key := -1;
1692
                        |24: key := -1;
1675
                             open
1693
                             OpenDial
1676
                        |30: key := ORD("A")
1694
                        |30: key := ORD("A")
1677
                        |31: key := -1;
1695
                        |31: key := -1;
1678
                             save(text)
1696
                             save(text)
1679
                        |32: key := ORD("D")
1697
                        |32: key := ORD("D")
1680
                        |38: key := ORD("L")
1698
                        |38: key := ORD("L")
Line 1763... Line 1781...
1763
        Close
1781
        Close
1764
    |btnNew:
1782
    |btnNew:
1765
        NewFile;
1783
        NewFile;
1766
        repaint
1784
        repaint
1767
    |btnOpen:
1785
    |btnOpen:
1768
        open
1786
        OpenDial
1769
    |btnSave:
1787
    |btnSave:
1770
        save(text);
1788
        save(text);
1771
        repaint
1789
        repaint
1772
    |btnSearch:
1790
    |btnSearch:
1773
        ShowSearchPanel(FALSE);
1791
        ShowSearchPanel(FALSE);
Line 1928... Line 1946...
1928
        K.SetEventsMask({0, 1, 2, 5, 6, 31})
1946
		K.SetEventsMask({0, 1, 2, 5, 6, 31})
1929
    ELSE
1947
	ELSE
1930
    	SetCaption(text.fileName);
1948
		SetCaption(text.fileName);
1931
        K.SetEventsMask({0, 30, 31})
1949
		K.SetEventsMask({0, 30, 31})
1932
    END;
1950
	END;
1933
    draw_window
1951
	draw_window;
-
 
1952
	IF SkinHeight # K.SkinHeight() THEN
-
 
1953
		SkinHeight := K.SkinHeight();
-
 
1954
		Redraw(resized, width, height, cliWidth, cliHeight)
-
 
1955
	END
1934
END Redraw;
1956
END Redraw;
Line 1935... Line 1957...
1935
 
1957
 
1936
 
1958
 
Line 1948... Line 1970...
1948
END ScrollChange;
1970
END ScrollChange;
Line 1949... Line 1971...
1949
 
1971
 
1950
 
1972
 
1951
PROCEDURE main;
-
 
1952
VAR
1973
PROCEDURE main;
1953
    err: INTEGER;
1974
VAR
1954
    fileName, filePath: RW.tFileName;
1975
    fileName, filePath: RW.tFileName;
1955
    width, height, cliWidth, cliHeight: INTEGER;
1976
    width, height, cliWidth, cliHeight: INTEGER;
1956
    resized: BOOLEAN;
1977
    resized: BOOLEAN;
1957
    firstClickX, firstClickY, time, blink: INTEGER;
1978
    firstClickX, firstClickY, time, blink, i: INTEGER;
1958
BEGIN
1979
BEGIN
1959
	header := "";
1980
	header := "";
1960
    K.GetSystemColors;
1981
    K.GetSystemColors;
1961
    switch := FALSE;
1982
    switch := FALSE;
1962
    closing := FALSE;
1983
    closing := FALSE;
1963
    textsCount := 0;
1984
    textsCount := 0;
1964
    curText := 0;
1985
    curText := 0;
1965
    mainTID := K.ThreadID();
1986
    mainTID := K.ThreadID();
1966
    K.SetIPC(IPC);
1987
    K.SetIPC(IPC);
1967
    U.ptr2str(K.GetName(), AppPath);
1988
    Args.GetArg(0, AppPath);
1968
    Ini.load(AppPath);
1989
    Ini.load(AppPath);
1969
    leftButton := FALSE;
1990
    leftButton := FALSE;
1970
    resized := FALSE;
1991
    resized := FALSE;
Line 1974... Line 1995...
1974
    winWidth := MAX(winWidth, minWinWidth);
1995
    winWidth := MAX(winWidth, minWinWidth);
1975
    winHeight := MAX(winHeight, minWinHeight);
1996
    winHeight := MAX(winHeight, minWinHeight);
1976
    cliWidth := winWidth;
1997
    cliWidth := winWidth;
1977
    cliHeight := winHeight;
1998
    cliHeight := winHeight;
1978
    LEFT := LEFT_PADDING;
1999
    LEFT := LEFT_PADDING;
-
 
2000
    SkinHeight := K.SkinHeight();
1979
    canvas := G.CreateCanvas(winWidth - (LEFT + RIGHT + 11 + RIGHT_PADDING), winHeight - (TOP + BOTTOM + 5) - K.SkinHeight());
2001
    canvas := G.CreateCanvas(winWidth - (LEFT + RIGHT + 11 + RIGHT_PADDING), winHeight - (TOP + BOTTOM + 5) - SkinHeight);
1980
    tabs := Tabs.create();
2002
    tabs := Tabs.create();
1981
    Tabs.setArea(tabs, LEFT, TOP - Tabs.tabHeight, canvas.width, Tabs.tabHeight);
2003
    Tabs.setArea(tabs, LEFT, TOP - Tabs.tabHeight, canvas.width, Tabs.tabHeight);
1982
    font1 := G.CreateFont(1, "", {});
2004
    font1 := G.CreateFont(1, "", {});
1983
    font2 := G.CreateFont(2, "", {});
2005
    font2 := G.CreateFont(2, "", {});
1984
    font := font1;
2006
    font := font1;
1985
    G.SetFont(canvas, font);
2007
    G.SetFont(canvas, font);
1986
    T.init(resetTimer);
2008
    T.init(resetTimer);
1987
    T.setCanvas(canvas);
2009
    T.setCanvas(canvas);
1988
    U.ptr2str(K.GetCommandLine(), fileName);
-
 
Line 1989... Line 2010...
1989
 
2010
 
1990
    context := CreateContextMenu();
2011
    context := CreateContextMenu();
1991
    menuFile := CreateMenuFile();
2012
    menuFile := CreateMenuFile();
1992
    subCurLine := CreateMenuCurLine();
2013
    subCurLine := CreateMenuCurLine();
Line 2032... Line 2053...
2032
    Toolbar.delimiter(toolbar);
2053
    Toolbar.delimiter(toolbar);
2033
    Toolbar.add(toolbar, btnBuild,  54, "");
2054
    Toolbar.add(toolbar, btnBuild,  54, "");
2034
    Toolbar.add(toolbar, btnRun,    53, "");
2055
    Toolbar.add(toolbar, btnRun,    53, "");
Line 2035... Line 2056...
2035
 
2056
 
-
 
2057
    Ini.getSettings(buildScript, runScript, debugScript);
-
 
2058
 
2036
    Ini.getSettings(buildScript, runScript, debugScript);
2059
    filePath := "/sys";
2037
    IF fileName = "" THEN
2060
    IF Args.argc = 1 THEN
2038
        text := T.New();
2061
        text := T.New();
-
 
2062
        insert(0, text);
2039
        filePath := "/sys"
2063
        T.SetPos(text, 0, 0)
2040
    ELSE
-
 
2041
        text := T.open(fileName, err);
2064
    END;
2042
        IF text = NIL THEN
2065
	FOR i := 1 TO Args.argc - 1 DO
2043
            error("error opening file");
2066
		Args.GetArg(i, fileName);
2044
            K.Exit
-
 
2045
        ELSE
2067
		IF open(fileName) THEN
2046
            U.getPath(fileName, filePath)
2068
			U.getPath(fileName, filePath)
2047
        END
2069
		END
2048
    END;
2070
	END;
-
 
2071
	IF textsCount = 0 THEN
-
 
2072
		K.Exit
2049
    OD := OpenDlg.Create(draw_window, OpenDlg.topen, filePath, "");
2073
	END;
-
 
2074
	SwitchTab(textsCount - 1);
2050
    insert(0, text);
2075
 
2051
    Scroll.init(ScrollChange);
2076
    Scroll.init(ScrollChange);
2052
    Scroll.create(FALSE, canvas.width + 1, scrollWidth, scrollWidth, scrollWidth*3 DIV 2, hScroll);
2077
    Scroll.create(FALSE, canvas.width + 1, scrollWidth, scrollWidth, scrollWidth*3 DIV 2, hScroll);
2053
    Scroll.create(TRUE, scrollWidth, canvas.height + 2, scrollWidth, scrollWidth*3 DIV 2, vScroll);
2078
    Scroll.create(TRUE, scrollWidth, canvas.height + 2, scrollWidth, scrollWidth*3 DIV 2, vScroll);
2054
    T.resize(canvas.width, canvas.height);
-
 
2055
    T.SetPos(text, 0, 0);
2079
    T.resize(canvas.width, canvas.height);
2056
    confirm := FALSE;
2080
    confirm := FALSE;
2057
    notFound := FALSE;
2081
    notFound := FALSE;
2058
    menuFindClicked := FALSE;
2082
    menuFindClicked := FALSE;
2059
    menuActive := FALSE;
2083
    menuActive := FALSE;
Line 2063... Line 2087...
2063
    new_searchText := "";
2087
    new_searchText := "";
2064
    searchText := "";
2088
    searchText := "";
2065
    cs := FALSE;
2089
    cs := FALSE;
2066
    whole := FALSE;
2090
    whole := FALSE;
2067
    replaced := 0;
2091
    replaced := 0;
-
 
2092
 
-
 
2093
	OD := OpenDlg.Create(draw_window, OpenDlg.topen, filePath, "");
-
 
2094
 
2068
    K.SetEventsMask({0, 1, 2, 5, 6, 31});
2095
    K.SetEventsMask({0, 1, 2, 5, 6, 31});
2069
    Menu.init(resetTimer);
2096
    Menu.init(resetTimer);
2070
    draw_window;
2097
    draw_window;
2071
    blink := Ini.blink;
2098
    blink := Ini.blink;
2072
	IF blink <= 0 THEN
2099
	IF blink <= 0 THEN