ANN: ObjectListView 1.1

ObjectListView – A much easier to use wx.ListCtrl

What's new in version 1.1

···

-------------------------

The big improvement in this version is GroupListView - a ListCtrl that
support collecting rows into collapsible groups. You can see an example and
a description of how to use it here:
http://objectlistview.sourceforge.net/python/groupListView.html.

Other improvements in this version:

* Can copy a text version (and, under Windows, a HTML version too) of the
selected rows to the clipboard. By default, this is bound to Ctrl-C.
* Headers can now have their own images
* Search-by-typing now works reliable on all platforms
* Much better behaviour under Linux (and hopefully Mac too)
* The required quota of other small bug fixes

What is ObjectListView?
-----------------------

ObjectListView is a wrapper around the wx.ListCtrl that makes the list
control easier to use. It also provides some useful extra functionality. It
provides the following features:

* Automatically transforms a collection of model objects into a fully
functional wx.ListCtrl.
* Automatically sorts rows.
* Easily edits the cell values.
* Supports all ListCtrl views (report, list, large and small icons).
* Columns can be fixed-width, have a minimum and/or maximum width, or be
space-filling.
* Displays a "list is empty" message when the list is empty (obviously).
* Supports checkboxes in any column
* Supports alternate rows background colors.
* Supports custom formatting of rows.
* Supports searching (by typing) on any column, even on massive lists.
* Supports custom sorting
* The FastObjectListView version can build a list of 10,000 objects in less
than 0.1 seconds.
* The VirtualObjectListView version supports millions of rows through
ListCtrl's virtual mode.
* The GroupListView version supports arranging rows into collapsible groups.

It is available from PyPi or from its website,
http://objectlistview.sourceforge.net/python. Even if you download from
PyPi, the website is still worth looking at – it has lots of useful
information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

Regards,
Phillip
------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com
A man's life does not consist in the abundance of his possessions

Hi Philip,

Does it allow me to attach client data other then integers? This has
been a long standing issue which always bites me when i am using
wx.ListCtrl. wxPython already added a lot of convenience functions,
but still when I want to link a listctrl row (in report mode) with a
class instance of my choice, I need to make some int <--> data pointer
lookup table on the side which really starts to get annoying.

Regards,
- Jorgen

···

On Thu, Jun 12, 2008 at 8:45 AM, Phillip Piper <phillip.piper@gmail.com> wrote:

ObjectListView – A much easier to use wx.ListCtrl

ObjectListView is a wrapper around the wx.ListCtrl that makes the list
control easier to use. It also provides some useful extra functionality. It
provides the following features:

Automatically sorts rows.
Easily edits the cell values.
Supports all ListCtrl views (report, list, large and small icons).
Columns can be fixed-width, have a minimum and/or maximum width, or be
space-filling.
Displays a "list is empty" message when the list is empty (obviously).
Supports checkboxes in any column
Supports alternate rows background colours.
Supports custom formatting of rows.
The FastObjectListView version can build a list of 10,000 objects in less
than 0.1 seconds.
The VirtualObjectListView version supports millions of rows through
ListCtrl's virtual mode.

It is available from PyPi or from its website,
ObjectListView — ObjectListView v1.2 documentation. Even if you download from
PyPi, the website is still worth looking at – it has lots of useful
information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

Regards,

Phillip

------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com
A man's life does not consist in the abundance of his possessions

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Thanks for the feedback.

- Yes, the bmp files are missing. I left "*.bmp" out of the MANIFEST.in.
These files are in the SVN repository.
- You're right about the sorting with the virtual list.
- In the Demo, the "RepopulateList" button simply times how long it takes to
rebuild the list as it current stands. Not the best name, I admit. "Timed
Rebuild" would be more accurate.

Regards,
Phillip

···

------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com
A man's life does not consist in the abundance of his possessions

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Werner F.
Bruhin
Sent: Thursday, 12 June 2008 12:17 PM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] ANN: ObjectListView 1.0

Philip,

