projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added test bitmap.
[wxWidgets.git]
/
wxPython
/
demo
/
TextCtrl.py
diff --git
a/wxPython/demo/TextCtrl.py
b/wxPython/demo/TextCtrl.py
index 8c954a43b1db5c15e670884f9e93af2570cb482b..003c100da76ffc4f645993e1068257e4e06d5bd6 100644
(file)
--- a/
wxPython/demo/TextCtrl.py
+++ b/
wxPython/demo/TextCtrl.py
@@
-1,7
+1,3
@@
-# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-#
import sys
import wx
import sys
import wx
@@
-26,7
+22,7
@@
class TestPanel(wx.Panel):
l1 = wx.StaticText(self, -1, "wx.TextCtrl")
t1 = wx.TextCtrl(self, -1, "Test it out and see", size=(125, -1))
l1 = wx.StaticText(self, -1, "wx.TextCtrl")
t1 = wx.TextCtrl(self, -1, "Test it out and see", size=(125, -1))
-
t1.SetInsertionPoint(
0)
+
wx.CallAfter(t1.SetInsertionPoint,
0)
self.tc1 = t1
self.Bind(wx.EVT_TEXT, self.EvtText, t1)
self.tc1 = t1
self.Bind(wx.EVT_TEXT, self.EvtText, t1)
@@
-43,10
+39,12
@@
class TestPanel(wx.Panel):
t3 = wx.TextCtrl(self, -1,
"Here is a looooooooooooooong line of text set in the control.\n\n"
"The quick brown fox jumped over the lazy dog...",
t3 = wx.TextCtrl(self, -1,
"Here is a looooooooooooooong line of text set in the control.\n\n"
"The quick brown fox jumped over the lazy dog...",
- size=(200, 100), style=wx.TE_MULTILINE)
+ size=(200, 100), style=wx.TE_MULTILINE
|wx.TE_PROCESS_ENTER
)
t3.SetInsertionPoint(0)
self.Bind(wx.EVT_TEXT, self.EvtText, t3)
t3.SetInsertionPoint(0)
self.Bind(wx.EVT_TEXT, self.EvtText, t3)
+ self.Bind(wx.EVT_TEXT_ENTER, self.EvtTextEnter, t3)
+
b = wx.Button(self, -1, "Test Replace")
self.Bind(wx.EVT_BUTTON, self.OnTestReplace, b)
b2 = wx.Button(self, -1, "Test GetSelection")
b = wx.Button(self, -1, "Test Replace")
self.Bind(wx.EVT_BUTTON, self.OnTestReplace, b)
b2 = wx.Button(self, -1, "Test GetSelection")
@@
-74,12
+72,13
@@
class TestPanel(wx.Panel):
t5.Bind(wx.EVT_LEFT_DOWN, self.OnT5LeftDown)
self.t5 = t5
t5.Bind(wx.EVT_LEFT_DOWN, self.OnT5LeftDown)
self.t5 = t5
+ space = 4
bsizer = wx.BoxSizer(wx.VERTICAL)
bsizer = wx.BoxSizer(wx.VERTICAL)
- bsizer.Add(b, 0, wx.GROW|wx.ALL,
4
)
- bsizer.Add(b2, 0, wx.GROW|wx.ALL,
4
)
- bsizer.Add(b3, 0, wx.GROW|wx.ALL,
4
)
+ bsizer.Add(b, 0, wx.GROW|wx.ALL,
space
)
+ bsizer.Add(b2, 0, wx.GROW|wx.ALL,
space
)
+ bsizer.Add(b3, 0, wx.GROW|wx.ALL,
space
)
- sizer = wx.FlexGridSizer(cols=3, hgap=
6, vgap=6
)
+ sizer = wx.FlexGridSizer(cols=3, hgap=
space, vgap=space
)
sizer.AddMany([ l1, t1, (0,0),
l2, t2, (0,0),
l3, t3, bsizer,
sizer.AddMany([ l1, t1, (0,0),
l2, t2, (0,0),
l3, t3, bsizer,
@@
-95,6
+94,9
@@
class TestPanel(wx.Panel):
def EvtText(self, event):
self.log.WriteText('EvtText: %s\n' % event.GetString())
def EvtText(self, event):
self.log.WriteText('EvtText: %s\n' % event.GetString())
+ def EvtTextEnter(self, event):
+ self.log.WriteText('EvtTextEnter\n')
+ event.Skip()
def EvtChar(self, event):
self.log.WriteText('EvtChar: %d\n' % event.GetKeyCode())
def EvtChar(self, event):
self.log.WriteText('EvtChar: %d\n' % event.GetKeyCode())
@@
-161,7
+163,7
@@
def runTest(frame, nb, log):
overview = """\
overview = """\
-A
text contro
l allows text to be displayed and (possibly) edited. It may be single
+A
TextCtr
l allows text to be displayed and (possibly) edited. It may be single
line or multi-line, support styles or not, be read-only or not, and even supports
text masking for such things as passwords.
line or multi-line, support styles or not, be read-only or not, and even supports
text masking for such things as passwords.
@@
-172,5
+174,5
@@
text masking for such things as passwords.
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:]
)