[ wxwindows-Bugs-1874996 ] wxListCtrl Row Highlight

SourceForge.net noreply at sourceforge.net
Wed Feb 13 14:46:39 PST 2008


Bugs item #1874996, was opened at 2008-01-18 20:38
Message generated for change (Comment added) made by vadz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1874996&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: Platform specific
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: mgenti (mgenti)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxListCtrl Row Highlight

Initial Comment:
I developed a sample that should show the problem I am trying to describe:
import wx


class ListCtrlPanel(wx.Panel):
  def __init__(self, parent):
    wx.Panel.__init__(self, parent, style = wx.TAB_TRAVERSAL | wx.CLIP_CHILDREN | wx.FULL_REPAINT_ON_RESIZE)
    self.list = wx.ListCtrl(self, style=wx.LC_ICON|wx.LC_AUTOARRANGE|wx.LC_SINGLE_SEL|wx.LC_HRULES|wx.LC_VRULES|wx.LC_NO_SORT_HEADER|wx.LC_SORT_DESCENDING)
    self.choice = wx.Choice(self, -1, choices=['ICON', 'REPORT', 'LIST'])
    self.choice.SetSelection(0)
    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(self.choice)
    sizer.Add(self.list, 1, wx.EXPAND )

    self.list.InsertColumn(0, "a")
    self.list.InsertColumn(1, "b")
    self.list.InsertColumn(2, "c")
    self.list.InsertColumn(3, "d")
    self.list.InsertColumn (4, "e")
    self.list.InsertStringItem(0, "test")

    self.SetSizer(sizer)

    self.Bind(wx.EVT_CHOICE, self.OnChoice)

  def OnChoice(self, event):
    if self.choice.GetStringSelection () == 'ICON':
      self.list.SetSingleStyle(wx.LC_ICON)
    elif self.choice.GetStringSelection() == 'REPORT':
      self.list.SetSingleStyle(wx.LC_REPORT)
    elif self.choice.GetStringSelection () == 'LIST':
      self.list.SetSingleStyle(wx.LC_LIST)


class TestFrame(wx.Frame):
  def __init__(self, parent):
    wx.Frame.__init__(self, parent, -1, "Tester", size=(500,500))

    ListCtrlPanel(self)

    self.CenterOnScreen()


if __name__ == '__main__':
  app = wx.App()

  frame = TestFrame(None)

  frame.Show()
  app.MainLoop()


If you run my example as shown when you switch to report view and you click on a column (not header) it will not choose the item and highlight the whole row.  If you start the example in report view and you do the same test it will highlight the whole row. 

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

>Comment By: Vadim Zeitlin (vadz)
Date: 2008-02-13 23:46

Message:
Logged In: YES 
user_id=71618
Originator: NO

Ok, fix backported to 2.8, thanks for testing.

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

Comment By: Robin Dunn (robind)
Date: 2008-01-29 18:26

Message:
Logged In: YES 
user_id=53955
Originator: NO

I can confirm that the fix works in the trunk.

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

Comment By: Vadim Zeitlin (vadz)
Date: 2008-01-26 23:55

Message:
Logged In: YES 
user_id=71618
Originator: NO

Should be fixed by r51390:
http://svn.wxwidgets.org/viewvc/wx?view=rev&revision=51390

If it can be confirmed that this indeed works we could backport the fix to
2.8 too.

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

Comment By: Robin Dunn (robind)
Date: 2008-01-18 20:54

Message:
Logged In: YES 
user_id=53955
Originator: NO

To summarize:  Switching a wxListCtrl from wxLC_ICON mode to wxLC_REPORT
mode using SetSingleStyle works, except only the item in the first column
is selected when it is clicked on, not the whole row.  When creating the
wxListCtrl with the wxLC_REPORT style then the whole row is selected. 

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1874996&group_id=9863




More information about the wx-dev mailing list