Phillip Piper wrote:

ObjectListView - A much easier to use wx.ListCtrl

ObjectListView is a wrapper around the wx.ListCtrl that makes the list
control easier to use. It also provides some useful extra
functionality. It provides the following features:

    * Automatically sorts rows.
    * Easily edits the cell values.
    * Supports all ListCtrl views (report, list, large and small icons).
    * Columns can be fixed-width, have a minimum and/or maximum width,
      or be space-filling.
    * Displays a "list is empty" message when the list is empty
      (obviously).
    * Supports checkboxes in any column
    * Supports alternate rows background colours.
    * Supports custom formatting of rows.
    * The /FastObjectListView/ version can build a list of 10,000
      objects in less than 0.1 seconds.
    * The /VirtualObjectListView/ version supports millions of rows
      through ListCtrl's virtual mode.

It is available from PyPi
<http://pypi.python.org/pypi/ObjectListView/1.0&gt; or from its website,
ObjectListView — ObjectListView v1.2 documentation. Even if you download
from PyPi, the website is still worth looking at - it has lots of
useful information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

This might just be what I was be looking for, especially the support for
checkboxes based on data in any column.

Thanks for making this available.

Starting to look at it and trying out the examples I found some small
issues.

- in InitUi it looks for some .bmp files, but you only included .png
- the image for group16 and group3 is missing
- in the virtual list the "sort indicators" still show, as sort is not
supported in this mode you might want to change this that no sort
indicator is shown when clicking on the header.
- ObjectListView demo, if you clear the list and then click on
Repopulate it repopulates it "empty" should it not refill list with
initial list content?

Best regards
Werner
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

The ObjectListView automatically “attaches” the model object to each row. You can then use model level operations rather than dealing with row indicies.

So you do things like:

self.olv1.SelectObject(aSong)

or:

for oneSong in self.olv1.GetSelectedObjects():
self.findSongLyrics(oneSong)

