modifies 4 files:
* wxPython/demo/ListCtrl_edit.py (new demo)
* wxPython/demo/Main.py (include new demo in demo app)
* wxPython/wx/lib/mixins/listctrl.y (several improvements, demonstrated in the demo)
* wxPython/wx/lib/wxpTag.py (some small fixes)
I have to admid that the patch was not created with 'cvs diff'. Since the CVS server is too slow (cvs update ran for several hours without finishing). Instead I a did a diff -rN -U 4 on the wxPytonSrc package vs. an updated tree.
The patch is clean so you should be OK. Let me know if you are having too much conflicts.
modifies 4 files:
* wxPython/demo/ListCtrl_edit.py (new demo)
* wxPython/demo/Main.py (include new demo in demo app)
* wxPython/wx/lib/mixins/listctrl.y (several improvements, demonstrated in the demo)
* wxPython/wx/lib/wxpTag.py (some small fixes)
I have to admid that the patch was not created with 'cvs diff'. Since the CVS server is too slow (cvs update ran for several hours without finishing). Instead I a did a diff -rN -U 4 on the wxPytonSrc package vs. an updated tree.
The patch is clean so you should be OK. Let me know if you are having too much conflicts.
Thanks Pim. I'll start working on it in a few minutes.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
modifies 4 files:
* wxPython/demo/ListCtrl_edit.py (new demo)
* wxPython/demo/Main.py (include new demo in demo app)
* wxPython/wx/lib/mixins/listctrl.y (several improvements, demonstrated in the demo)
* wxPython/wx/lib/wxpTag.py (some small fixes)
I am not going to apply the changes to ListCtrlAutoWidthMixin as it has some quirks that would probably make it appear broken to users. (See below.) I will be checking everything else in shortly. I also added support for Shift-Tab to TextEditMixin.
The issues I have with ListCtrlAutoWidthMixin are:
* Rather than taking an optional first and last column numbers to resize, and assigning special (unintuitive) meaning to None, I think it would be better to just optionally take a list of column numbers. For example::
ListCtrlAutoWidthMixin.__init__(self, [1, 3, 5])
* With your patch (on wxGTK at least, I didn't try it on Windows) when more than one column is being autosized and the user resizes a column manually with the mouse, then the column division is *not* left where the user put it, but the columns are "rebalanced" or something and the column division jumps to someplace else. Also, when I enlarge the window so the columns are autosized larger, and then reduce the window size then the columns are not shrunk again and so I have to scroll to see everything.
If you can fix these things then I'll take another patch. You'll need to make the diff from the current version of the file though.
I am not going to apply the changes to ListCtrlAutoWidthMixin as it has some quirks that would probably make it appear broken to users. (See below.)
First of all unfortunatly the ListCtrl_edit.py demo uses the unmerged ListCtrlAutoWidthMixin's new API so please apply the attached patch (the correct the demo against the merged listctrl mixin).
I will be checking everything else in shortly. I also added support for Shift-Tab to TextEditMixin.
The issues I have with ListCtrlAutoWidthMixin are:
* Rather than taking an optional first and last column numbers to resize, and assigning special (unintuitive) meaning to None, I think it would be better to just optionally take a list of column numbers. For example::
ListCtrlAutoWidthMixin.__init__(self, [1, 3, 5])
Hmm that is handy on small lists. But what if you have 50 columns...
A solution obviously is:
ListCtrlAutoWidthMixin.__init__(self, range(1, numcols+1))
which is OKish but not perfect either certainly given it is a common case.
Note that the my API isn't that unintuitive IMO it is just a slice:
startcol = None, endcol = None is equivalent to [None:None] = [:]
I.e. I don't assign a special meaning to None. It has the same semantics as in a regular slice. But then again having to explain this indicates that something _is_ wrong the API.
So given that your solution is more simple it is probably better. But as you can see I not totally convinced
* With your patch (on wxGTK at least, I didn't try it on Windows) when more than one column is being autosized and the user resizes a column manually with the mouse, then the column division is *not* left where the user put it, but the columns are "rebalanced" or something and the column division jumps to someplace else. Also, when I enlarge the window so the columns are autosized larger, and then reduce the window size then the columns are not shrunk again and so I have to scroll to see everything.
If you can fix these things then I'll take another patch. You'll need to make the diff from the current version of the file though.
I am not going to apply the changes to ListCtrlAutoWidthMixin as it has some quirks that would probably make it appear broken to users. (See below.)
First of all unfortunatly the ListCtrl_edit.py demo uses the unmerged ListCtrlAutoWidthMixin's new API so please apply the attached patch (the correct the demo against the merged listctrl mixin).
Sorry, I thought I had changed that back. Done now.
I will be checking everything else in shortly. I also added support for Shift-Tab to TextEditMixin.
The issues I have with ListCtrlAutoWidthMixin are:
* Rather than taking an optional first and last column numbers to resize, and assigning special (unintuitive) meaning to None, I think it would be better to just optionally take a list of column numbers. For example::
ListCtrlAutoWidthMixin.__init__(self, [1, 3, 5])
Hmm that is handy on small lists. But what if you have 50 columns...
A solution obviously is:
ListCtrlAutoWidthMixin.__init__(self, range(1, numcols+1))
which is OKish but not perfect either certainly given it is a common case.
Note that the my API isn't that unintuitive IMO it is just a slice:
startcol = None, endcol = None is equivalent to [None:None] = [:]
I.e. I don't assign a special meaning to None. It has the same semantics as in a regular slice. But then again having to explain this indicates that something _is_ wrong the API.
So given that your solution is more simple it is probably better. But as you can see I not totally convinced
Well, regardless of which API is better, the problem below was enough to keep it from being checked in.
···
* With your patch (on wxGTK at least, I didn't try it on Windows) when more than one column is being autosized and the user resizes a column manually with the mouse, then the column division is *not* left where the user put it, but the columns are "rebalanced" or something and the column division jumps to someplace else. Also, when I enlarge the window so the columns are autosized larger, and then reduce the window size then the columns are not shrunk again and so I have to scroll to see everything.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Hmm that is handy on small lists. But what if you have 50 columns...
A solution obviously is:
ListCtrlAutoWidthMixin.__init__(self, range(1, numcols+1))
which is OKish but not perfect either certainly given it is a common case.
I would suggest having and None mean "all columns". Then your example would be:
ListCtrlAutoWidthMixin.__init__(self)
The list argument is then only needed if you actually want to choose specific columns to resize.