当前位置: 首页>>代码示例>>Python>>正文


Python wx.ListCtrl方法代码示例

本文整理汇总了Python中wx.ListCtrl方法的典型用法代码示例。如果您正苦于以下问题:Python wx.ListCtrl方法的具体用法?Python wx.ListCtrl怎么用?Python wx.ListCtrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.ListCtrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onCheckboxDiaginch

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def onCheckboxDiaginch(self, event):
        cb_state = self.cb_diaginch.GetValue()
        sizer = self.sizer_setting_diaginch
        self.sizer_toggle_children(sizer, cb_state)
        if cb_state == False:
            # revert to automatic detection and save
            self.display_sys.update_display_diags("auto")
            self.display_sys.save_system()
            diags = [str(dsp.diagonal_size()[1]) for dsp in self.display_sys.disp_list]
            for tc, diag in zip(self.tc_list_diaginch, diags):
                tc.ChangeValue(diag)
            display_data = self.display_sys.get_disp_list(self.show_advanced_settings)
            self.wpprev_pnl.update_display_data(
                display_data,
                self.show_advanced_settings,
                self.use_multi_image
            )

    #
    # ListCtrl methods
    # 
开发者ID:hhannine,项目名称:superpaper,代码行数:23,代码来源:gui.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, parent):
        wx.ListCtrl.__init__(self, parent, -1,
            style = wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_SINGLE_SEL |
                    wx.LC_HRULES | wx.LC_VRULES)

        self.sex = ["Female", "Male"]

        self.InsertColumn(0, "Name")
        self.InsertColumn(1, "Type")
        self.InsertColumn(2, "Sex")
        self.SetColumnWidth(0, 120)
        self.SetColumnWidth(1, 120)

        # we can't use wx.LIST_AUTOSIZE since this is a virtual control,
        # so calculate the size ourselves since we know the longest string
        # possible.
        w = util.getTextExtent(self.GetFont(), "Female")[0] + 15
        self.SetColumnWidth(2, w)

        util.setWH(self, w = 120*2 + w + 25) 
开发者ID:trelby,项目名称:trelby,代码行数:22,代码来源:namesdlg.py

示例3: _listCtrlOnContextMenuClick

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def _listCtrlOnContextMenuClick(self, event):
        menuItemIndex = event.Id
        theListCtrl = event.GetEventObject().GetInvokingWindow()
        if not isinstance(theListCtrl, wx.ListCtrl):
            theListCtrl = theListCtrl.GetParent()
        if menuItemIndex == 0:
            theListCtrl.DeleteAllItems()
            # Load script again;
            if theListCtrl == self._listctrlScriptList:
                self._loadScript()
        elif menuItemIndex == 1:
            self._listCtrlRunSelectedItems(theListCtrl)
# 
#     def _onLogTextCtrl_MenuClick(self, event):
#         menuItemIndex = event.Id
#         if menuItemIndex == 0:
#             self._logTextCtrl.Clear() 
开发者ID:JavaCardOS,项目名称:pyResMan,代码行数:19,代码来源:pyResManDialog.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(
        self, parent,
        id=-1,
        pos=wx.DefaultPosition, size=wx.DefaultSize,
        style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_VRULES|wx.LC_SINGLE_SEL,
        validator=wx.DefaultValidator,
        columns=None,
        sortOrder=None,
        name=_("ProfileView"),
    ):
        wx.ListCtrl.__init__(self, parent, id, pos, size, style, validator,
                             name)

        if columns is not None:
            self.columns = columns

        if not sortOrder:
            sortOrder = [(x.defaultOrder,x) for x in self.columns if x.sortDefault]
        self.sortOrder = sortOrder or []
        self.sorted = []
        self.CreateControls() 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:23,代码来源:listviews.py

示例5: _set_columns

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def _set_columns(self):
        """Initializes ListCtrl columns.
        See MainFrame STATUSLIST_COLUMNS attribute for more info. """
        for column_item in sorted(self.columns.values()):
            self.InsertColumn(column_item[0], column_item[1], width=wx.LIST_AUTOSIZE_USEHEADER)

            # If the column width obtained from wxLIST_AUTOSIZE_USEHEADER
            # is smaller than the minimum allowed column width
            # then set the column width to the minumum allowed size
            if self.GetColumnWidth(column_item[0]) < column_item[2]:
                self.SetColumnWidth(column_item[0], column_item[2])

            # Set auto-resize if enabled
            if column_item[3]:
                self.setResizeColumn(column_item[0])