The website for this project (http://objectlistview.sourceforge.net/python) does actually have quite a bit of useful information, if you are interested.

Regards,
Phillip

···

2008/6/13 Jorgen Bodde jorgen.maillist@gmail.com:

Hi Philip,

Does it allow me to attach client data other then integers? This has

been a long standing issue which always bites me when i am using

wx.ListCtrl. wxPython already added a lot of convenience functions,

but still when I want to link a listctrl row (in report mode) with a

class instance of my choice, I need to make some int ↔ data pointer

lookup table on the side which really starts to get annoying.

Regards,

  • Jorgen

On Thu, Jun 12, 2008 at 8:45 AM, Phillip Piper phillip.piper@gmail.com wrote:

ObjectListView – A much easier to use wx.ListCtrl

ObjectListView is a wrapper around the wx.ListCtrl that makes the list

control easier to use. It also provides some useful extra functionality. It

provides the following features:

Automatically sorts rows.

Easily edits the cell values.

Supports all ListCtrl views (report, list, large and small icons).

Columns can be fixed-width, have a minimum and/or maximum width, or be

space-filling.

Displays a “list is empty” message when the list is empty (obviously).

Supports checkboxes in any column

Supports alternate rows background colours.

Supports custom formatting of rows.

The FastObjectListView version can build a list of 10,000 objects in less

than 0.1 seconds.

The VirtualObjectListView version supports millions of rows through

ListCtrl’s virtual mode.

It is available from PyPi or from its website,

http://objectlistview.sourceforge.net/python. Even if you download from

PyPi, the website is still worth looking at – it has lots of useful

information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

Regards,

Phillip


Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

ObjectListView is a wrapper around the wx.ListCtrl that makes the list control easier to use. It also provides some useful extra functionality. It provides the following features:

    * Automatically sorts rows.
    * Easily edits the cell values.
    * Supports all ListCtrl views (report, list, large and small icons).
    * Columns can be fixed-width, have a minimum and/or maximum width,
      or be space-filling.
    * Displays a “list is empty” message when the list is empty
      (obviously).
    * Supports checkboxes in any column
    * Supports alternate rows background colours.
    * Supports custom formatting of rows.
    * The /FastObjectListView/ version can build a list of 10,000
      objects in less than 0.1 seconds.
    * The /VirtualObjectListView/ version supports millions of rows
      through ListCtrl’s virtual mode.

It is available from PyPi <http://pypi.python.org/pypi/ObjectListView/1.0&gt; or from its website, ObjectListView — ObjectListView v1.2 documentation. Even if you download from PyPi, the website is still worth looking at – it has lots of useful information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

Very nice website, and this looks like a very impressive widget! However I think it is ironic that your feature list doesn't mention what seems to me the main feature, or at least one of them (maybe it is too obvious?), that it can generate a list from your native object list automatically. If you just read the feature list, it sounds like it just enhances the ListCtrl, but doesn't hint that it really provides a completely different paradigm, quite possibly greatly improving/simplifying creating the control.

It seems like the first item on the list should be that it creates the list for you from a list/dictionary/etc. of objects, handling the linking between rows and objects for you transparently. That is what makes the whole thing so darn easy and impressive, since you probably already have a list of objects.

Great work!
- Mike

Hi,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What's new in version 1.1
-------------------------

The big improvement in this version is GroupListView - a ListCtrl that
support collecting rows into collapsible groups. You can see an example and
a description of how to use it here:
Using a GroupListView — ObjectListView v1.2 documentation.
  
That looks very cool. The GroupListView looks more "native" on Linux than TreeListCtrl I'm currently using. ObjectListView also has my preference because it's purely Python code: much easier to debug and modify.

One thing I did notice in the GroupListView example: on Linux, the expand triangle on the group headings retains its blue background when the row is selected. I've attached a screenshot. Is there anything you can do about that?

Another minor thing I noticed is that the entire control flickers when headings are collapsed and expanded. This is also on Linux. I assume you refill the entire control when collapsing or expanding: is there some Freeze/Thaw-like magic that can be done?

And finally (and then I'll stop bugging you ;-)): I found that I have to run all the examples with LC_TIME=en_US.utf8 prefixed to the python command: my system locale is nl_NL.utf8, which doesn't use AM/PM for date formatting. At the bottom of this message is a stack trace that I get.

BTW, I'm using wxGTK 2.8.8.1.

Again, thanks for this very useful piece of code!

Regards,
Roel

Stacktrace for python GroupExample.py:
Traceback (most recent call last):
File "GroupExample.py", line 98, in <module>
frame_1 = MyFrame(None, -1, "GroupListView Example")
File "GroupExample.py", line 20, in __init__
self.Init()
File "GroupExample.py", line 23, in Init
self.InitModel()
File "GroupExample.py", line 28, in InitModel
self.songs = ExampleModel.GetTracks()
File "/home/roel/Download/OLV/ObjectListView-1.1/Examples/ExampleModel.py", line 30, in GetTracks
Track("shiver", "Natalie Imbruglia", "Counting Down the Days", 8.6*1024*1024*1024, "9/03/2008 9:51 PM", 80),
File "/home/roel/Download/OLV/ObjectListView-1.1/Examples/ExampleModel.py", line 17, in __init__
self.lastPlayed = datetime.datetime(*(time.strptime(lastPlayed, "%d/%m/%Y %I:%M %p")[0:6]))
File "/usr/lib/python2.5/_strptime.py", line 333, in strptime
data_string[found.end():])
ValueError: unconverted data remains: PM

Philip,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl
  

And it is getting better and better ........

I played around with the GroupListView and have one question, what is the correct way of using SetShowGroups(False/True)?

I put a SetShowGroups(False) into a GroupKeyGetter and it turns off, but this does not feel right (especially as I don't seem to be able to turn it back on), I should probably catch a header click event.

What I like to do have it one for most of the time, but when one clicks a particular header I would like to turn it off. Obviously I then need to turn it on again when one clicks on another header.

Werner

Thanks. I agree with the others: it looks nice.

One suggestion (if it’s possible), on the GroupListView (which I love), it would be nice if the Group label line were not bound (and cut off) by the width of column 1.

  • Kevin
···

On Wed, Jul 30, 2008 at 8:53 AM, Phillip Piper phillip.piper@gmail.com wrote:

ObjectListView – A much easier to use wx.ListCtrl

What’s new in version 1.1


The big improvement in this version is GroupListView - a ListCtrl that

support collecting rows into collapsible groups. You can see an example and

a description of how to use it here:

http://objectlistview.sourceforge.net/python/groupListView.html.

Other improvements in this version:

  • Can copy a text version (and, under Windows, a HTML version too) of the

selected rows to the clipboard. By default, this is bound to Ctrl-C.

  • Headers can now have their own images

  • Search-by-typing now works reliable on all platforms

  • Much better behaviour under Linux (and hopefully Mac too)

  • The required quota of other small bug fixes

What is ObjectListView?


ObjectListView is a wrapper around the wx.ListCtrl that makes the list

control easier to use. It also provides some useful extra functionality. It

provides the following features:

  • Automatically transforms a collection of model objects into a fully

functional wx.ListCtrl.

  • Automatically sorts rows.

  • Easily edits the cell values.

  • Supports all ListCtrl views (report, list, large and small icons).

  • Columns can be fixed-width, have a minimum and/or maximum width, or be

space-filling.

  • Displays a “list is empty” message when the list is empty (obviously).

  • Supports checkboxes in any column

  • Supports alternate rows background colors.

  • Supports custom formatting of rows.

  • Supports searching (by typing) on any column, even on massive lists.

  • Supports custom sorting

  • The FastObjectListView version can build a list of 10,000 objects in less

than 0.1 seconds.

  • The VirtualObjectListView version supports millions of rows through

ListCtrl’s virtual mode.

  • The GroupListView version supports arranging rows into collapsible groups.

It is available from PyPi or from its website,

http://objectlistview.sourceforge.net/python. Even if you download from

PyPi, the website is still worth looking at – it has lots of useful

information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

Regards,

Phillip


Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi Kevin,

That’s a nice idea, but it’s
just not possible. It’s still just an ListCtrl underneath, so our
information is still limited by column widths.

If owner drawing ever becomes
possible, all sorts of possibilities open up – but until then, we’re
limited by what the ListCtrl can do.

Regards,

Phillip

···

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A
man’s life does not consist in the abundance of his possessions

From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Kevin
Grover
Sent: Thursday, 31 July 2008 9:01 PM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] ANN: ObjectListView 1.1

Thanks. I agree with the others: it looks nice.

One suggestion (if it’s possible), on the GroupListView (which I love), it
would be nice if the Group label line were not bound (and cut off) by the width
of column 1.

  • Kevin

Hi Roel,

Thanks for this feedback.

1. I see what you mean about the background of the triangle. I'll look into
that.

2. I hate flickering too. What you have now is much better than the
original, but you are right -- there is still that one noticeable flicker.
I'll work on that.

3. I hadn't noticed that "%I" was locale-specific. Ok, I'll change that too.

It's not bugging me -- it's debugging the code :slight_smile:

Regards,
Phillip

···

------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com
A man's life does not consist in the abundance of his possessions

-----Original Message-----
From: wxpython-users-bounces+phillip.piper=gmail.com@lists.wxwidgets.org
[mailto:wxpython-users-bounces+phillip.piper=gmail.com@lists.wxwidgets.org]
On Behalf Of Roel van Os
Sent: Thursday, 31 July 2008 9:54 AM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] ANN: ObjectListView 1.1

