mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 11:00:07 +01:00
Merge pull request #840 from RobinD42/fix-issue836
Fix wx.TextCompleterSimple.GetCompletions
This commit is contained in:
@@ -105,6 +105,9 @@ Changes in this release include the following:
|
|||||||
* Ensure that the page exists in book controls GetPage and RemovePage methods.
|
* Ensure that the page exists in book controls GetPage and RemovePage methods.
|
||||||
At least one of the wx ports do not do this. (#830)
|
At least one of the wx ports do not do this. (#830)
|
||||||
|
|
||||||
|
* Change wx.TextCompleterSimple.GetCompletions to send the list of strings
|
||||||
|
as a return value, rather than a parameter that gets filled. (#836)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,9 @@ def run():
|
|||||||
c.copyFromClass(tc, 'Start')
|
c.copyFromClass(tc, 'Start')
|
||||||
c.copyFromClass(tc, 'GetNext')
|
c.copyFromClass(tc, 'GetNext')
|
||||||
|
|
||||||
# TODO: Change GetCompletions to return the wxArrayString instead of
|
# Change GetCompletions to return the wxArrayString instead of passing it
|
||||||
# passing it as a parameter?
|
# as a parameter
|
||||||
|
c.find('GetCompletions.res').out = True
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------
|
#-----------------------------------------------------------------
|
||||||
|
|||||||
@@ -27,9 +27,11 @@ class testcompleter_Tests(wtc.WidgetTestCase):
|
|||||||
class MyTextCompleterSimple(wx.TextCompleterSimple):
|
class MyTextCompleterSimple(wx.TextCompleterSimple):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
wx.TextCompleterSimple.__init__(self)
|
wx.TextCompleterSimple.__init__(self)
|
||||||
def GetCompletions(self, prefix, res):
|
def GetCompletions(self, prefix):
|
||||||
|
res = []
|
||||||
res.append("one")
|
res.append("one")
|
||||||
res.append("two")
|
res.append("two")
|
||||||
|
return res
|
||||||
t = wx.TextCtrl(self.frame)
|
t = wx.TextCtrl(self.frame)
|
||||||
t.AutoComplete(MyTextCompleterSimple())
|
t.AutoComplete(MyTextCompleterSimple())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user