Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Get the row numbers currently drawn
Get the row numbers currently drawn [message #39895] Thu, 09 May 2013 17:13 Go to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I was wondering. Is there a possibility to get the row numbers of the rows currently drawn? By that, I mean the rows that are visible to the user in the ArrayCtrl. If I need to derive a class from the ArrayCtrl in order to get them, that is fine. But I'm not sure where to look.

I think it is a good solution because my ArrayCtrl contains 1,000,000 rows, and I want a timer running to update the value of the rows currently in view, by ReadProcessMemory. It is too slow and expensive to update all million rows, so it would be much nicer if I could just update the rows that are visible! Smile

Thanks in advance!
Re: Get the row numbers currently drawn [message #39899 is a reply to message #39895] Thu, 09 May 2013 21:23 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Crydev,

Did you try bool GrdCtrl::InView()?

Regards
Biobytes
Re: Get the row numbers currently drawn [message #39908 is a reply to message #39899] Fri, 10 May 2013 20:59 Go to previous messageGo to next message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello BioBytes,

I am not able to, because I use the ArrayCtrl instead of the GridCtrl. I do not want to change because I like the SetVirtualCount feature. It made my UI very fast.

Thanks
Re: Get the row numbers currently drawn [message #39910 is a reply to message #39908] Fri, 10 May 2013 21:55 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hello CryDev,

Perhaps you could have a look the ArrayCtrl Embedded functions:

IsCursor
checks whether cursor is in the table (identical to GetCursor() >= 0)
GetCursor
returns current cursor row, -1 when none
GetCursorSc
returns the location of the cursor row within the table view area
ScCursor
scrolls the table to move the cursor row to given location within the table view
CenterCursor
scrolls the table to move cursor into the middle of the current view
ScrollInto
scrolls the table by minimum amount necessary to make given row visible
ScrollIntoCursor
scrolls the table by minimum amount necessary to make cursor row visible
GetScroll
returns current table scrollbar location
ScrollTo
sets table scrollbar location
Find
locates table row containing a given element
FindSetCursor
moves the cursor to table row containing a given element

Some functions allow to check if the row is visible or not.

Regards

Biobytes
Re: Get the row numbers currently drawn [message #39911 is a reply to message #39895] Fri, 10 May 2013 23:04 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Crydev.
crydev wrote on Thu, 09 May 2013 17:13


I was wondering. Is there a possibility to get the row numbers of the rows currently drawn? By that, I mean the rows that are visible to the user in the ArrayCtrl.

After looking at ArrayCtrl::RefreshSel() method, I created following example to get visible range of rows:
Toggle Spoiler

index.php?t=getfile&id=4190&private=0

Edit: Added comment about how to use the GetVisibleRange function result.

[Updated on: Sun, 12 May 2013 09:25]

Report message to a moderator

Re: Get the row numbers currently drawn [message #40960 is a reply to message #39911] Mon, 14 October 2013 10:48 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Thanks Sender Ghost! My response is late because I forgot about this thread. Your solution works fine Smile
Previous Topic: GridCtrl, Editing and DoubleClick
Next Topic: Error: ItemRect::Editable(false) + Tab
Goto Forum:
  


Current Time: Thu Mar 28 09:53:42 CET 2024

Total time taken to generate the page: 0.01168 seconds