Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cursor Box in the output screen!

Posted on 1999-01-14
5
Medium Priority
?
202 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 20 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

916 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