15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Scrolling limitations of CScrollView

Hugh Robinson -- hugh@ssihou.ssii.com
Tuesday, January 07, 1997


Environment: VC4.1, Win NT 4.0, SP 2.

My app allows the user to draw objects in a CScrollView and to zoom and   
to scroll it.

However, I am encountering problems when zooming in. I originally had the   
application make the viewport extent larger when zooming in. However, if   
I zoom too far in, the distance between one logical coordinate and the   
next can become say 20 pixels on the screen. This causes problems when   
drawing and means that the user can't draw in the exact position that he   
wants to.

I am aware of the limitation that logical coords are not allowed to   
exceed 32767 on Win 95, so I find that I can't get enough zoom   
magnification without this problem of the logical coords becoming visibly   
spaced out on the screen. I would also like the user to be able to have   
his "world" X and Y coordinates not limited to the 0-32767 range : other   
drawing progs. seem to manage this!

So, the other approach I have tried is to implement my own coordinate   
system and implement the zooming between my coord system and Windows'   
logical coord. system in order to make sure that the logical coords do   
not become too spaced out in any given window when you zoom in. This   
works okay except that now I have a problem with setting up the scroll   
bars on the CScrollView, since SetScrollSizes also suffers from the   
limitation of a maximum of 32767 (the docs don't explicitly say so in the   
CScrollView::SetScrollSizes documentation, but I tried it out with   
Scribble and it does seem to be a limitation). So now I am faced with   
thinking about not using CScrollView at all and rolling my own scroll   
bars on a CView. This, however, seems a crazy approach since I am   
throwing away all that nice CScrollView code.

So, my questions are:
(1) Am I missing something incredibly obvious?
(2) Is rolling my own own scroll bars and ditching the CScrollView code a   
sensible approach?
(3) How can I give the user a coordinate system which is not limited to   
the 0 - 32767 range?

Thanks
Hugh Robinson
hugh@ssihou.ssii.com  



Alexander Grigoriev -- alegr@aha.ru
Wednesday, January 08, 1997

[Moderator's note: Hugh, could you please explain to everyone why
this answer isn't acceptable to you?  In case anyone cares, I told
Hugh this as soon as I got his message.  I should have made sure he
made this clear before this made it to the list.]

Use SetScrollInfo() and GetScrollInfo(). They don't suffer from 16 bit
limitation.

----------
> From: Hugh Robinson 
> To: mfc-l 
> Subject: Scrolling limitations of CScrollView
> Date: 8 СОЧБТС 1997 З. 2:50
> 
> 
> Environment: VC4.1, Win NT 4.0, SP 2.
> 
> My app allows the user to draw objects in a CScrollView and to zoom and  

> to scroll it.
> 
> However, I am encountering problems when zooming in. I originally had the
  
> application make the viewport extent larger when zooming in. However, if 
 
> I zoom too far in, the distance between one logical coordinate and the   
> next can become say 20 pixels on the screen. This causes problems when   
> drawing and means that the user can't draw in the exact position that he 
 
> wants to.
> 
> I am aware of the limitation that logical coords are not allowed to   
> exceed 32767 on Win 95, so I find that I can't get enough zoom   
> magnification without this problem of the logical coords becoming visibly
  
> spaced out on the screen. I would also like the user to be able to have  

> his "world" X and Y coordinates not limited to the 0-32767 range : other 
 
> drawing progs. seem to manage this!
> 
[skip]

> 
> Thanks
> Hugh Robinson
> hugh@ssihou.ssii.com  



Hugh Robinson -- hugh@ssihou.ssii.com
Thursday, January 16, 1997


 I had mis-interpreted the moderator's original message to me and hadn't   
realized that he meant that SetScrollInfo() and GetScrollInfo() don't   
suffer from a 16 bit limitation. I will try it!

Thanks for your help.
Hugh Robinson

 ----------
From:  owner-mfc-l
Sent:  Wednesday, January 08, 1997 10:12 PM
To:  mfc-l
Subject:  Re: Scrolling limitations of CScrollView

[Moderator's note: Hugh, could you please explain to everyone why
this answer isn't acceptable to you?  In case anyone cares, I told
Hugh this as soon as I got his message.  I should have made sure he
made this clear before this made it to the list.]

Use SetScrollInfo() and GetScrollInfo(). They don't suffer from 16 bit
limitation.

 ----------
> From: Hugh Robinson 
> To: mfc-l 
> Subject: Scrolling limitations of CScrollView
> Date: 8 СОЧБТС 1997 З. 2:50
>
>
> Environment: VC4.1, Win NT 4.0, SP 2.
>
> My app allows the user to draw objects in a CScrollView and to zoom and   
   


> to scroll it.
>
> However, I am encountering problems when zooming in. I originally had   
the
    

> application make the viewport extent larger when zooming in. However,   
if
   

> I zoom too far in, the distance between one logical coordinate and the   
    

> next can become say 20 pixels on the screen. This causes problems when   
    

> drawing and means that the user can't draw in the exact position that   
he
   

> wants to.
>
> I am aware of the limitation that logical coords are not allowed to
> exceed 32767 on Win 95, so I find that I can't get enough zoom
> magnification without this problem of the logical coords becoming   
visibly
    

> spaced out on the screen. I would also like the user to be able to have   
   


> his "world" X and Y coordinates not limited to the 0-32767 range :   
other
   

> drawing progs. seem to manage this!
>
[skip]

>
> Thanks
> Hugh Robinson
> hugh@ssihou.ssii.com





| Вернуться в корень Архива |