Thanks for the quick response - IsEmptyCell clearly doesn't do quite what I want.
I am using a Grid and Table to implement a tree which has a number of data cells associated with each node in the tree. I can use SetCellHeight(0) to succesfully hide collapsed entries. Mouse selection then works, but the cursor allows selection of rows which are not visible. I was hoping to use IsEmptyCell to skip cells which aren't visible.
Could you suggest a better alternative other than intercepting the movement keys.
···
------------------------------------------------------------------------------
Cambridge Broadband appoints telecoms industry veteran John Cronin as chairman <<http://www.cambridgebroadband.com/mi20feb07.htm>
Maxis to upgrade its backhaul network using Cambridge Broadband; Alcatel-Lucent selected to manage entire upgrade project <http://www.cambridgebroadband.com/mi12feb07.htm>
------------------------------------------------------------------------------
Cambridge Broadband Networks Limited
Registered in England and Wales under company number: 03879840
Registered office: Selwyn House, Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, UK
This email and any attachments are private and confidential. If you believe you have received this email in error please inform the sender and delete it from your mailbox or any other storage mechanism. Cambridge Broadband Networks Limited cannot accept liability for any statements made which are clearly the individual sender's own and not expressly made on behalf of Cambridge Broadband Networks Limited.
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Mon 4/23/2007 9:08 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wxPyGridTableBase and IsEmptyCell
John Porter wrote:
Hi
I am using wxPython 2.8.3.0 and having some trouble with wxPyGridTableBase.
As far as I can understand IsEmptyCell should prevent display (and
selection etc) of individual cells in the table's associated Grid.
However, it doesn't seem to make any difference.
Modifying the example in GridCustTable.py so that IsEmptyCell returns
False doesn't prevent display of any cells. The method does get called,
and looking at the code for grid.cpp the IsEmptyCell call should have
some effect....
IsEmptyCell is used as a hint to the grid and the renderers to determine
if a cell has a value or not. This is needed because in you can't
assume that a "" value means the cell is empty in all cases for all data
types. It could be a valid value for some cases. The renderers use
this to know if they can write the content of an overflowed cell over
the specified one. The grid uses it to determine where to stop when
doing MoveCursor*Block method calls, (invoked with the Ctrl-arrow keys)
which just jumps the cursor to the beginning or end of the next
non-empty block of cells.
In GridCustTable if False is always returned then you should see a
Ctrl-arrow will aways jump the cursor to the all the way to the end of
the row or col, but since most of them are filled anyway and there are
no "blocks" then that is almost how it behaves without the change. Try
it instead in a sparsely populated grid to see how it works there.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org