# REFACTOR Extra widgets below should move to other module with widgets 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:19,代码来源:mainframe.py

示例6: selectBeforePopup

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def selectBeforePopup(ctrl, pos):
    """Ensures the item the mouse is pointing at is selected before a popup.

    Works with both single-select and multi-select lists."""

    if not isinstance(ctrl, wx.ListCtrl):
        return

    n, flags = ctrl.HitTest(pos)
    if n < 0:
        return

    if not ctrl.GetItemState(n, wx.LIST_STATE_SELECTED):
        for i in xrange(ctrl.GetItemCount()):
            ctrl.SetItemState(i, 0, SEL_FOC)
        ctrl.SetItemState(n, SEL_FOC, SEL_FOC) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:18,代码来源:ListCtrl.py

示例7: SortItems

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def SortItems(self, sorter=None):

        if sorter is None:
            sorter = self.GetColumnSorter()

        # TODO:
        # this step is to see if the list needs resorted.
        # improve this by stopping the first time the order would be changed.
        d = [None,] * self.GetItemCount()
        for i in xrange(len(d)):
            # use real GetItemData, so the sorter can translate
            d[i] = wx.ListCtrl.GetItemData(self, i)
        n = list(d)
        n.sort(sorter)

        if n != d:
            wx.ListCtrl.SortItems(self, sorter)

            self._update_indexes()

        self.SelectColumn(self.enabled_columns[self._col]) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:23,代码来源:ListCtrl.py

示例8: DoInsertPage

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def DoInsertPage(self, page, pos):
    if not isinstance(page, wx.Window):
      page=page(self)
      
    ctl=page.GetControl()
    if pos == None:
      self.AddPage(ctl, page.name)
      self.pages.append(page)
    else:
      self.InsertPage(pos, ctl, page.name)
      self.pages.insert(pos, page)
    if isinstance(ctl, wx.ListCtrl):
      ctl.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemDoubleClick)
      ctl.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnItemRightClick)
      ctl.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick)
      if wx.Platform == "__WXMSW__":
        ctl.Bind(wx.EVT_RIGHT_UP, self.OnItemRightClick) 
开发者ID:andreas-p,项目名称:admin4,代码行数:19,代码来源:notebook.py

示例9: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, parent, owner, items=None):
        style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.WANTS_CHARS
        wx.Dialog.__init__(self, parent, -1, _("Menu editor"), style=style)

        self.create_gui()
        self.bind_event_handlers()
        self._set_tooltips()
        self.owner = owner

        import re
        self.handler_re = self.name_re = re.compile(r'^[a-zA-Z_]+[\w-]*(\[\w*\])*$')

        self.selected_index = -1  # index of the selected element in the wx.ListCtrl menu_items
        self._ignore_events = False

        if items:
            self.add_items(items)
            self._select_item(0)
        else:
            self._enable_fields(False) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:22,代码来源:menubar.py

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, parent, owner, items=None):
        style = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.WANTS_CHARS
        wx.Dialog.__init__(self, parent, -1, _("Toolbar editor"), style=style)

        self.create_gui()
        self.bind_event_handlers()
        self._set_tooltips()
        self.owner = owner

        self.handler_re = self.name_re = re.compile(r'^[a-zA-Z_]+[\w-]*(\[\w*\])*$')

        self.selected_index = -1  # index of the selected element in the wx.ListCtrl menu_items
        self._ignore_events = False

        if items:
            self.add_items(items)
            self._select_item(0)
        else:
            self._enable_fields(False) 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:21,代码来源:toolbar.py

