Board index » cppbuilder » TCustomDrawGrid repalcement

TCustomDrawGrid repalcement


2007-12-08 01:08:15 AM
cppbuilder30
I need a tCustomDrawGrid replacement that will allow me to access more than
an ints worth of rows, i.e. ARow must be an __int64. I either need a third
party one or some pointers on how I would go about modifying TCustomDrawGrid
to have this capability - if this is possible.
Paul
 
 

Re:TCustomDrawGrid repalcement

"Paul" < XXXX@XXXXX.COM >wrote:
Quote

I need a tCustomDrawGrid replacement that will allow me to
access more than an ints worth of rows, i.e. ARow must be an
__int64.
I've always enjoyed M$ products. I bet this one will be just
as pleasent to use. I think spending several minutes scaning
up to 18,446,744,073,709,551,616 records will be very
productive simply because of it's speed and ease of use!
~ JD
 

Re:TCustomDrawGrid repalcement

Was that meant to be helpful?
 

{smallsort}

Re:TCustomDrawGrid repalcement

Hi Paul
Paul says:
Quote
Was that meant to be helpful?

I think he was trying to tell You that it will be
to slow to work.
If You want a DrawGrid to work with that many cells
You will have to make it virtual.
Kind regards
Asger
 

Re:TCustomDrawGrid repalcement

Asger it works fine with files up to 32GB (2GB x 16 bytes per row)
As the drawgrid cells are populated with the OnDrawCell event it makes no
difference how big the source file is - the visible portion of the grid is
just displaying a window onto the data. 2K or 2GB the speed is exactly the
same.
However to deal with files>32GB (which is very common) I need to be able
to address rows>2GB, whilst this can be done (and now has) it makes the
logic complex and introduces more scope for bugs.
 

Re:TCustomDrawGrid repalcement

"Paul" < XXXX@XXXXX.COM >wrote:
Quote

[...] 2K or 2GB the speed is exactly the same.

However to deal with files>32GB (which is very common) I
need to be able to address rows>2GB,
This is where the speed issue comes in. Past 2GB, the
scrollbar is useless. Do you really expect the user to
arrow/page down an additional 2GB?
If you insist on pursuing this approach, you'll need a 64bit
scrollbar or you'll have to emulate one buy subclassing the
grid's WndProc method so that you can process WM_VSCROLL and
manually set the scrollbar's position. Be sure to read the
docks on WM_VSCROLL because it's only a 16bit position.
You might find it easier to remove the scrollbar from the
grid and use a TScrollBar with an OnScroll event. It has
the exact same scroll codes so the logic would be quite
similar.
The idea would be to half the number of entries for the
scrollbar's range and manage it's scroll position to
reflect that it's current position * 2 = real scroll position.
~ JD
 

Re:TCustomDrawGrid repalcement

"Paul" < XXXX@XXXXX.COM >wrote:
Quote

Was that meant to be helpful?
It was intended to make you rethink the design (the sarcasim
was an added bonus for me).
Certainly, this data is organized into some sort of meaningful
groupings. I know that it's a bit more work and initializes a
bit slower but it makes it infinately more usable.
~ JD
 

Re:TCustomDrawGrid repalcement

Hi Paul
Paul says:
Quote
Asger it works fine with files up to 32GB (2GB x 16 bytes per row)

As the drawgrid cells are populated with the OnDrawCell event it makes no
difference how big the source file is - the visible portion of the grid is
just displaying a window onto the data. 2K or 2GB the speed is exactly the
same.
If I understand You correct then You are already doing some
virtual.
Quote

However to deal with files>32GB (which is very common)
Just out of curiosity, where do You find files that big,
I don't think I ever seen a file bigger then 4GB.
Quote
I need to be able to address rows>2GB,
whilst this can be done (and now has) it makes the
logic complex and introduces more scope for bugs.
Dont have to.
In a virtual listview for instance You just keep track of
the TopRow index and all visual interaction is calculated
according to that index, when You scroll You set the TopRow
and then show a page from that index, when You select You
just do Selected + TopRow.
But of cource there is a few extra lines of code that can
introduce bugs.
Kind regards
Asger
 

