Hi, all
I write a new module named CheckListCtrlMixin.py which is inspired by limodou's
CheckList, it can be used to make a ListCtrl with Checkboxes, and I
think this one
is much better than the CheckListCtrl.py which I posted serveral days ago.
If you find bugs, please send a bug report to me.
Best regards,
Bruce Who
CheckListCtrlMixin.py (4.01 KB)
CheckListCtrlMixin_demo.py (1.93 KB)
Hello Bruce,
it looks good.
Only two suggestions:
1) would it be possible, that the checklistctrl
itself could use (by parameter) the ListCtrlAutoWidthMixin
class?
2) Would it be convenient, if you double click
an entry, then it toggles it's state?
···
On Thu, 9 Feb 2006 16:23:15 +0800, Bruce Who <bruce.who.hk@gmail.com> wrote:
Hi, all
I write a new module named CheckListCtrlMixin.py which is inspired by limodou's
CheckList, it can be used to make a ListCtrl with Checkboxes, and I
think this one
is much better than the CheckListCtrl.py which I posted serveral days ago.
If you find bugs, please send a bug report to me.
Best regards,
Bruce Who
--
Franz Steinhaeusler
Hello Bruce,
it looks good.
Only two suggestions:
1) would it be possible, that the checklistctrl
itself could use (by parameter) the ListCtrlAutoWidthMixin
class?
Yes, you could use it this way:
class YourListCtrl(ListCtrl,CheckListCtrlMixin,ListCtrlAutoWidthMixin):
def __init__(...):
CheckListCtrlMixin.__init__(self)
ListCtrlAutoWidthMixin.__init__(self)
...
2) Would it be convenient, if you double click
an entry, then it toggles it's state?
I think that others may want to use double-click to do some else, for
example, activate an item, open an url, or something else, they may
not want to toggle entries' state when they are double-clicked. So I
didn't bind the event.
Best regards,
Bruce Who
···
On 2/10/06, Franz Steinhaeusler <franz.steinhaeusler@gmx.at> wrote:
Hello Bruce,
it looks good.
Only two suggestions:
1) would it be possible, that the checklistctrl
itself could use (by parameter) the ListCtrlAutoWidthMixin
class?
Yes, you could use it this way:
class YourListCtrl(ListCtrl,CheckListCtrlMixin,ListCtrlAutoWidthMixin):
def __init__(...):
CheckListCtrlMixin.__init__(self)
ListCtrlAutoWidthMixin.__init__(self)
...
I see.
2) Would it be convenient, if you double click
an entry, then it toggles it's state?
I think that others may want to use double-click to do some else, for
example, activate an item, open an url, or something else, they may
not want to toggle entries' state when they are double-clicked. So I
didn't bind the event.
What about a paramter into the constructor or a method:
doubleclickcheckitem=False
or
def SetDoubleClickCheckItem...
self.Bind.......
Cheers,
···
On Sat, 11 Feb 2006 20:04:29 +0800, Bruce Who <bruce.who.hk@gmail.com> wrote:
On 2/10/06, Franz Steinhaeusler <franz.steinhaeusler@gmx.at> wrote:
--
Franz Steinhaeusler
Hi, Franz,
>I think that others may want to use double-click to do some else, for
>example, activate an item, open an url, or something else, they may
>not want to toggle entries' state when they are double-clicked. So I
>didn't bind the event.
What about a paramter into the constructor or a method:
doubleclickcheckitem=False
or
def SetDoubleClickCheckItem...
self.Bind.......
I see. I just want to make a generally-used widget. Toggling items by
double-clicking is not a necessary part of a CheckList. And what if
others want to toggle items by right-click or other events? So I think
we just make CheckListMixin.py as minimal as possible, it only
contains the core functionality. You can bind the event in your own
subclass. I'll add a ToggleItem() interface to CheckListMixin.py. Then
you can bind any events and toggle the items with this interface.
Best regards,
Bruce Who
···
On 2/15/06, Franz Steinhaeusler <franz.steinhaeusler@gmx.at> wrote:
Hi, Franz,
>I think that others may want to use double-click to do some else, for
>example, activate an item, open an url, or something else, they may
>not want to toggle entries' state when they are double-clicked. So I
>didn't bind the event.
What about a paramter into the constructor or a method:
doubleclickcheckitem=False
or
def SetDoubleClickCheckItem...
self.Bind.......
I see. I just want to make a generally-used widget. Toggling items by
double-clicking is not a necessary part of a CheckList. And what if
others want to toggle items by right-click or other events? So I think
we just make CheckListMixin.py as minimal as possible, it only
contains the core functionality. You can bind the event in your own
subclass. I'll add a ToggleItem() interface to CheckListMixin.py. Then
you can bind any events and toggle the items with this interface.
Hello Bruce,
yes, thank you.
I agree, best will be subclassing the control.
···
On 2/15/06, Franz Steinhaeusler <franz.steinhaeusler@gmx.at> wrote:
--
Franz Steinhaeusler