Board index » delphi » Need help turning cursor on/off, changing size

Need help turning cursor on/off, changing size

I have found no way in TurboPascal to change the size of the cursor or
turn it off.  When designing an edit line, I would like to have the
cursor size reflect the insert\delete setting.  If anyone knows how to
do this I would greatly appreciate a reply. Thanks!
 

Re:Need help turning cursor on/off, changing size


Re:Need help turning cursor on/off, changing size


Here's a unit that I made that does that and a lot more...

{  QVideo             }
{  10/18/95           }
{  by Jordan Russell  }

unit QVideo;

interface

  procedure BottomRow (const Number: Byte);
  procedure CursorOn;
  procedure CursorOff;
  procedure CursorNormal;
  procedure CursorBig;
  function  DetectVideo: Byte;
  procedure ReadNumber (var Number: Word);
  procedure ReadReal (var Number: Real);

implementation

uses Crt;

  procedure BottomRow (const Number: Byte);
  { Lets you access the bottom row with out it scrolling off sometimes }
  begin
    WindMax := (WindMax and 255) + ((Number - 1) * 256);
  end;

  procedure CursorOn;  assembler;
  { Turns the cursor on }
  asm
    mov  ah, 03h
    xor  bh, bh
    int  10h
    mov  ah, 01h
    and  ch, 159        { x00xxxxx }
    int  10h
  end;

  procedure CursorOff;  assembler;
  { Turns the cursor off }
  asm
    mov  ah, 03h
    xor  bh, bh
    int  10h
    mov  ah, 01h
    and  ch, 159        { x00xxxxx }
    or   ch, 32         { xx1xxxxx }
    int  10h
  end;

  procedure CursorNormal;  assembler;
  { Sets the cursor to the normal size }
  asm
    mov  ah, 03h
    xor  bh, bh
    int  10h
    mov  ah, 01h
    and  ch, 32         { 00x00000 }
    or   ch, 6          { xxxxx11x }
    mov  cl, 7          { 00000111 }
    int  10h
  end;

  procedure CursorBig;  assembler;
  { Sets the cursor to the largest size }
  asm
    mov  ah, 03h
    xor  bh, bh
    int  10h
    mov  ah, 01h
    and  ch, 32         { 00x00000 }
    mov  cl, 7          { 00000111 }
    int  10h
  end;

  function DetectVideo: Byte; assembler;
  { Detects the video card the user has
    00h    no display
    01h    monochrome adapter w/ monochrome display
    02h    CGA w/ color display
    03h    reserved
    04h    EGA w/ color display
    05h    EGA w/ monochrome display
    06h    PGA w/ color display
    07h    VGA w/ monochrome analog display
    08h    VGA w/ color analog display
    09h    reserved
    0Ah    MCGA w/ digital color display
    0Bh    MCGA w/ monochrome analog display
    0Ch    MCGA w/ color analog display
    FFh    unknown display type }
  asm
    mov  ax, 1A00h
    int  10h
    cmp  al, 1Ah
    jne  @1
    mov  al, bl
    jmp  @5
  @1:
    mov  ah, 12h
    mov  bx, 10h
    int  10h
    cmp  bx, 10h
    je   @3
    cmp  bh, 0
    je   @2
    mov  al, 5
    jmp  @5
  @2:
    mov  al, 4
    jmp  @5
  @3:
    int  11h
    not  al
    test al, 30h
    jne  @4
    mov  al, 1
    jmp  @5
  @4:
    mov  al, 2
  @5:
  end;

  procedure ReadNumber (var Number: Word);
  { Reads a integer, protects against Invalid numeric format errors }
  var
    Temp01: String;
    Temp02: Integer;
  begin
    Readln (Temp01);
    Val (Temp01, Number, Temp02);
  end;

  procedure ReadReal (var Number: Real);
  { Reads a real, protects against Invalid numeric format errors }
  var
    Temp01: String;
    Temp02: Integer;
  begin
    Readln (Temp01);
    Val (Temp01, Number, Temp02);
  end;

  end.

Re:Need help turning cursor on/off, changing size


Re:Need help turning cursor on/off, changing size


In article <19951017.202236.884443.NETN...@WVNVM.WVNET.EDU>,
Kenneth Massey  <bla00...@mail.wvnet.edu> wrote:
:I have found no way in TurboPascal to change the size of the cursor or
:turn it off.  When designing an edit line, I would like to have the

 91041 Sep 6 12:13 ftp://garbo.uwasa.fi/pc/ts/tsfaqp28.zip
 tsfaqp28.zip Common Turbo Pascal Questions and Timo's answers

"If you do not know how to go about getting this material, users are
welcome to email me for the prerecorded garbo.uwasa.fi instructions
(long, circa 29Kb). If you do not receive my reply within five days,
please ask your own site's system manager to construct a returnable
mail path for you".

   All the best, Timo

....................................................................
Prof. Timo Salmi   Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi archives  193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa
t...@uwasa.fi http://uwasa.fi/~ts BBS 961-3170972; FIN-65101,  Finland

Re:Need help turning cursor on/off, changing size


bla00...@mail.wvnet.edu meinte am 23.10.95
zum Thema "Need help turning cursor on/off, changing size":

Quote
> I have found no way in TurboPascal to change the size of the cursor or
> turn it off.  When designing an edit line, I would like to have the
> cursor size reflect the insert\delete setting.  If anyone knows how to
> do this I would greatly appreciate a reply. Thanks!

***** For DOS:
Try adresses (Hex)
40:60 for Endline   of cursor (normally 1)
40:61 for Startline of cursor (normally 0)

(both 0 for off <- one of several methods ;)

hope it helps

Wolfgang

## CrossPoint v3.02 ##

Other Threads