HELP -- NEWBIE NEEDS HELP 
Author Message
 HELP -- NEWBIE NEEDS HELP

Hey thanks for reading this....

My problem lies in a program I wrote to draw a box around the perimeter
of a window.  The Right Bottom character constantly scrolls the window
up.  Is there something I missed?  I can get draw the line characters any
where else within the window but soon as I try on that co-ordinate the
whole window scrolls and it looks a mess.  What am I forgeting?

Thanks in advance, I do appreciate it!!!!

Dean



Wed, 19 Mar 1997 13:46:24 GMT  
 HELP -- NEWBIE NEEDS HELP


[SNIP]

Quote:
>What am I forgeting?

Practice in C programming.

Quote:
>Thanks in advance, I do appreciate it!!!!

Ross


Thu, 20 Mar 1997 01:55:25 GMT  
 HELP -- NEWBIE NEEDS HELP

Quote:
>Hey thanks for reading this....
>My problem lies in a program I wrote to draw a box around the perimeter
>of a window.  The Right Bottom character constantly scrolls the window
>up.  Is there something I missed?  I can get draw the line characters any
>where else within the window but soon as I try on that co-ordinate the
>whole window scrolls and it looks a mess.  What am I forgeting?

When you write to the last character position on the screen, the screen
automaticly scrolls up to allow room for the next line.  Try writing to
only (Rows-Per-Screen - 1).  This should prevent the screen from scrolling.

I am substituting the word screen for 'window' as I don't know what system
you are working on, or what you mean by 'window'.

--
Rick Stanley                         |              RSI

Information Technologies Institute   |        C++ & C Language
New York University   NYC, NY  USA   | Programming, Training, Consulting



Wed, 19 Mar 1997 22:27:50 GMT  
 HELP -- NEWBIE NEEDS HELP

Quote:

>My problem lies in a program I wrote to draw a box around the perimeter
>of a window.  The Right Bottom character constantly scrolls the window
>up.  Is there something I missed?  I can get draw the line characters any
>where else within the window but soon as I try on that co-ordinate the
>whole window scrolls and it looks a mess.  What am I forgeting?

Writing a character into the bottom right of a window will always
cause that window to scroll.  There are two ways to avoid this.
One way is to simply expand the size of the window, ie if you
are writing x characters per line, you should make the window
x+1 columns wide.  This will prevent your scrolling problems.
Another technique you can do is to write the bottom border in the
line next to the bottom and the 'push' it down.

You might also be able to avoid these scrolling problems by
writing to a buffer and then displaying the buffer.  As I've
not tried this, I don't know if it will work.

Dan



Wed, 19 Mar 1997 23:21:21 GMT  
 HELP -- NEWBIE NEEDS HELP

Quote:

>Path: chchp.ac.nz!canterbury.ac.nz!comp.vuw.ac.nz!waikato!wupost!howland.reston.ans.net!swiss.ans.net!cmcl2!acf4!stanleyr

>Newsgroups: comp.lang.c
>Subject: Re: HELP -- NEWBIE NEEDS HELP
>Date: 1 Oct 1994 14:27:50 GMT
>Organization: New York University
>Lines: 23


>NNTP-Posting-Host: acf4.nyu.edu
>X-Newsreader: NN version 6.5.0 #5 (NOV)

>>Hey thanks for reading this....

>>My problem lies in a program I wrote to draw a box around the perimeter
>>of a window.  The Right Bottom character constantly scrolls the window
>>up.  Is there something I missed?  I can get draw the line characters any
>>where else within the window but soon as I try on that co-ordinate the
>>whole window scrolls and it looks a mess.  What am I forgeting?

>When you write to the last character position on the screen, the screen
>automaticly scrolls up to allow room for the next line.  Try writing to
>only (Rows-Per-Screen - 1).  This should prevent the screen from scrolling.

>I am substituting the word screen for 'window' as I don't know what system
>you are working on, or what you mean by 'window'.

>--
>Rick Stanley                         |              RSI

>Information Technologies Institute   |        C++ & C Language
>New York University   NYC, NY  USA   | Programming, Training, Consulting

One could also increase the size of the "current window" before writing to
it. (That is, not change any colors, chars, etc, but just redefine the
current window. After that you change it back again. This seems to be an
unnecessary way to go, but its the nature of the functions U use to write to
screen with. Alternatively U can write a function that does not reposition
the place to output afterwards.

Cheers, Joe



Wed, 26 Mar 1997 09:55:24 GMT  
 HELP -- NEWBIE NEEDS HELP
Jeff Mirza posted a help request regarding drawing windows on the screen using test characters.  The problem was that when you got to the bottom-right position, the screen would scroll, destroying the carefully arranged display.

I had that problem when I was writing a small "window" unit in Turbo Pascal.  I was extending the TP concept of window, and one of the things I wanted was pretty borders around the windows.  I got around the problem by:

1. Drawing the bottom line first.  This of course caused that bottom line to
     scroll up one.  No problem!  Because, then I ...
2. Inserted a blank line before the border line, cause everything to
   scroll down one.  Now the window was blank except for a border at the
   bottom.  Perfect!
3. Draw the rest of the borders with no problem.

I didn't see the original post (excerpt reprinted below), so maybe I'm missing important context, but this method worked great for me.  Since you never want to mess with the borders once the window is up, you never have to worry about the scrolling problem again (unless you use the window differently).

Quote:

> >>My problem lies in a program I wrote to draw a box around the perimeter
> >>of a window.  The Right Bottom character constantly scrolls the window
> >>up.  Is there something I missed?  I can get draw the line characters any
> >>where else within the window but soon as I try on that co-ordinate the
> >>whole window scrolls and it looks a mess.  What am I forgeting?

--
---------------------------------------------------------------------
Joel F. Klein, Software Engineer    | Comparator Product Group      |

voice: 708/538-4963   fax: 538-5131 | Radio Network Solutions Group |
Schaumburg, Illinois                | LMPS, Motorola, Inc.          |


Sun, 30 Mar 1997 02:36:28 GMT  
 HELP -- NEWBIE NEEDS HELP

Quote:
>> >>My problem lies in a program I wrote to draw a box around the perimeter
>> >>of a window.  The Right Bottom character constantly scrolls the window
>> >>up.  Is there something I missed?  I can get draw the line characters any
>> >>where else within the window but soon as I try on that co-ordinate the
>> >>whole window scrolls and it looks a mess.  What am I forgeting?

what I do is clear the window "clrscr();" and then increase the window size by one to the right
and one to the bottom.

window (top,left,right,bottom);
clrscr();
window(top,left,right+1,bottom+1);
/*  insert drawing stuff here */
window(top+1,left+1,right-1,bottom-1); /* this way you won't destroy your pretty lines */

--
_______________________________________________________________________________
  __      __   ________
 /  \    /  \ /   __   \    A             Chris Wilson
 \   \  /   / |  /__\  |  C L



Thu, 03 Apr 1997 06:44:52 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Help C newbie need help please

2. Help C newbie need help please

3. NewBie in C needs help - C simple questions(not for me) help help help help!

4. HELP , HELP , HELP - I need a compiler

5. Newbie - fopen help needed

6. Newbie question: Need help please!

7. NEWBIE in need of help

8. A newbie needs help with file processing

9. ***Newbie Needs Help With Functions Program ***

10. Newbie needs help

11. need help Newbie with COM

12. Newbie needs help!

 

 
Powered by phpBB® Forum Software