New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UltimateListCtrl. Draw HyperText #1010

Closed
Jenyay opened this Issue Sep 21, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@Jenyay
Copy link
Contributor

Jenyay commented Sep 21, 2018

Operating system: Ubuntu 18.04, Windows 7
wxPython version & source: wxPython 4.0.3
Python version & source: Python 3.6

Description of the problem: If you add a HyperText cell to the line, all subsequent cells in the row are rendered as HyperLink.

import sys

import wx
import wx.lib.agw.ultimatelistctrl as ULC


class MyFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, -1, "UltimateListCtrl Demo")

        self._listCtrl = ULC.UltimateListCtrl(self, wx.ID_ANY, agwStyle=ULC.ULC_REPORT | ULC.ULC_VRULES | ULC.ULC_HRULES | ULC.ULC_SINGLE_SEL)

        self._listCtrl.InsertColumn(0, "Column 1")
        self._listCtrl.InsertColumn(1, "Column 2")
        self._listCtrl.InsertColumn(2, "Column 3")
        self._listCtrl.InsertColumn(3, "Column 4")

        # First line
        index = self._listCtrl.InsertStringItem(sys.maxsize, 'Hyperlink')
        self._listCtrl.SetItemHyperText(index, 0)

        self._listCtrl.SetStringItem(index, 1, 'Text')

        self._listCtrl.SetStringItem(index, 2, 'Hyperlink')
        self._listCtrl.SetItemHyperText(index, 2)

        self._listCtrl.SetStringItem(index, 3, 'Text')

        # Second line
        index = self._listCtrl.InsertStringItem(sys.maxsize, 'Text')

        self._listCtrl.SetStringItem(index, 1, 'Hyperlink')
        self._listCtrl.SetItemHyperText(index, 1)

        self._listCtrl.SetStringItem(index, 2, 'Text')

        self._listCtrl.SetStringItem(index, 3, 'Hyperlink')
        self._listCtrl.SetItemHyperText(index, 3)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self._listCtrl, 1, wx.EXPAND)
        self.SetSizer(sizer)


# our normal wxApp-derived class, as usual

app = wx.App(0)

frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()

app.MainLoop()

Result:
ultimatelistctrl

@Jenyay Jenyay changed the title UltimateListCtrl. Draw Hyperlink UltimateListCtrl. Draw HyperText Sep 21, 2018

@Jenyay Jenyay referenced this issue Sep 21, 2018

Merged

Fix #1010 #1011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment