Solved

Cursor Box in the output screen!

Posted on 1999-01-14
5
192 Views
Last Modified: 2010-04-16
I want to be able to draw a cursor box in the output screen and then be able to move the cursor about(using arrow keys) without deleting the output text. I want to incorporate this in something big I want to develop.
0
Comment
Question by:zebe73
5 Comments
 
LVL 1

Accepted Solution

by:
eviltekk earned 10 total points
ID: 1216912
Use These Procedures:
---------------------------------------------------------
Var VirtualScreen : Array [1..4000] of Char;

Procedure SaveScreen;
Begin
Move(Ptr($B800,0)^,VirtualScreen,4000);
End;


Procedure RestoreScreen;
Begin
Move(VirtualScreen,Ptr($B800,0)^,4000);
End;
----------------------------------------------


Just Make Call to SAVESCREEN before drawing the box, and RESTORESCREEN before each time you move it or delete it.
(RESTORESCREEN will delete the box; you'll need to re-write it -it can be done through the same way. if you want to know how, comment me.


0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1216913
?
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1216914
To create a cursor that looks like a box you should use assembler, and than the other pat is easy,, I can give you some source codes if you need...
0
 

Expert Comment

by:thunderchopper
ID: 1216915
Hi,
this sounds like a textmode thing to me ...
In textmode, the screenbuffer is located at [b800:0000]. From this address onwards, the screen is represented line by line, 2 bytes per character. The first byte is the ascii code of the character, the second its color attribute. You can change the color to anything you like without affecting the actual text.

eg.

Procedure SetColor(x,y:word;color:byte);
begin
   Mem[$b800:x+y*80+1]:=color;
end;

so the steps in your prog would be :

- store color at cursor position
- set cursor
- wait for keyboard input
- restore old color at cursor position
- store old color at new cursor position
- set cursor at new position


If you have any queries feel free to mail me at thunderchopper@hotmail.com
0
 

Expert Comment

by:onalenna
ID: 1216916
Zebe73,

I recommend that you use ASSEMBLER.Remember the cursor moving programs
we used to write, way back(le ka ngwaga mongwe tota!!)?.If you can use the ideas
from those programs then i think you will get somewhere. Besides it's fun programming
in assembler,so give it your best shot!!!!!!!!


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now