Solved

Cursor Box in the output screen!

Posted on 1999-01-14
5
193 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WSAAdressToString example Delphi code needed 3 1,760
TMemoryStream -> PNGImage -> TIcon convertion 22 1,225
audio record to file 4 1,054
Neural Networks with Delphi 3 1,533
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
With more and more people tethered to the internet, advertisers can reach you in new and creative ways. Push notifications on your smartphone, customized advertisements based on your previous searches, and email inboxes filled with promotional pitch…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

930 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

10 Experts available now in Live!

Get 1:1 Help Now