projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implement proper bitmap copying
[wxWidgets.git]
/
wxPython
/
demo
/
ComboBox.py
diff --git
a/wxPython/demo/ComboBox.py
b/wxPython/demo/ComboBox.py
index dc16c72b29d01218bdfd5369f5702d6de67cd238..e1335dbe3d4f63f00386dbc38fa9b70acbf30543 100644
(file)
--- a/
wxPython/demo/ComboBox.py
+++ b/
wxPython/demo/ComboBox.py
@@
-40,19
+40,18
@@
class TestComboBox(wx.Panel):
# This combobox is created with no values initially.
cb = wx.ComboBox(
# This combobox is created with no values initially.
cb = wx.ComboBox(
- self, 501, "default value", (90, 80), (95, -1), [], wx.CB_
SIMPLE
)
+ self, 501, "default value", (90, 80), (95, -1), [], wx.CB_
DROPDOWN
)
# Here we dynamically add our values to the second combobox.
for item in sampleList:
cb.Append(item, item.upper())
self.Bind(wx.EVT_COMBOBOX, self.EvtComboBox, cb)
# Here we dynamically add our values to the second combobox.
for item in sampleList:
cb.Append(item, item.upper())
self.Bind(wx.EVT_COMBOBOX, self.EvtComboBox, cb)
- self.Bind(wx.EVT_COMBOBOX, self.EvtText, cb)
# When the user selects something, we go here.
def EvtComboBox(self, evt):
cb = evt.GetEventObject()
# When the user selects something, we go here.
def EvtComboBox(self, evt):
cb = evt.GetEventObject()
- data = cb.GetClientData(
cb
.GetSelection())
+ data = cb.GetClientData(
evt
.GetSelection())
self.log.WriteText('EvtComboBox: %s\nClientData: %s\n' % (evt.GetString(), data))
if evt.GetString() == 'one':
self.log.WriteText('EvtComboBox: %s\nClientData: %s\n' % (evt.GetString(), data))
if evt.GetString() == 'one':
@@
-61,11
+60,13
@@
class TestComboBox(wx.Panel):
# Capture events every time a user hits a key in the text entry field.
def EvtText(self, evt):
self.log.WriteText('EvtText: %s\n' % evt.GetString())
# Capture events every time a user hits a key in the text entry field.
def EvtText(self, evt):
self.log.WriteText('EvtText: %s\n' % evt.GetString())
+ evt.Skip()
# Capture events when the user types something into the control then
# hits ENTER.
def EvtTextEnter(self, evt):
self.log.WriteText('EvtTextEnter: %s' % evt.GetString())
# Capture events when the user types something into the control then
# hits ENTER.
def EvtTextEnter(self, evt):
self.log.WriteText('EvtTextEnter: %s' % evt.GetString())
+ evt.Skip()
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
@@
-103,5
+104,5
@@
event is generated every time that the user hits a key in the ComboBox entry fie
if __name__ == '__main__':
import sys,os
import run
if __name__ == '__main__':
import sys,os
import run
- run.main(['', os.path.basename(sys.argv[0])])
+ run.main(['', os.path.basename(sys.argv[0])]
+ sys.argv[1:]
)