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

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


Huge amount of data in a view

Paul E. Rosen -- prosen@fte.com
Wednesday, October 23, 1996

Environment: Win 95, VC 4.2

Hi,

I'm creating a view that potentially has a huge amount of lines, more than I'd
like to process at once in CMyView::OnInitialUpdate(). Since only a small
percentage of the lines appear on the screen at once, I'd like to only process
the ones I need. How do I do this?

This is actually a problem in two different views, one will probably be based
on CListView, and the other on CRichEdit.

Thanks in advance,



Paul Rosen, Frontline Test Equipment, Inc.
Internet: prosen@fte.com, http://www.fte.com, ftp.fte.com
Voice: 804-984-4500, Fax: 804-984-4505, BBS: 804-984-4503
Real Mail: PO Box 7507, Charlottesville, VA  22906-7507, USA
Location: 2114 Angus Road, Suite 228, Charlottesville, VA 22901





Randy Taylor -- drt@ebt.com
Friday, October 25, 1996

[Mini-digest: 2 responses]

For the CListView, use the new LVS_OWNERDATA style
from the commctrl.h file. Read all about it in
the October, November 1996 Microsoft Systems Journal.
For RichEdit view, just render the data which is
supposed to be showing, and not the hole thing.

If you just want to use pretty fonts, and have
colored text and don't need any of the "word processor"
or "rich text" functionality of the RichEdit, then
you might want to use the CListView instead.

Note: the new COMMCTRL.DLL distributed with
IE 3.0 is not re-distributable yet... You can
consider the dll to be beta-sort-of, but the
headers are available now, if you wish to
start programming with it.

randy_taylor@ebt.com


>Environment: Win 95, VC 4.2
>
>Hi,
>
>I'm creating a view that potentially has a huge amount of lines, more than I'd
>like to process at once in CMyView::OnInitialUpdate(). Since only a small
>percentage of the lines appear on the screen at once, I'd like to only process
>the ones I need. How do I do this?
>
>This is actually a problem in two different views, one will probably be based
>on CListView, and the other on CRichEdit.
>
>Thanks in advance,
>
>
>
>Paul Rosen, Frontline Test Equipment, Inc.
>Internet: prosen@fte.com, http://www.fte.com, ftp.fte.com
>Voice: 804-984-4500, Fax: 804-984-4505, BBS: 804-984-4503
>Real Mail: PO Box 7507, Charlottesville, VA  22906-7507, USA
>Location: 2114 Angus Road, Suite 228, Charlottesville, VA 22901
>
>
>

-----From: Mike Blaszczak 

At 12:19 10/23/96, Paul E. Rosen wrote:
>Environment: Win 95, VC 4.2

>I'm creating a view that potentially has a huge amount of lines, more than I'd
>like to process at once in CMyView::OnInitialUpdate(). Since only a small
>percentage of the lines appear on the screen at once, I'd like to only process
>the ones I need. How do I do this?

Measure what's visible and quit processing when you think you're going to start
processing things that are no longer visible.

>This is actually a problem in two different views, one will probably be based
>on CListView, and the other on CRichEdit.

CListView lets you get a reference to the list control within the view by
calling
CListView::GetList

Depending on which display mode you have selected for your list view control,
you might want to use CListCtrl::GetCountPerPage() or CListCtrl::GetItemRect()
or even CListCtrl::FindItem() with LVFI_NEARESTXY to figure out what's going on
inside the control.

Unfortunately, things for a rich edit control are a little more involved.
You'll
need to measure and count almost everything yourself.

>Thanks in advance,

Please buy me some new tyres for my car.  Thanks in advance.


.B ekiM
http://www.nwlink.com/~mikeblas/
I'm afraid I've become some sort of speed freak.
These words are my own. I do not speak on behalf of Microsoft.




Paul E. Rosen -- prosen@fte.com
Monday, October 28, 1996

Environment: Win 95, VC 4.2flat

---From Randy Taylor:

>If you just want to use pretty fonts, and have
>colored text and don't need any of the "word processor"
>or "rich text" functionality of the RichEdit, then
>you might want to use the CListView instead.

All I need is:

1) user selection of any text (like a word processor)

2) individual characters can be different colors

3) more than 64K in the window (actually, with the previous suggestions, this
is probably not a requirement)

I was assuming that I needed RichEdit, is there an easier way? (BTW, this view
is read only)

---From Mike Blaszczak:

>>I'm creating a view that potentially has a huge amount of lines, more than I
'd
>>like to process at once in CMyView::OnInitialUpdate(). Since only a small
>>percentage of the lines appear on the screen at once, I'd like to only
process
>>the ones I need. How do I do this?
>
>Measure what's visible and quit processing when you think you're going to
start
>processing things that are no longer visible.

How do I set up and handle the scroll bar? I need to tell it the total number
of lines and get a message when the user moves it.

>Please buy me some new tyres for my car.  Thanks in advance.

I'll run it by Purchasing and get back to you.


Paul Rosen, Frontline Test Equipment, Inc.
Internet: prosen@fte.com, http://www.fte.com, ftp.fte.com
Voice: 804-984-4500, Fax: 804-984-4505, BBS: 804-984-4503
Real Mail: PO Box 7507, Charlottesville, VA  22906-7507, USA
Location: 2114 Angus Road, Suite 228, Charlottesville, VA 22901






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