wx.Checklistbox popup?

Has anyone implemented a popup version of a Checklistbox yet? It sounds so likely that I just assumed it already existed, but then it’s nowhere in the demo or anything. In fact I even assumed that a wx.Checklistbox would actually be a popup checklistbox and was surprised that it’s static.

If there’s no existing recipe, I’ll have to build my own. Any suggestions? Studying the docs and demos, I see several ways to go. One is wx.Choice + wx.CheckListCtrlMixin. But CheckListCtrlMixin is apparently only meant to modify a wx.ListCtrl, not a wx.Choice. Anyone know if it would work out anyway? What if I tried this not with a wx.Choice but with a wx.ComboBox?

Another way to go is to subclass ComboCtrl, either also inheriting from Checklistbox or just using a child Checklistbox. But i’m having trouble understanding the programming style that ComboCtrl wants you to use.

Or I could skip the popup ability and just use a SpinButton next to a CheckBox, allowing the SpinButton to rotate through a set of checkboxes with only one visible at a time. At least this would save space, which is the primary purpose for which I was seeking a popup Checklistbox.

Any observations? Thanks.

I haven't tried customizing a popup, so I can't offer
advice on how to do that. I do recommend that you
steer away from the SpinButton/CheckBox combo. That
sounds really counter-intuitive. Plus, you can't see
at a glance what the options are set to.

Other options to consider (besides the popup
checkbutton list):

* A popup menu with items that toggle a checkmark if
they are selected.

* A "settings" button that brings up a dialog with as
many checkboxes on it as you like.

Personally, I'm partial to the dialog solution and use
it in a wide variety of places. It gives me more room
for text, is familiar to users, and makes it easy to
hook context-sensative help in to the items.

Gre7g

···

--- Eric Ongerth <ericongerth@gmail.com> wrote:

Or I could skip the popup ability and just use a
SpinButton next to a
CheckBox, allowing the SpinButton to rotate through
a set of checkboxes with
only one visible at a time. At least this would
save space, which is the
primary purpose for which I was seeking a popup
Checklistbox.

Any observations? Thanks.

____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

Hi Eric,

Has anyone implemented a popup version of a Checklistbox yet? It sounds so
likely that I just assumed it already existed, but then it's nowhere in the
demo or anything. In fact I even assumed that a wx.Checklistbox would
actually be a popup checklistbox and was surprised that it's static.

If there's no existing recipe, I'll have to build my own. Any suggestions?
Studying the docs and demos, I see several ways to go. One is wx.Choice +
wx.CheckListCtrlMixin. But CheckListCtrlMixin is apparently only meant to
modify a wx.ListCtrl, not a wx.Choice. Anyone know if it would work out
anyway? What if I tried this not with a wx.Choice but with a wx.ComboBox?

Another way to go is to subclass ComboCtrl, either also inheriting from
Checklistbox or just using a child Checklistbox. But i'm having trouble
understanding the programming style that ComboCtrl wants you to use.

Or I could skip the popup ability and just use a SpinButton next to a
CheckBox, allowing the SpinButton to rotate through a set of checkboxes with
only one visible at a time. At least this would save space, which is the
primary purpose for which I was seeking a popup Checklistbox.

Any observations? Thanks.

I agree with Greg's observations, in general. As fas as I know, there
is no such widget available out there, but if you really need such
kind of things, I would try one of those 2 approaches:

1) Subclass ComboCtrl and draw yourself the check icons and the text:
this is not particularly hard, the demo is a good starting point. You
only need to provide ComboCtrl how to draw a checkbox item (with its
text) and the actual measure (width, height) of it.

2) Use a custom popup window: you can popup almost whatever you want,
I have done some experimentation with popup windows and I came up with
something I call "SuperToolTip", an example of which can be seen in
this screenshot:

http://xoomer.alice.it/infinity77/SuperToolTip.png

However, this approach requires you to do all the size calculations
and drawings, which might be an overkill for a popping ChekListBox.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 6/25/07, Eric Ongerth wrote:

<snipped>

http://xoomer.alice.it/infinity77/SuperToolTip.png

I've just gotta' say, oooooooh, pretty! I wish my
applications looked as nice as yours.

Gre7g

···

--- Andrea Gavana <andrea.gavana@gmail.com> wrote:

____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

Eric,

Perhaps you could do a simple modification of a context menu. You could make one of your menu items actually report the current choice with creative updates. I’ve done something remotely similar (I think) for tree menu’ing, because, like you, I wanted to save room, however, I did not implement the status item as I have suggested, but I have made it work in other platforms that are much less flexible than wxPython and Python.

thom

···

From: Eric Ongerth [mailto:ericongerth@gmail.com]
Sent: Monday, June 25, 2007 2:48 PM
To: wxPython-users@lists.wxwidgets.org
Subject:
[wxPython-users] wx.Checklistbox popup?

Has anyone implemented a popup version of a Checklistbox yet? It sounds so likely that I just assumed it already existed, but then it’s nowhere in the demo or anything. In fact I even assumed that a wx.Checklistbox would actually be a popup checklistbox and was surprised that it’s static.

If there’s no existing recipe, I’ll have to build my own. Any suggestions? Studying the docs and demos, I see several ways to go. One is wx.Choice + wx.CheckListCtrlMixin. But CheckListCtrlMixin is apparently only meant to modify a wx.ListCtrl, not a wx.Choice. Anyone know if it would work out anyway? What if I tried this not with a wx.Choice but with a wx.ComboBox?

Another way to go is to subclass ComboCtrl, either also inheriting from Checklistbox or just using a child Checklistbox. But i’m having trouble understanding the programming style that ComboCtrl wants you to use.

Or I could skip the popup ability and just use a SpinButton next to a CheckBox, allowing the SpinButton to rotate through a set of checkboxes with only one visible at a time. At least this would save space, which is the primary purpose for which I was seeking a popup Checklistbox.

Any observations? Thanks.