Hi,

Phillip Piper wrote:

ObjectListView - A much easier to use wx.ListCtrl

What's new in version 1.1
-------------------------

The big improvement in this version is GroupListView - a ListCtrl that
support collecting rows into collapsible groups. You can see an
example and a description of how to use it here:
Using a GroupListView — ObjectListView v1.2 documentation.
  
That looks very cool. The GroupListView looks more "native" on Linux than
TreeListCtrl I'm currently using. ObjectListView also has my preference
because it's purely Python code: much easier to debug and modify.

One thing I did notice in the GroupListView example: on Linux, the expand
triangle on the group headings retains its blue background when the row is
selected. I've attached a screenshot. Is there anything you can do about
that?

Another minor thing I noticed is that the entire control flickers when
headings are collapsed and expanded. This is also on Linux. I assume you
refill the entire control when collapsing or expanding: is there some
Freeze/Thaw-like magic that can be done?

And finally (and then I'll stop bugging you ;-)): I found that I have to run
all the examples with LC_TIME=en_US.utf8 prefixed to the python
command: my system locale is nl_NL.utf8, which doesn't use AM/PM for date
formatting. At the bottom of this message is a stack trace that I get.

BTW, I'm using wxGTK 2.8.8.1.

Again, thanks for this very useful piece of code!

Regards,
Roel

Stacktrace for python GroupExample.py:
Traceback (most recent call last):
File "GroupExample.py", line 98, in <module>
frame_1 = MyFrame(None, -1, "GroupListView Example") File "GroupExample.py",
line 20, in __init__
self.Init()
File "GroupExample.py", line 23, in Init
self.InitModel()
File "GroupExample.py", line 28, in InitModel self.songs =
ExampleModel.GetTracks() File
"/home/roel/Download/OLV/ObjectListView-1.1/Examples/ExampleModel.py",
line 30, in GetTracks
Track("shiver", "Natalie Imbruglia", "Counting Down the Days",
8.6*1024*1024*1024, "9/03/2008 9:51 PM", 80), File
"/home/roel/Download/OLV/ObjectListView-1.1/Examples/ExampleModel.py",
line 17, in __init__
self.lastPlayed = datetime.datetime(*(time.strptime(lastPlayed,
"%d/%m/%Y %I:%M %p")[0:6]))
File "/usr/lib/python2.5/_strptime.py", line 333, in strptime
data_string[found.end():])
ValueError: unconverted data remains: PM

