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

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


CScrollView problems

Veeraraghavan -- veera@hiso.honeywell.soft.net
Wednesday, January 24, 1996


Hello,

	I have an application written in MFC and VC++ 2.2 where the view 
is derived from CScrollView instead of CView and looks like Excel 
Spreadsheet.In addition, there are some static controls above the 
headers.My problem is that when the view is scrolled, I want the static 
headers and controls to remain at the same place(meaning, I do not want 
some portion of the view not scroll).I tried SetViewPortOrigin etc but 
did not work.
Thanks for your help in advance.

veera
veera@honeywell.soft.net



Mike Blaszczak -- mikeblas@msn.com
Friday, January 26, 1996

Veeraraghavan wrote:

>	I have an application written in MFC and VC++ 2.2 where the view
> is derived from CScrollView instead of CView and looks like Excel 
> Spreadsheet.In addition, there are some static controls above the 
> headers.My problem is that when the view is scrolled, I want the static 
> headers and controls to remain at the same place(meaning, I do not want 
> some portion of the view not scroll)

You have two choices.

One, you can simply always repaint your headers at the same spot regardless of 
where the window is scrolled.  You can do this using simple math based on the 
scrolled position available to you in the CScrollView, or you can do it by 
painting in OnPrepareDC _before_ the scroll view has had a chance to doctor 
the origin of the view.  (You'll need to set up the origin of the DC 
yourself.)

Or, two, you could do a lot of work to exclude the region occupied by your 
headers from the scrolling region.  You might do this by changing the way the 
view sizes itself in the frame and letting the frame actually paint the 
headers, or you could do it by setting up an exclude region for the rest of 
the window.

> I tried SetViewPortOrigin etc but  did not work.

What, exactly, about SetViewPortOrigin() didn't work?

.B ekiM
TCHAR szDisc[] = _T("These words are my own; I do not speak on behalf of 
Microsoft.");



jshao@pluto.dspt.com
Monday, January 29, 1996


Veeraraghavan wrote:

>	I have an application written in MFC and VC++ 2.2 where the view
> is derived from CScrollView instead of CView and looks like Excel 
> Spreadsheet.In addition, there are some static controls above the 
> headers.My problem is that when the view is scrolled, I want the static 
> headers and controls to remain at the same place(meaning, I do not want 
> some portion of the view not scroll)

I have done a projet which has the same requirement. I used splitter-view to 
do it.

That is, a derived frame-window contains two views, one scroll-view and another is
form-view. The form-view contains the controls and non-scrollable text and 
the scroll-view contains the scrollable text.


-------------------------------------
DSP Technology Inc.
Ann Arbor, MI (313)-973-7062 ext. 146
Name: James Shao
E-mail: jshao@dspt.com
Date: 01/29/96
Time: 08:59:25
-------------------------------------





Deepak Saxena -- deepak@ecn.purdue.edu
Monday, January 29, 1996

> 
> 
> Hello,
> 
> 	I have an application written in MFC and VC++ 2.2 where the view 
> is derived from CScrollView instead of CView and looks like Excel 
> Spreadsheet.In addition, there are some static controls above the 
> headers.My problem is that when the view is scrolled, I want the static 
> headers and controls to remain at the same place(meaning, I do not want 
> some portion of the view not scroll).I tried SetViewPortOrigin etc but 
> did not work.
> Thanks for your help in advance.
> 
> veera
> veera@honeywell.soft.net
> 

Why not use a  separate window that's aligned right above the view and
has no border?  This way it will look like one unit to the user but won't
be messed with when the user scrolls.

-- 
Deepak Saxena -- deepak@ecn.purdue.edu -- http://cernan.ecn.purdue.edu/~deepak

Pinky, are you pondering what I'm pondering?
Uh, I think so, Brain, but burlap chafes me so.




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