hi,
I have recently taken over the a project for someone, one of the issues we have come across is that you cant view an entire document, in a window with scroll bars if its really big. I track this problem down to the ranges on the scroll bars. Once the range of the scroll bar exceeds 32000 pixels, it is set, by my ex-colleague back to 32000. So when you view a document, depending on the zoom factor you may only see a fraction of the document (until you let the zoom, zoom out to say 25% and you can see the whole document but its obviously too smal. So easy fix I thought just not have that reset in there...wrong. Now you can scroll fine but when you get a certain way down the scroll bar, this is holding the scrolling tab, it stops, the document is reset to the top, and when you let go off the tab, it returns to the top too. However if u use the arrows, it is fine, or click in the empty space on the scroll bar below the scrol tab then it will go to the end for you, I am so confused on this one, it doesnt make any sense to me. One why it wont work and two why some one would put a limit on it, presumably one is to avoid the other but this doesnt make a great deal of sense to me!
any ideas people
thanks
Will

Scroll limitation issue
venil
when u mentioned device co-ordinates that got me thinking and i found the following code, as it reads to me, this would not prevent my issue, but i think you might find an error in it
if ( CS_OBJECT::output_type == OUTPUT_PRINTER )the name of this function is prepare_dc (CDC dc)
{
get_layers().m_printer_data.prepare_dc (dc);
return;}
if ( CS_OBJECT::output_type == OUTPUT_METAFILE ) return;dc.SetMapMode (MM_ISOTROPIC);
if(!dc.IsPrinting()){
CSize wsize = m_zoomer.get_wext();
if ( wsize.cx > 32000 )wsize.cx = 32000;
if ( wsize.cy > 32000 )wsize.cy = 32000;
dc.SetWindowExt ( wsize);
CSize size = m_zoomer.get_vport();
if ( size.cx > 32000 )size.cx = 320000;
if ( size.cy > 32000 )size.cy = 320000;
dc.SetViewportExt(size);
}
}
Ripsin
Read the notes here
http://msdn.microsoft.com/library/default.asp url=/library/en-us/shellcc/platform/commctls/scrollbars/scrollbarreference/scrollbarfunctions/setscrollrange.asp
DeTraut
this is wierd
Will
Alun Jones
On the other hand.
I think its safe to say that my scroll bar is not limited to 16-bit, because i can in fact scroll all the way down my document, i just cant do it by holding the scroll bar and moving it, which would seem to disprove my above arguement. I'm really confused on this
Will
jfy_zhang
Thanks for your response, I knew it was far too limiting. However...The view I am using uses CScrollView, and therefore the way the scroll bar limits are set is with a call to SetScrollSizes. This appears to have the limitation, is there a way around this, or will I have to change the view entirely
Thanks
Will
DaaDa Ng
Debug into the code and see if you translation of the maximum scrollrange is truncated by some device coordinates calculations.
chip_cary
Richard Curley
will
Vinh Dang
Then I said to set the horizontal and vertical values for these two methods too actual page size, but still nothing, blank page, whats your understanding of these two methods The viewport one, mentions that if an error occurs it is rest to 0,0 horizontal and vertical co-ordinates, which may explain my document reverting right to the top, however upon a check on this method it worked fine.
Any ideas
Thanks
Will
Alberto Manzanilla
The code for this can be found in the function CScrollView::UpdateBars!
The message handlers for WM_VSCROLL and WM_HSCROLL do not use the position value in the message, they always use GetScrollPos. This function also returns a 32bit value.
AFAIK there should be no problem with a 32bit range when using CScrollView!
marcusaurelius
this has been the only problem the whole time
Will
Canuck
As I said my predecessor limited the range to 32,000, with simeple code like
if (y_range > 32000)
{
y_range = 32000;
}
Its a self imposed restrictions, but if the getscrollpos method always returns a 32 bit range then cant I simply take out this restriction I cant because this doesnt work, so i assume i use the setscrollpos and getscrollpos methods, but when, they seem to use a structures in order to operate I'm confused as to the purpose of these methods/how they actually work and how to implement them
Thanks
Will
Antonio Yonekura
CScrollView itself should handle the case of ranges greate than 0xFFFF
What happens to you application if you remove this limitation.
Does the scrollbar reflect the original size
What happens if you say ir doesn't work
Again: You have to do nothing to handle scrol bar ranges with CScrollView > 16bit!
Ilya Haykinson
I can still scroll a large part of the document upto 69606, but, i cant use the scroll box to do it, i have to use the arrows, pgup and down, or click in the empty space of the scroll bar to get it to 'jump' to my position. In addition when i zoom into my document more and more of the bottom of it gets cut-off, it seems there is some sort of finite drawing area i can only have so many pixels
Thanks for your help on this
Will