Hi again Werner,

And it is getting better and better ........

Thanks. I think so too :slight_smile:

what is the correct way of using SetShowGroups(False/True)?

It should be enough to just call it. However, it is a major reshuffle of the
internal data, and requires the control to be completely rebuilt. I don't
know what would happen if you tried doing it in the middle of some other
operation. It might even work :slight_smile:

Regards,
Phillip

···

------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com
A man's life does not consist in the abundance of his possessions

-----Original Message-----
From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Werner F.
Bruhin
Sent: Thursday, 31 July 2008 4:09 PM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] ANN: ObjectListView 1.1

Philip,

Phillip Piper wrote:

ObjectListView - A much easier to use wx.ListCtrl
  

And it is getting better and better ........

I played around with the GroupListView and have one question, what is
the correct way of using SetShowGroups(False/True)?

I put a SetShowGroups(False) into a GroupKeyGetter and it turns off, but
this does not feel right (especially as I don't seem to be able to turn
it back on), I should probably catch a header click event.

What I like to do have it one for most of the time, but when one clicks
a particular header I would like to turn it off. Obviously I then need
to turn it on again when one clicks on another header.

Werner
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Philip,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What's new in version 1.1
-------------------------

The big improvement in this version is GroupListView - a ListCtrl that
support collecting rows into collapsible groups. You can see an example and
a description of how to use it here:
Using a GroupListView — ObjectListView v1.2 documentation.
  

Currently the groupListView does:
group header
n items
blank line
group header
etc

Is there a way to suppress/not have the blank line before the group header?

Werner

Not at the moment. But I can put in the option to make it so.

An early version of the code did not have the separating line, but I didn’t think it was as clear as having the line.

If you want to see what it would look like, find the GroupListView._BuildInnerList() method and comment out these lines:

if len(self.innerList):
    self.innerList.append(None)

