自动完成在wxPython wxComboBox [英] Auto-Completion In wxPython wxComboBox

查看:291
本文介绍了自动完成在wxPython wxComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图做一个组合框键入时建议选择,很像一个IDE的code建议/ code-感,或当你在搜索中键入Google的建议。

I've been trying to make a ComboBox which would suggest options as you type, much like an IDE's code suggestions/code-sense, or googles suggestions when you type in a search.

的建议将是从ComboBox下拉菜单,其中包含在组合框的文本框中输入的子项。

The suggestions would be the items from the ComboBox dropdown, which contained the substring typed in the text box of the ComboBox.

我试图使ComboBox做到这一点,没有运气,我已经试过了蒙面组合框,并甚至试图子类ComboCrtl,但我总是碰到麻烦无论是性能方面还是不能够做什么,我想在所有的

I've tried to make a ComboBox do it, with no luck, I've tried the masked ComboBoxes, and have even tried to subclass the ComboCrtl, but I've always run into troubles either performance wise or not being able to do what I want at all

我在我的项目(​​建议)列表2500左右的项目,只需清除组合框和插入它匹配的方式过于缓慢的项目。

I have around 2500 items in my list of items (suggestions), and simply clearing the ComboBox and inserting the items which match is way too slow.

如何去作出这样的组合框,还是有甚至内置功能我可以使用?

How would I go about making such a ComboBox, or is there even a built-in feature i could use?

我可以让一个小的延迟显示的建议之前,但整个窗口挂了一两秒钟是不能接受的,在我看来。

I can allow a small delay before the suggestions are shown, but the whole window hanging for a second or two is not acceptable, in my oppinion.

推荐答案

几年前,我通过继承TextCtrl了这样的一个控制。它支持HTML建议格式化。 在这里你去。

Few years ago I made a control like this by subclassing TextCtrl. It supports HTML formating for suggestions. Here you go.

还有这表明选项

There is also the Combo Box that Suggests Options

这篇关于自动完成在wxPython wxComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