Subversion Repositories Kolibri OS

Rev

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

Rev 9891 Rev 9892
Line 37... Line 37...
37
    TAB1 = Lines.TAB1;
37
    TAB1 = Lines.TAB1;
38
    lenEOL = CB.lenEOL;
38
    lenEOL = CB.lenEOL;
Line 39... Line 39...
39
 
39
 
40
    mark_width = 2;
40
    mark_width = 2;
41
    pad_left = mark_width + 3;
41
    pad_left = mark_width + 3;
42
    pad_top = 0;
42
    pad_top = 1;
Line 43... Line 43...
43
    inter = 2;
43
    inter = 2;
Line 2232... Line 2232...
2232
BEGIN
2232
BEGIN
2233
	IF drawCursor THEN
2233
	IF drawCursor THEN
2234
	    cursor := text.cursor;
2234
	    cursor := text.cursor;
2235
	    scrollX := text.scroll.X;
2235
	    scrollX := text.scroll.X;
2236
	    scrollY := text.scroll.Y;
2236
	    scrollY := text.scroll.Y;
2237
	    IF ~((scrollY > cursor.Y) OR (scrollY + textsize.Y <= cursor.Y) OR
2237
	    IF ~((scrollY > cursor.Y) OR (scrollY + textsize.Y + 1 <= cursor.Y) OR
2238
	       (scrollX > cursor.X) OR (scrollX + textsize.X <= cursor.X)) THEN
2238
	       (scrollX > cursor.X) OR (scrollX + textsize.X <= cursor.X)) THEN
2239
	        x := (cursor.X - scrollX)*charWidth + padding.left;
2239
	        x := (cursor.X - scrollX)*charWidth + padding.left;
2240
	        y1 := (cursor.Y - scrollY)*charHeight + padding.top + (inter DIV 2 + 1);
2240
	        y1 := (cursor.Y - scrollY)*charHeight + padding.top + (inter DIV 2 + 1);
2241
	        y2 := y1 + charHeight - (inter + 2);
2241
	        y2 := y1 + charHeight - (inter + 2);
2242
	        G.notVLine(canvas, x, y1, y2);
2242
	        G.notVLine(canvas, x, y1, y2);
Line 2334... Line 2334...
2334
    END;
2334
    END;
2335
    getSelect(text, selBeg, selEnd);
2335
    getSelect(text, selBeg, selEnd);
2336
    y := padding.top + inter DIV 2;
2336
    y := padding.top + inter DIV 2;
2337
    n := text.scroll.Y;
2337
    n := text.scroll.Y;
2338
    firstLine := getLine2(text, n);
2338
    firstLine := getLine2(text, n);
-
 
2339
 
2339
    IF text.smallMove THEN
2340
    IF text.smallMove THEN
2340
    	line := text.curLine;
2341
    	line := text.curLine;
2341
    	cnt := textsize.Y - 1;
2342
    	cnt := textsize.Y;
2342
    	y := y + charHeight*(text.cursor.Y - text.scroll.Y);
2343
    	y := y + charHeight*(text.cursor.Y - text.scroll.Y);
2343
    	G.SetColor(canvas, colors.back);
2344
    	G.SetColor(canvas, colors.back);
2344
    	G.FillRect(canvas, padding.left - 2, y - inter DIV 2, size.X - 1, y - inter DIV 2 + charHeight);
2345
    	G.FillRect(canvas, padding.left - 2, y - inter DIV 2, size.X - 1, y - inter DIV 2 + charHeight);
2345
    	n := text.cursor.Y
2346
    	n := text.cursor.Y
2346
    ELSE
2347
    ELSE
2347
	    line := firstLine;
2348
	    line := firstLine;
2348
    	cnt := 0
2349
    	cnt := 0
2349
    END;
2350
    END;
Line 2350... Line 2351...
2350
 
2351
 