See if you like it like that.

Regards,
Phillip

···

2008/8/1 Werner F. Bruhin werner.bruhin@free.fr

Philip,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What’s new in version 1.1


The big improvement in this version is GroupListView - a ListCtrl that

support collecting rows into collapsible groups. You can see an example and

a description of how to use it here:

http://objectlistview.sourceforge.net/python/groupListView.html.

Currently the groupListView does:

group header

n items

blank line

group header

etc

Is there a way to suppress/not have the blank line before the group header?

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions

Philip,

Phillip Piper wrote:

Not at the moment. But I can put in the option to make it so.

An early version of the code did not have the separating line, but I didn't think it was as clear as having the line.

Definitely a question of taste.

If you want to see what it would look like, find the GroupListView._BuildInnerList() method and comment out these lines:

    if len(self.innerList):
        self.innerList.append(None)

See if you like it like that.

I think this is still very clear and provides the space for a few more lines of information instead of blank lines.

It would be great if you could provide a method to set this (having a blank line or not at the end of each group)

Werner

OK. Shall do

···

2008/8/1 Werner F. Bruhin werner.bruhin@free.fr

Philip,

Phillip Piper wrote:

Not at the moment. But I can put in the option to make it so.

An early version of the code did not have the separating line, but I didn’t think it was as clear as having the line.

Definitely a question of taste.

If you want to see what it would look like, find the GroupListView._BuildInnerList() method and comment out these lines:

if len(self.innerList):

    self.innerList.append(None)

See if you like it like that.

I think this is still very clear and provides the space for a few more lines of information instead of blank lines.

It would be great if you could provide a method to set this (having a blank line or not at the end of each group)

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions

Not at the moment. But I can put in the option to make it so.

An early version of the code did not have the separating line, but I didn’t think it was as clear as having the line.

If you want to see what it would look like, find the GroupListView._BuildInnerList() method and comment out these lines:

if len(self.innerList):
    self.innerList.append(None)

Wouldn’t just be a matter of adding
self.includeSeperatorLine = True in the init and changing the above code to

if len(self.innerList):

    self.innerList.append(None)
···

On Fri, Aug 1, 2008 at 5:41 AM, Phillip Piper phillip.piper@gmail.com wrote:

See if you like it like that.

Regards,
Phillip

2008/8/1 Werner F. Bruhin werner.bruhin@free.fr

Philip,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What’s new in version 1.1


The big improvement in this version is GroupListView - a ListCtrl that

support collecting rows into collapsible groups. You can see an example and

a description of how to use it here:

http://objectlistview.sourceforge.net/python/groupListView.html.

Currently the groupListView does:

group header

n items

blank line

group header

etc

Is there a way to suppress/not have the blank line before the group header?

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Not at the moment. But I can put in the option to make it so.

An early version of the code did not have the separating line, but I didn’t think it was as clear as having the line.

If you want to see what it would look like, find the GroupListView._BuildInnerList() method and comment out these lines:

if len(self.innerList):
    self.innerList.append(None)

Wouldn’t just be a matter of adding
self.includeSeperatorLine = True in the init and changing the above code to

if len(self.innerList):


    self.innerList.append(None)

Sorry about that. Had formatting problems.

Wouldn’t it just be a matter of adding

self.includeSeparatorLine = True

in the init and changing the above code to

if self.includeSeparatorLine and len(self.innerList):

    self.innerList.append(None)

And (possibly) provide getter/setter for includeSeparatorLine

···

On Fri, Aug 1, 2008 at 4:09 PM, Kevin Grover kevin@kevingrover.net wrote:

On Fri, Aug 1, 2008 at 5:41 AM, Phillip Piper phillip.piper@gmail.com wrote:

See if you like it like that.

Regards,
Phillip

2008/8/1 Werner F. Bruhin werner.bruhin@free.fr

Philip,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What’s new in version 1.1


The big improvement in this version is GroupListView - a ListCtrl that

support collecting rows into collapsible groups. You can see an example and

