home *** CD-ROM | disk | FTP | other *** search
- { MSCURSOR.INC
- MS 4.0
- Copyright (c) 1985, 87 by Borland International, Inc. }
-
- procedure EdGotoxy(C, R : Byte);
- {-move the "cursor" to the specified row and column}
-
- begin {EdGotoxy}
- if SolidCursor then
- if (CurScrCol <> C) or (CurScrRow <> R) then
- {Erase current cursor}
- EdEraseSolidCursor;
- {Keep the hardware cursor positioned even if it is invisible}
- GoToXY(C, R);
- CurScrCol := C;
- CurScrRow := R;
- end; {EdGotoxy}
-
- procedure EdUpdateCursor;
- {-Move the cursor to the right spot}
- var
- Col : Integer;
-
- begin {EdUpdateCursor}
- with Curwin^ do begin
- {Position cursor within a window}
- Col := EdComputeEffectiveColNo(AT, Curline, Colno);
- if AT then begin
- if SolidCursor then
- EdSetInsertMode(Insertflag)
- else if (Colno <= Curline^.Bufflen) and (PrintMap[Curline^.Txt^[Colno]] <> PrtNone) then
- {Use a solid block to indicate control char}
- EdSetCursor(CenterCursor)
- else
- EdSetInsertMode(Insertflag);
- end else
- EdSetInsertMode(Insertflag);
-
- EdGotoxy(Succ(Col-Leftedge+Leftcol), Pred(Firsttextno+Lineno));
- end;
- UpdateCursor := False;
- end; {EdUpdateCursor}
-
- procedure EdSetInsertMode(Inserting : Boolean);
- {-Keep the cursor appearance and BIOS keyboard flag up to date}
- var
- BiosKbdFlag : Byte absolute $0040 : $0017;
-
- begin {EdSetInsertMode}
- if Inserting then begin
- if not(SolidCursor) then
- EdSetCursor(BigCursor);
- BiosKbdFlag := BiosKbdFlag or $80;
- end else begin
- if not(SolidCursor) then
- EdSetCursor(CursorType);
- BiosKbdFlag := BiosKbdFlag and $7F;
- end;
- end; {EdSetInsertMode}
-