2351
    WHILE (line # NIL) & (cnt < textsize.Y) DO
2352
    WHILE (line # NIL) & (cnt <= textsize.Y) DO
2352
        backColor := colors.back;
2353
        backColor := colors.back;
2353
        IF (line = text.curLine) & ~selected(text) THEN
2354
        IF (line = text.curLine) & ~selected(text) THEN
2354
            G.SetColor(canvas, colors.curline);
2355
            G.SetColor(canvas, colors.curline);
2355
            G.FillRect(canvas, padding.left - 2, y - inter DIV 2, size.X - 1, y - inter DIV 2 + charHeight);
2356
            G.FillRect(canvas, padding.left - 2, y - inter DIV 2, size.X - 1, y - inter DIV 2 + charHeight);
Line 2381... Line 2382...
2381
    G.SetColor(canvas, colors.numback);
2382
    G.SetColor(canvas, colors.numback);
2382
    G.FillRect(canvas, 0, 0, padding.left - pad_left (*+ 1*), size.Y - 1);
2383
    G.FillRect(canvas, 0, 0, padding.left - pad_left (*+ 1*), size.Y - 1);
2383
    line := firstLine;
2384
    line := firstLine;
2384
    SetColor(colors.numtext, colors.numback);
2385
    SetColor(colors.numtext, colors.numback);
2385
    y := padding.top + inter DIV 2;
2386
    y := padding.top + inter DIV 2;
2386
    n := MIN(text.scroll.Y + textsize.Y, text.count);
2387
    n := MIN(text.scroll.Y + textsize.Y + 1, text.count);
2387
    FOR i := text.scroll.Y + 1 TO n DO
2388
    FOR i := text.scroll.Y + 1 TO n DO
2388
        IF lineNumbers THEN
2389
        IF lineNumbers THEN
2389
            IF (i MOD 10 = 0) OR (i - 1 = text.cursor.Y) OR line.label THEN
2390
            IF (i MOD 10 = 0) OR (i - 1 = text.cursor.Y) OR line.label THEN
2390
                U.int2str(i, s);
2391
                U.int2str(i, s);
2391
                G.TextOut2(canvas, (numWidth - U.lg10(i) - 1)*wNum - wNum DIV 2, y, s, LENGTH(s))
2392
                G.TextOut2(canvas, (numWidth - U.lg10(i) - 1)*wNum - wNum DIV 2, y, s, LENGTH(s))
Line 2394... Line 2395...
2394
                G.HLine(canvas, y - inter DIV 2 + charHeight DIV 2, xNum - wNum DIV (1 + ORD(i MOD 5 # 0)), xNum)
2395
                G.HLine(canvas, y - inter DIV 2 + charHeight DIV 2, xNum - wNum DIV (1 + ORD(i MOD 5 # 0)), xNum)
2395
            END
2396
            END
2396
        END;
2397
        END;
2397
        IF line.label THEN
2398
        IF line.label THEN
2398
            FOR x := wNum DIV 2 TO (padding.left - pad_left) - wNum DIV 2 DO
2399
            FOR x := wNum DIV 2 TO (padding.left - pad_left) - wNum DIV 2 DO
2399
                G.notVLine(canvas, x, y, y + charHeight - inter);
2400
                G.notVLine(canvas, x, y, y + charHeight - (inter + 1));
2400
                G.xorVLine(canvas, x, y, y + charHeight - inter)
2401
                G.xorVLine(canvas, x, y, y + charHeight - (inter + 1))
2401
            END
2402
            END
2402
        END;
2403
        END;
2403
        NextLine(line);
2404
        NextLine(line);
2404
        INC(y, charHeight)
2405
        INC(y, charHeight)
2405
    END;
2406
    END;
Line 2407... Line 2408...
2407
    IF text.searchText # "" THEN
2408
    IF text.searchText # "" THEN
2408
    	IF text.smallMove THEN
2409
    	IF text.smallMove THEN
2409
    		firstLine := text.curLine;
2410
    		firstLine := text.curLine;
2410
    		lastLine := firstLine
2411
    		lastLine := firstLine
2411
    	ELSE
2412
    	ELSE
2412
    	    lastLine := getLine2(text, MIN(text.scroll.Y + textsize.Y, text.count) - 1)
2413
    	    lastLine := getLine2(text, MIN(text.scroll.Y + textsize.Y + 1, text.count) - 1)
2413
        END;
2414
        END;
2414
        p := text.foundList.first(Search.tPos);
2415
        p := text.foundList.first(Search.tPos);
2415
        WHILE p # NIL DO
2416
        WHILE p # NIL DO
2416
        	y := padding.top + inter DIV 2;
2417
        	y := padding.top + inter DIV 2;
2417
        	IF text.smallMove THEN
2418
        	IF text.smallMove THEN