a description of how to use it here:

http://objectlistview.sourceforge.net/python/groupListView.html.

Currently the groupListView does:

group header

n items

blank line

group header

etc

Is there a way to suppress/not have the blank line before the group header?

Werner


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A man’s life does not consist in the abundance of his possessions


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Yes. That will do nicely J

···

Phillip Piper www.bigfoot.com/~phillip_piper phillip_piper@bigfoot.com

A
man’s life does not consist in the abundance of his possessions

From: wxpython-users-bounces@lists.wxwidgets.org
[mailto:wxpython-users-bounces@lists.wxwidgets.org] On Behalf Of Kevin
Grover
Sent: Saturday, 2 August 2008 1:14 AM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] ANN: ObjectListView 1.1

On Fri, Aug 1, 2008 at 4:09 PM, Kevin Grover kevin@kevingrover.net wrote:

On Fri, Aug 1, 2008 at 5:41 AM, Phillip Piper phillip.piper@gmail.com wrote:

Not at the moment. But I can put in the option to make it
so.

An early version of the code did not have the separating line, but I didn’t
think it was as clear as having the line.

If you want to see what it would look like, find the GroupListView._BuildInnerList()
method and comment out these lines:

if

len(self.innerList):

    self.innerList.append(None)

Wouldn’t just be a matter of adding
self.includeSeperatorLine = True in the init and changing the above code to

if len(self.innerList):

    self.innerList.append(None)

Sorry about that. Had formatting problems.

Wouldn’t it just be a matter of adding

self.includeSeparatorLine = True

in the init and changing the above code to

if

self.includeSeparatorLine and len(self.innerList):

    self.innerList.append(None)

And (possibly) provide getter/setter for includeSeparatorLine

See if you like it like that.

Regards,
Phillip

2008/8/1 Werner F. Bruhin werner.bruhin@free.fr

Philip,

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What’s new in version 1.1

The big improvement in this version is GroupListView - a ListCtrl that
support collecting rows into collapsible groups. You can see an example and
a description of how to use it here:
http://objectlistview.sourceforge.net/python/groupListView.html.

Currently the groupListView does:
group header
n items
blank line
group header
etc

Is there a way to suppress/not have the blank line before the group header?

Werner


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


Phillip Piper www.bigfoot.com/~phillip_piper
phillip_piper@bigfoot.com
A man’s life does not consist in the abundance of his possessions


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Phillip Piper wrote:

ObjectListView – A much easier to use wx.ListCtrl

What's new in version 1.1
-------------------------

The big improvement in this version is GroupListView - a ListCtrl that
support collecting rows into collapsible groups. You can see an example and
a description of how to use it here:
Using a GroupListView — ObjectListView v1.2 documentation.

Other improvements in this version:

* Can copy a text version (and, under Windows, a HTML version too) of the
selected rows to the clipboard. By default, this is bound to Ctrl-C.
* Headers can now have their own images
* Search-by-typing now works reliable on all platforms
* Much better behaviour under Linux (and hopefully Mac too)
* The required quota of other small bug fixes

What is ObjectListView?
-----------------------

ObjectListView is a wrapper around the wx.ListCtrl that makes the list
control easier to use. It also provides some useful extra functionality. It
provides the following features:

* Automatically transforms a collection of model objects into a fully
functional wx.ListCtrl.
* Automatically sorts rows.
* Easily edits the cell values.
* Supports all ListCtrl views (report, list, large and small icons).
* Columns can be fixed-width, have a minimum and/or maximum width, or be
space-filling.
* Displays a "list is empty" message when the list is empty (obviously).
* Supports checkboxes in any column
* Supports alternate rows background colors.
* Supports custom formatting of rows.
* Supports searching (by typing) on any column, even on massive lists.
* Supports custom sorting
* The FastObjectListView version can build a list of 10,000 objects in less
than 0.1 seconds.
* The VirtualObjectListView version supports millions of rows through
ListCtrl's virtual mode.
* The GroupListView version supports arranging rows into collapsible groups.

