Solved

Cursor Box in the output screen!

Posted on 1999-01-14
5
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Let's recap what we learned from yesterday's Skyport Systems webinar.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

622 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