示例11: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetTitle("frame")

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        self.list_ctrl_1 = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES)
        self.list_ctrl_1.AppendColumn("A", format=wx.LIST_FORMAT_LEFT, width=-1)
        self.list_ctrl_1.AppendColumn("B", format=wx.LIST_FORMAT_LEFT, width=-1)
        self.list_ctrl_1.AppendColumn("C", format=wx.LIST_FORMAT_LEFT, width=-1)
        self.list_ctrl_1.AppendColumn("D", format=wx.LIST_FORMAT_LEFT, width=-1)
        sizer_1.Add(self.list_ctrl_1, 1, wx.EXPAND, 0)

        self.SetSizer(sizer_1)
        sizer_1.Fit(self)

        self.Layout()
        # end wxGlade

# end of class MyFrame 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:24,代码来源:ListCtrl_Report_Phoenix.py

示例12: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, parent, pos, size = wx.DefaultSize):
        ID = wx.NewId()
        style = wx.LC_REPORT | wx.LC_VRULES | wx.LC_HRULES | wx.LC_SINGLE_SEL
        wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
        mons = [(i[0], i[1], i[2] - i[0], i[3] - i[1]) for i in [j[2] for j in Edm()]]
        for j, header in enumerate(eg.text.General.monitorsHeader):
            self.InsertColumn(j, header, wx.LIST_FORMAT_RIGHT)
            self.SetColumnWidth(j, wx.LIST_AUTOSIZE_USEHEADER)
        for i, mon in enumerate(mons):
            self.InsertStringItem(i, str(i + 1))
            self.SetStringItem(i, 1, str(mon[0]))
            self.SetStringItem(i, 2, str(mon[1]))
            self.SetStringItem(i, 3, str(mon[2]))
            self.SetStringItem(i, 4, str(mon[3]))
        rect = self.GetItemRect(0, wx.LIST_RECT_BOUNDS)
        self.hh = rect[1]  #header height
        self.ih = rect[3]  #item height
        size = self.GetRealSize()
        self.SetMinSize(size)
        self.SetSize(size) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:22,代码来源:MonitorsCtrl.py

示例13: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, parent, id, evtList, ix, plugin):
        width = 205
        wx.ListCtrl.__init__(self, parent, id, style=wx.LC_REPORT |
            wx.LC_NO_HEADER | wx.LC_SINGLE_SEL, size = (width, -1))
        self.parent = parent
        self.id = id
        self.evtList = evtList
        self.ix = ix
        self.plugin = plugin
        self.sel = -1
        self.il = wx.ImageList(16, 16)
        self.il.Add(wx.BitmapFromImage(wx.Image(join(eg.imagesDir, "event.png"), wx.BITMAP_TYPE_PNG)))
        self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
        self.InsertColumn(0, '')
        self.SetColumnWidth(0, width - 5 - SYS_VSCROLL_X)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect)
        self.Bind(wx.EVT_SET_FOCUS, self.OnChange)
        self.Bind(wx.EVT_LIST_INSERT_ITEM, self.OnChange)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnChange)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick)
        self.SetToolTipString(self.plugin.text.toolTip) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:23,代码来源:__init__.py

示例14: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: JobSpooler.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((661, 402))
        self.list_job_spool = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.on_list_drag, self.list_job_spool)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_item_rightclick, self.list_job_spool)
        # end wxGlade
        self.dirty = False
        self.update_buffer_size = False
        self.update_spooler_state = False
        self.update_spooler = False

        self.elements_progress = 0
        self.elements_progress_total = 0
        self.command_index = 0
        self.listener_list = None
        self.list_lookup = {}
        self.Bind(wx.EVT_CLOSE, self.on_close, self) 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:27,代码来源:JobSpooler.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import ListCtrl [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: Keymap.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((500, 530))
        self.list_keymap = wx.ListCtrl(self, wx.ID_ANY, style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES)
        self.button_add = wx.Button(self, wx.ID_ANY, _("Add Hotkey"))
        self.text_key_name = wx.TextCtrl(self, wx.ID_ANY, "")
        self.text_command_name = wx.TextCtrl(self, wx.ID_ANY, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.on_button_add_hotkey, self.button_add)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self)
        self.text_key_name.Bind(wx.EVT_KEY_DOWN, self.on_key_press)
        self.SetFocus() 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:21,代码来源:Keymap.py


注:本文中的wx.ListCtrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。