It is available from PyPi or from its website,
ObjectListView — ObjectListView v1.2 documentation. Even if you download from
PyPi, the website is still worth looking at – it has lots of useful
information (thanks to the Sphinx team for their great tool).

All feedback, suggested improvements and even bug reports are welcome.

This looks really cool and I am thinking of porting one of my applications that currently uses a wxGrid to use this instead. Basically, I want an attractive and editable wrapper around the resulting rows of a SQL query.

I notice the DataListView seems to be missing from the Python version, am I correct? If so, any recommendations/recipes on getting the data binding? Basically I was thinking of having the model create a custom list class which presents itself to OLV, and ideally that could do all the getting and setting like a DataListView. That custom list class would then be sending pubsub messages on appends/removals/edits which allows the appropriate SQL queries to take place in the database.

Any hints? I am trying to think of this from as much of a fresh, new perspective as possible so I don't bring along any unnecessary paradigms of my "pushing and pulling from a wxGrid" approach.

Thanks!
- Mike

Mike,

Mike Rooney wrote:

...
This looks really cool and I am thinking of porting one of my applications that currently uses a wxGrid to use this instead. Basically, I want an attractive and editable wrapper around the resulting rows of a SQL query.

I notice the DataListView seems to be missing from the Python version, am I correct? If so, any recommendations/recipes on getting the data binding? Basically I was thinking of having the model create a custom list class which presents itself to OLV, and ideally that could do all the getting and setting like a DataListView. That custom list class would then be sending pubsub messages on appends/removals/edits which allows the appropriate SQL queries to take place in the database.

Any hints? I am trying to think of this from as much of a fresh, new perspective as possible so I don't bring along any unnecessary paradigms of my "pushing and pulling from a wxGrid" approach.

I am in the midst of switching over, it is such a much nicer/easier control to use then the wx.ListCtrl.

Note sure how it compares to the wx.Grid, i.e. editing columns etc.

My stuff comes from a database (using SQLAlchemy) too, so currently I just do something along the following lines. I am sure there are even nicer ways of doing all this and I would also see that the updating/refreshing could be done using pubsub with some minimal information about the object to refresh in msg.data.

Define the columns:
        self.colDef['cb_namesandvar'] = olv.ColumnDefn(_('Drink name'), 'left', 0, 'cb_namesandvar', isSpaceFilling=True, minimumWidth=150, imageGetter=self.DrinkImageGetter)
        self.colDef['ctry_name'] = olv.ColumnDefn(_('Country'), 'left', 0, 'ctry_name', isSpaceFilling=False, minimumWidth=0, groupKeyGetter=self.CountryGroupKey, imageGetter=self.FlagImageGetter)

Init my model:
    def InitModel(self):
        self.listObjects = self.session.query(db.Vcbook)
        if self.sqljoin:
            self.listObjects = self.listObjects.select_from(self.sqljoin)
        if self.filter:
            self.listObjects = self.listObjects.filter(self.filter)
        if self.order_by:
            self.listObjects = self.listObjects.order_by(self.order_by)
                   self.listObjects.all()

Load the list:
        self.AddDrinkImages()
        # put expansion in 1st data column and not use a separate column
        # this way clicking the header always sorts the correct column
        self.GetList().useExpansionColumn = False
        self.GetList().SetColumns(self.SetColumnDef())
        # suppress blank line
        self.GetList().putBlankLineBetweenGroups = False
        self.InitModel()
        self.GetList().SetObjects(self.listObjects)
               lcSize = 0
        for col in self.GetList().columns:
            lcSize += col.width
        self.GetList().SetMinSize((lcSize, 300))

Updating an item(s):
        items = self.session.query(db.Vcbook).filter(filter).all()
        self.GetList().RefreshObjects(items)

I am using the latest version from SVN which is needed for some of the stuff I use (GroupListView) to work nicely and correctly (if one mixes group and non grouped columns.

Hope this helps
Werner