问题标签 [listctrl]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
85 浏览

python - listctrl 数据项的新行

我创建了一个 listctrl,其中 listctrl 中的一些数据很长,而不是显示它以 . 结尾的所有文本...。例如Att PSSM_r1_0_T is [-10.179077,0.944198]|Att PSSM_r1_0_Y is.... 我怎样才能使它显示所有文本。就像是

Att PSSM_r1_0_T is [-10.179077,0.944198]|Att PSSM_r1_0_Y is [-4.820935,9.914433]|Att PSSM_r1_2_I is [-8.527803,1.953804]|Att PSSM_r1_2_K is [-12.083334,-0.183813]|Att PSSM_r1_2_V is [-14.112536,5.857771]|1

由于文本很长,我希望它覆盖不止一行。

0 投票
1 回答
113 浏览

python - checkboxCtrlMixin show selected values

I have a checkboxCtrlmixin, and what I want is to show the selected values of the checkboxCtrlmixin. Is there any special function in checkboxctrlmixin that shows what values are selected?

My code:

0 投票
1 回答
2589 浏览

visual-studio - 具有 LVS_EX_CHECKBOXES 样式的 CListCtrl

我正在使用具有 LVS_EX_CHECKBOXES 样式的 CListCtrl。而且我需要随时检查至少两个复选框。

我怎样才能做到这一点?

0 投票
0 回答
148 浏览

ruby - 从 XRC 文件加载的 wxListCtrl 的列标题 - wxRuby

我在加载 xrc 文件中定义的 wxListCtrl 的列标题时遇到问题。根据 XRC 文件格式描述(http://docs.wxwidgets.org/trunk/overview_xrcformat...),应该可以按类为该控件定义 wxLC_REPORT 样式的列名。您可以在下面找到我需要运行的代码(gui.xml 是具有所需布局的 xrc 文件)。不幸的是,在我的脚本中,我需要手动添加列标题,以便它们显示在 GUI 中(注释 my_gui.rb 中的第 22、23 行)。有没有办法强制 wxRuby 从 xrc 加载列标题,或者我做错了什么?

我正在使用 ruby​​ 1.9.3p327 (2012-11-10) [i386-mingw32] 和 wxruby-ruby19 (2.0.1 x86-mingw32)。

这是 my_gui.rb:

这是gui.xml:

提前谢谢支持。

0 投票
1 回答
1614 浏览

python - wxPython ListCtrl 复制到剪贴板

我使用 ListCtrl 作为日志文件查看器,这样我就可以对普通用户隐藏“调试”类型的列。我希望能够像在许多其他网格类型程序中一样选择多个单元格,然后右键单击并说“复制”,然后能够将其粘贴到文本文档、电子邮件等中。我希望能够选择任何一组连续的单元格,而不是仅限于整行。

有什么内置的东西可以为我做这件事吗?我将如何做到这一点?我应该切换到虚拟或终极 ListCtrl 吗?也许我应该使用其他一些 wxPython 类?

0 投票
2 回答
949 浏览

wxpython - WxPython,ListCtrl 将行添加到顶部

我有一个 ListCtrl,我希望将新行添加到列表顶部(要向下推的先前行)你能帮我吗?

谢谢!

0 投票
1 回答
395 浏览

wxpython - EnableAlternateRowColours 示例将有很大帮助

我有一个 wx.ListCtrl 接口,如下所示:

http://wiki.wxpython.org/AnotherTutorial#wx.ListCtrl

但我无法让备用行颜色工作,如下所示:

http://wxpython.org/Phoenix/docs/html/ListCtrl.html#ListCtrl.EnableAlternateRowColours

谁能给我一个简单的例子来说明如何使用它们,使用网站上的这个例子?

!/usr/bin/python

大写字母.py

导入 wx

类 MyDialog(wx.Dialog): def init (self, parent, id, title): wx.Dialog。init (self, parent, id, title, size=(600,500), style=wx.DEFAULT_DIALOG_STYLE)

class MyApp(wx.App): def OnInit(self): dia = MyDialog(None, -1, 'capitals.py') dia.ShowModal() dia.Destroy() return True

app = MyApp(0) app.MainLoop()

0 投票
1 回答
4265 浏览

python - 在 Python 和 wxpython 中使用 listctrl 对项目进行排序

我正在尝试对 3 列列表中的项目进行排序,但它不太有效。我将其设置为填充“表格”。当我第一次运行程序时,它对列进行排序没有问题。但是,我可以选择另一个数据源,并且同一个表中填充了新数据(主要是第 3 列更改)。但是,现在当我对项目进行排序时,它会根据原始数据而不是新显示的数据进行排序。有什么帮助吗?

我的代码(一些不必要的部分被删除):

同样,3 列“表”会适当地更新数据,因此那里没有问题。唯一的问题是当我尝试对列进行排序时,它总是根据用于填写表格的原始“adpdata”对其进行排序。

有任何想法吗?

编辑:

这是两个示例字典:

Selection_A 是我使用的默认字典。当我构建列表时,我可以轻松地对三列进行正确排序(比如第 3 列将按 1、2、3、4、5 的顺序显示。但是,当我切换到 Selection_B 时,它仍然根据 Selection_A 值排序(但列表显示 Selection_B 值)- 例如,它显示第 3 列的 3、5、1、2、4 和第 1 列的 A、B、C、D、E 排序(应该是 1、2、3、4、5 和C,D,A,E,B)。我不知道这是否有帮助?我无法显示我的原始字典,因为数据太多。

另外,我确实检查了——我的 self.itemDataMap 确实更新了(我打印了结果)——排序只是没有发生。我想我不完全确定“排序”值在哪里“存储/更新”?

0 投票
2 回答
3744 浏览

python - wxpython listctrl 并修复列宽

我试图在我的面板中使“表格”看起来不错。我遇到的这个问题是表格填满了面板,但一切都在左边。我想让每一列的大小相同,并跨越面板的整个宽度。我见过 ListCtrlAutoWidthMixin 但不确定如何利用它。这是我在代码中的内容:

同样,表格跨越面板,但我的所有列都向左移动。此外,我不想手动设置列大小(除非我可以获取面板大小,然后除以我拥有的列数——因为该程序将在具有不同分辨率的计算机上使用)。我已经尝试过这种方法,但似乎无法获得正确的面板尺寸。我用 GetSize() 和 GetClientSize() 得到的数字都太小了。

谢谢你的帮助!

编辑:添加代码:

0 投票
2 回答
894 浏览

python - How to delete a specific row in wxListCtrl after sorting?

I'm using wx.ListCtrl for live report in my app, and there will be continuous status updating including inserting a new row when a task starts and deleting related rows when the tasks end. Since the list gets sorted every now and then, you cannot simply delete the rows by the rowid you started with. Although you can assign a unique id using SetItemData, and that way you know exactly which row to delete when a task is done, there does NOT seem to be any method related to deleting a row by that unique id, not even a method to get rowid by unique id, and the only method I found is GetItemData, which will return the unique id for a certain row.

So the only way came to my mind is to iterate all rows checking their unique ids and compares it against the given id, if it matches then delete that row. But this sounds way too clumsy, so is there a better way to delete a specific row after sorting?