I have just tried running my main
application with py2exe using Vista and was pleased to discover it
appears to be running smoothly, although I haven’t done any rigorous
testing yet. One thing I did notice is that ListCtrl’s in report mode
take up far more vertical space and now, like OS X, the items appear to
be almost double-spaced. I assume that, on both OS’s, it is down to the
native implementation and, correct me if I am wrong, there is no way to
specify spacing in the wx.ListCtrl methods.
For the cases where space is limited, I’m thinking of implementing the
functionality of a ListCtrl, including a virtual control, using a
read-only wx.Grid, which would permit more control over its appearance.
Does this sound a sensible way to go? I suppose the alternative would
be a generic, owner-drawn ListCtrl, but I don’t know quite what that
would involve - is it even feasible ( – Andrea?)?
For the cases where space is limited, I'm thinking of implementing the
functionality of a ListCtrl, including a virtual control, using a read-only
wx.Grid, which would permit more control over its appearance. Does this
sound a sensible way to go? I suppose the alternative would be a generic,
owner-drawn ListCtrl, but I don't know quite what that would involve - is it
even feasible ( -- Andrea?)?
I already have a complete implementation of an owner-drawn wxListCtrl,
taken and traslated directly from the generic wxListCtrl. At present
state, it has the same feature of wxListCtrl but it is completely
owner-drawn. It can also run the wxPython wxListCtrl demo.
At the beginning of the translation process from C++ to Python, I
wanted to enhance the control in order to handle variable-height rows,
and the possibility to add any kind of widgets inside every "cell" of
wxListCtrl. To make it behave like CustomTreeCtrl does right now.
Unfortunately, the second wish (every kind of widget attached to a
wxListCtrl "cell") *requires* the first wish (variable-height rows).
And more unfortunately (if this is even possible), there is NO way to
handle that. Some will probably suggest wxVScrolledWindow: it is not
enough, I also need variable-width columns.
For that reason I asked about wxHVScrolledWindow, implemented few
months ago in wxWidgets and promptly kicked away for some misterious
reasons.
So, it can be done in two ways: either you customize a grid as you
were thinking, or I (we) should find a way to make the owner-drawn
wxListCtrl work.
I have just tried running my main application with py2exe using Vista and was pleased to discover it appears to be running smoothly, although I haven't done any rigorous testing yet. One thing I did notice is that ListCtrl's in report mode take up far more vertical space and now, like OS X, the items appear to be almost double-spaced. I assume that, on both OS's, it is down to the native implementation and, correct me if I am wrong, there is no way to specify spacing in the wx.ListCtrl methods.
For the cases where space is limited, I'm thinking of implementing the functionality of a ListCtrl, including a virtual control, using a read-only wx.Grid, which would permit more control over its appearance. Does this sound a sensible way to go? I suppose the alternative would be a generic, owner-drawn ListCtrl, but I don't know quite what that would involve - is it even feasible ( -- Andrea?)?
In the meantime you may want to also try the TreeListCtrl without a tree.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
For the cases where space is limited, I'm thinking of implementing the
functionality of a ListCtrl, including a virtual control, using a read-only
wx.Grid, which would permit more control over its appearance. Does this
sound a sensible way to go? I suppose the alternative would be a generic,
owner-drawn ListCtrl, but I don't know quite what that would involve - is it
even feasible ( -- Andrea?)?
I already have a complete implementation of an owner-drawn wxListCtrl,
taken and traslated directly from the generic wxListCtrl. At present
state, it has the same feature of wxListCtrl but it is completely
owner-drawn. It can also run the wxPython wxListCtrl demo.
At the beginning of the translation process from C++ to Python, I
wanted to enhance the control in order to handle variable-height rows,
and the possibility to add any kind of widgets inside every "cell" of
wxListCtrl. To make it behave like CustomTreeCtrl does right now.
Unfortunately, the second wish (every kind of widget attached to a
wxListCtrl "cell") *requires* the first wish (variable-height rows).
And more unfortunately (if this is even possible), there is NO way to
handle that. Some will probably suggest wxVScrolledWindow: it is not
enough, I also need variable-width columns.
For that reason I asked about wxHVScrolledWindow, implemented few
months ago in wxWidgets and promptly kicked away for some misterious
reasons.
IIRC it was because it duplicated most of the code from wxVScrolledWindow instead of refactoring and sharing as much as possible between the two classes. The original author was going to come back with a new patch but never did. IMO it would also make sense to just add variable sized horizontal scrolling to wxVScrolledWindow and make the V stand for Variable instead of Vertical.
So, it can be done in two ways: either you customize a grid as you
were thinking, or I (we) should find a way to make the owner-drawn
wxListCtrl work.
Have you given any thought to implementing a Python version of wxVScrolledWindow + horizontal scrolling?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Have you given any thought to implementing a Python version of
wxVScrolledWindow + horizontal scrolling?
No, because the internal working of scrolling things still baffles me.
I still have to correctly understand how to handle scrollbars in a
correct way, so I will end up duplicating again a bunch of code and
maybe come up with a slower, buggier and less-attractive
wxHVScrolledWindow. Which is not very nice for a fast widget like
wxListCtrl.
I have no idea how Vadim was able to invent the code of
wxVScrolledWindow, but it's beautifully made. I am for sure *not* a
professional coder
using Vista .. ListCtrl's in report mode take up far more vertical space ..
.. For the cases where space is limited, I'm thinking of implementing the functionality of a ListCtrl, using a read-only wx.Grid,
In the meantime you may want to also try the TreeListCtrl without a tree.
Hacking around the TreeListCtrl demo was starting to look good. Unfortunately though, the control doesn't seem to generate column header-click events.