Use case: In a grid, there is a column called 'age'; the grid has been populated. Then I want to show only rows with ages in certain range. Ideally, GridCtrl will provide a method Filter(); it takes a Gate that will allow user program to test if a row should be filtered out. It's very similar to what Search with search-hide-rows do, but allowing for callback.
Maybe this feature is already there, just I don't know how to use it.
2. Custom sorting
Clicking column header to sort is very handy. Unfortunately sometimes it doesn't demonstrate desirable behavior. E.g., the sorting issue I mentioned in an earlier post. And sometimes, a column might be combined from many pieces of data(because it's more screen space efficient to combine them together). In these cases, more flexible sorting is desirable. A Sort() that accepts callback will fix the issue.
3. External data
The only thing I missed from ArrayCtrl is the capability to use external data (SetVirtualCount, etc). There are times that I'd love to have GridCtrl to ask me:"I know you have a total of 100 rows, I am now drawing the 36th row, can you tell me the datum in the 1st column of the row so that I can render it for you? and the 2nd column..."
I think it might be reasonable to insert an intermediate class in the class hierarchy, maybe a GridCtrlBase which has virtal functuions like:
virtual void SetCount(int newcount)=0;
virtual int GetCount()=0;
virtual Value Get(int row, int col)=0;
virtual void Set(int row, int col, Value value)=0;
And GridCtrl, like what it is current doing, provides built-in storage and implements these functions accordingly.]]>Lance2012-03-30T12:10:51-00:00Re: GridCtrl: Feature Requests
https://www.ultimatepp.org/forums/index.php?t=rview&goto=36349&th=6633#msg_36349
.]]>unodgs2012-05-21T14:33:30-00:00Re: GridCtrl: Feature Requests
https://www.ultimatepp.org/forums/index.php?t=rview&goto=36473&th=6633#msg_36473
Lance2012-05-30T21:59:42-00:00