Re:TCustomDrawGrid repalcement

Asger Joergensen < XXXX@XXXXX.COM >wrote:
Quote

If I understand You correct then You are already doing some
virtual.
A TDrawGrid doesn't have any actual data strings (Cells). You
just set the RowCount and it generates OnDrawCell events as
usual. It's the users responsibility to supply all drawing
for the cell, including the data string (if any).
Sounds just like a virtual TListView doesn't it? It's just that the word 'virtual' isn't associated with a TDrawGrid.
Quote
Just out of curiosity, where do You find files that big,
I don't think I ever seen a file bigger then 4GB.
System logging for one.
Quote
>I need to be able to address rows>2GB,
>whilst this can be done (and now has) it makes the
>logic complex and introduces more scope for bugs.

Dont have to. In a virtual listview for instance You just
keep track of the TopRow index and all visual interaction
is calculated according to that index, [...]
And what happens when that index reaches 0xFFFFFFFF and you
add 0x01 to it?
~ JD
 

Re:TCustomDrawGrid repalcement

Hi JD
JD says:
Quote
A TDrawGrid doesn't have any actual data strings (Cells). You
just set the RowCount and it generates OnDrawCell events as
usual. It's the users responsibility to supply all drawing
for the cell, including the data string (if any).

Sounds just like a virtual TListView doesn't it? It's just that
the word 'virtual' isn't associated with a TDrawGrid.
Yes it does, I never used a TDrawGrid, i gues thats the reaso for
my ignorance.;-)
Quote

And what happens when that index reaches 0xFFFFFFFF and you
add 0x01 to it?
Well I would think it was obvious that You need to do
some mapping, I was only painting a picture of the
general idea.
Kind regards
Asger
 

Re:TCustomDrawGrid repalcement

Quote
Just out of curiosity, where do You find files that big,
I don't think I ever seen a file bigger then 4GB.
I have an image copy of a 500GB hard disk drive in front of me
 

Re:TCustomDrawGrid repalcement

Quote
This is where the speed issue comes in. Past 2GB, the
scrollbar is useless. Do you really expect the user to
arrow/page down an additional 2GB?
Yes - I do it regularly using other tools (that have other limitations) I
spend most of my time looking at image copies of hard disk drives - I have
now control over where a bit of data athat might be of interest lies so I
end up jumping/searching and scrolling all over the place - and certainly
regularly past a 2GB point.
When looking at some image files (say of tapes) one of the first things I
may do might be to jump to the end and start scrolling backwards
 

Re:TCustomDrawGrid repalcement

Quote
Dont have to.
In a virtual listview for instance You just keep track of
the TopRow index and all visual interaction is calculated
according to that index, when You scroll You set the TopRow
and then show a page from that index, when You select You
just do Selected + TopRow.
That has already been done - it does make the logic more complex - but it
has been implemented and is working now - I was just looking for an off the
shelf solution if one was out there.
 

Re:TCustomDrawGrid repalcement

Quote
Certainly, this data is organized into some sort of meaningful
groupings. I know that it's a bit more work and initializes a
bit slower but it makes it infinately more usable.
The data is often organized into meaningful groupings - but the problem is
that I dont usually know what they are - the tool is designed to allow me to
examine a large file and find out what thiose groupings are - cart before
horse etc.
So the designed has been thought through and it is absolutely essential that
a user can step backweards and forward at will through very large files.
 

Re:TCustomDrawGrid repalcement

Hi Paul
Paul says:
Quote
>Just out of curiosity, where do You find files that big,
>I don't think I ever seen a file bigger then 4GB.

I have an image copy of a 500GB hard disk drive in front of me
Yes of course Imagefiles I forgot all about those
sory.;-)
Kind regards
Asger