ListCtrl in report mode and headers on win2k

Hi.

is there a bug in the autowidth mixin for ListCtrl ?
When I create a subclass with the autowith mixin loaded (the one that fits the
last column header to the right boundary) the headers aren't displayed
anymore (on win2k). On linux everything is fine.

Any ideas ?

  UC

···

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417

Uwe C. Schroeder wrote:

Hi.

is there a bug in the autowidth mixin for ListCtrl ?
When I create a subclass with the autowith mixin loaded (the one that fits the last column header to the right boundary) the headers aren't displayed anymore (on win2k). On linux everything is fine.

The wxListCtrl sample in the demo uses that mixin, does it still work?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Yep, it does. So something's wrong about my code. I'll go check.

  UC

···

On Tuesday 10 June 2003 10:27 am, Robin Dunn wrote:

Uwe C. Schroeder wrote:
> Hi.
>
> is there a bug in the autowidth mixin for ListCtrl ?
> When I create a subclass with the autowith mixin loaded (the one that
> fits the last column header to the right boundary) the headers aren't
> displayed anymore (on win2k). On linux everything is fine.

The wxListCtrl sample in the demo uses that mixin, does it still work?

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417

As said before yes.

So - here's the difference. Whatwould I have to do to get this going with a 2
step create ?
It also handles wrong under linux. Headers show, but the last column is only
extended to the end when I click and drag the end of the last header (as if
resizing column). The moment I release the mousebutton it's extended to the
end.
Is something wrong with when I initialize the mixin ? I tried setting the last
column to auto or fixed. same result both times. This below is the fixed size
version. I should mention that I load this via a custom xml handler from a
xrc file
Here's my code.

class PreAWListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
    def __init__(self):
        p = wx.PreListCtrl()
        self.this = p.this

    def Create(self, parent, id, pos, size, style, validator, name):
        wx.ListCtrl.Create(self, parent, id, pos, size, style, validator,
name)
        self._setOORInfo(self)
        ListCtrlAutoWidthMixin.__init__(self)

    def Populate(self,header,data,itemdata=None):
        self.ClearAll()
        for x in range(len(header)):
            info = wx.ListItem()
            info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE |
wx.LIST_MASK_FORMAT
            info.m_image = -1
            info.m_format = 0
            info.m_text = header
            self.InsertColumnInfo(x, info)

        for x in range(len(data)):
            self.InsertStringItem(x,data[0])
            for y in range(len(data)-1):
                self.SetStringItem(x,y+1,data[y+1])
            if itemdata:
                self.SetItemData(x,itemdata)
                
        for x in range(len(header)-1):
            self.SetColumnWidth(x, wx.LIST_AUTOSIZE)
        self.SetColumnWidth(len(header)-1,100)

It also doesn't work with one step creation like: (same Populate method as
above)

class AWListCtrl(wx.ListCtrl, ListCtrlAutoWidthMixin):
    def __init__(self, parent, ID, pos=wx.DefaultPosition,
                 size=wx.DefaultSize, style=0,
     validator=wx.DefaultValidator, name=None):
        wx.ListCtrl.__init__(self, parent, ID, pos,
           size, style, validator, name)
        ListCtrlAutoWidthMixin.__init__(self)

···

On Tuesday 10 June 2003 10:27 am, Robin Dunn wrote:

Uwe C. Schroeder wrote:
> Hi.
>
> is there a bug in the autowidth mixin for ListCtrl ?
> When I create a subclass with the autowith mixin loaded (the one that
> fits the last column header to the right boundary) the headers aren't
> displayed anymore (on win2k). On linux everything is fine.

The wxListCtrl sample in the demo uses that mixin, does it still work?

--
  UC

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417

Uwe C. Schroeder wrote:

···

On Tuesday 10 June 2003 10:27 am, Robin Dunn wrote:

Uwe C. Schroeder wrote:

Hi.

is there a bug in the autowidth mixin for ListCtrl ?
When I create a subclass with the autowith mixin loaded (the one that
fits the last column header to the right boundary) the headers aren't
displayed anymore (on win2k). On linux everything is fine.

The wxListCtrl sample in the demo uses that mixin, does it still work?

As said before yes.

So - here's the difference. Whatwould I have to do to get this going with a 2 step create ?
It also handles wrong under linux. Headers show, but the last column is only extended to the end when I click and drag the end of the last header (as if resizing column). The moment I release the mousebutton it's extended to the end.
Is something wrong with when I initialize the mixin ?

You might try calling self.resizeLastColumn(100) at the end of the Populate method.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Ok, that fixes the size issue. However no column header is displayed on Win2k.
I just tested when I don't use the InsertColumnInfo thing, but instead use
InsertColumn directly. That works.

Can it be that if I use the InsertColumnInfo without an image - things break ?
Maybe I'll just add the sorter mixin. At least now I know where to look.
Thanks

  UC

···

On Wednesday 11 June 2003 11:25 am, Robin Dunn wrote:

Uwe C. Schroeder wrote:
> On Tuesday 10 June 2003 10:27 am, Robin Dunn wrote:
>>Uwe C. Schroeder wrote:
>>>Hi.
>>>
>>>is there a bug in the autowidth mixin for ListCtrl ?
>>>When I create a subclass with the autowith mixin loaded (the one that
>>>fits the last column header to the right boundary) the headers aren't
>>>displayed anymore (on win2k). On linux everything is fine.
>>
>>The wxListCtrl sample in the demo uses that mixin, does it still work?
>
> As said before yes.
>
> So - here's the difference. Whatwould I have to do to get this going with
> a 2 step create ?
> It also handles wrong under linux. Headers show, but the last column is
> only extended to the end when I click and drag the end of the last header
> (as if resizing column). The moment I release the mousebutton it's
> extended to the end.
> Is something wrong with when I initialize the mixin ?

You might try calling self.resizeLastColumn(100) at the end of the
Populate method.

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417