-
January 2nd, 2006, 08:38 AM
#1
SetScrollSizes blink
Hi!!
I´m using SetScrollSizes to set the bars of a CScroolView Window. I only know the document size after the very first time I print it (on OnDraw). So I´m declaring a flag that sinalizes if it is the very first time the document is being printed, if so I call SetScroolSizes. The problem is that when SetScroolSizes is called the bars appear ok but the window blink, and then it blink again to show the document. How to avoid this first blink?
Thank you in advance.
-
January 2nd, 2006, 08:59 AM
#2
Re: SetScrollSizes blink
Try setting the scroll-sizes in OnSize.
-
January 2nd, 2006, 10:54 AM
#3
Re: SetScrollSizes blink
That is the problem, on OnSize I don´t have the document sizes yet. I have the sizes only after the first draw. I compute the size doing:
Code:
CMyScrollView::OnDraw(CDC* pDC)
{
...
if(Extremex < pDC->GetTextExtent(strLinhaAtual.c_str()).cx)
Extremex = pDC->GetTextExtent(strLinhaAtual.c_str()).cx;
Extremey = ++NLines * CharSize.cy;
...
}
strLinhaAtual.c_str() has the line being printed.
Extreme(x and y) will have the doc size at when all lines are printed.
Thank you
-
January 2nd, 2006, 10:59 AM
#4
Re: SetScrollSizes blink
In OnSize, you can create a CDC like this:
CWindowDC dc(this);
if(Extremex < dc.GetTextExtent(strLinhaAtual.c_str()).cx)
....
Does this help?
-
January 2nd, 2006, 01:10 PM
#5
Re: SetScrollSizes blink
Yes, but I´ll need to read all document at first time without print it just to get its extents. I would like to avoid this step. I would like to try another solution (if it exists).
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|