Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing text boxes withing Pascal

Status
Not open for further replies.
Sep 14, 2003
2
0
0
ZA
Hi

I am pascal newbie and I have a graphics problem. Im trying to implement text boxes into my program. I only use the crt unit and then I use the Window command.

What I would like to do more specifically is, have 4 blocks on the screen and display seperate text in each block. This is the command I tried to use;

Window (1,20,80,25);
GotoXY (1,20);

Anybody got any suggestions on how to achieve this or
can you point me to some good basic graphics programming tutorials for Pascal.

TIA

 
See also thread935-587129

The window procedure has nothing to do with the graphical windows you might be used to. When creating a window, all cursor operations happen within that window, so there's no need to call gotoxy(1,20) since you already are at that coordinate and within the window it is mapped to (1,1). To change something in another window, you must call the window function again.
The best way to see what the procedure does is: make a window, change the background color and execute a clrscr; then write a lot of text to the screen.

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
I've read somewhere that within Pascal(I use FreePascal)
the dimensions for the screen is 80 X 25.
If i use the window command, must the x and y inputs
conform to that standard or do I specify according to
pixel resolution (640 X 480).
Also if I create the text boxes and I want to use
them again later in my program, do I have to initialize
the window again?

Thanks,
 
If you've read Thread935-587129, you know that the window procedure merely masks out the rest of the screen; that's all it does! The top left coordinate of any window (including 80x25 window) is always (1,1).
If you want to write to another window, regardless of it "existing" already, you have to call the window procedure again. The locations of previously defined windows are not saved. The only use of the window procedure in my opinion is to make part of the screen scroll and to color certain areas of the screen.

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
to use graphics unic in pascal, use a code example. for example type circle in editror and press ctrl+f1 on it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top