From 7db509e27e4478251a9947a2c0d25f2188212806 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 12 Mar 2005 20:59:15 +0000 Subject: [PATCH] some demo tweaks git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32787 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/KeyEvents.py | 7 ++++--- wxPython/demo/LayoutAnchors.py | 8 ++++---- wxPython/demo/StyledTextCtrl_1.py | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wxPython/demo/KeyEvents.py b/wxPython/demo/KeyEvents.py index 1ca318a327..2c72a3a911 100644 --- a/wxPython/demo/KeyEvents.py +++ b/wxPython/demo/KeyEvents.py @@ -226,15 +226,16 @@ class KeyLog(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): keycode = evt.GetKeyCode() keyname = keyMap.get(keycode, None) if keyname is None: - if keycode < 256: + if "unicode" in wx.PlatformInfo and keycode < 128: + keyname = "\"" + unichr(evt.GetUnicodeKey()) + "\"" + + elif keycode < 256: if keycode == 0: keyname = "NUL" elif keycode < 27: keyname = "Ctrl-%s" % chr(ord('A') + keycode-1) else: keyname = "\"%s\"" % chr(keycode) - elif "unicode" in wx.PlatformInfo: - keyname = "\"" + unichr(keycode) + "\"" else: keyname = "unknown (%s)" % keycode diff --git a/wxPython/demo/LayoutAnchors.py b/wxPython/demo/LayoutAnchors.py index aaa4dc8a19..153450e016 100644 --- a/wxPython/demo/LayoutAnchors.py +++ b/wxPython/demo/LayoutAnchors.py @@ -88,7 +88,7 @@ class AnchorsDemoFrame(wx.Frame): self.leftCheckBox = wx.CheckBox( label='Left', id=ID_ANCHORSDEMOFRAMELEFTCHECKBOX, parent=self.mainPanel, name='leftCheckBox', - size=(40, 16), style=0, pos=(8, 8) + style=0, pos=(8, 8) ) self.leftCheckBox.SetConstraints( @@ -103,7 +103,7 @@ class AnchorsDemoFrame(wx.Frame): self.topCheckBox = wx.CheckBox( label='Top', id=ID_ANCHORSDEMOFRAMETOPCHECKBOX, parent=self.mainPanel, name='topCheckBox', - size=(40, 16), style=0, pos=(88, 8) + style=0, pos=(88, 8) ) self.topCheckBox.SetConstraints( @@ -118,7 +118,7 @@ class AnchorsDemoFrame(wx.Frame): self.rightCheckBox = wx.CheckBox( label='Right', id=ID_ANCHORSDEMOFRAMERIGHTCHECKBOX, parent=self.mainPanel, name='rightCheckBox', - size=(48, 16), style=0, pos=(168, 8) + style=0, pos=(168, 8) ) self.rightCheckBox.SetConstraints( @@ -133,7 +133,7 @@ class AnchorsDemoFrame(wx.Frame): self.bottomCheckBox = wx.CheckBox( label='Bottom', id=ID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, parent=self.mainPanel, name='bottomCheckBox', - size=(56, 16), style=0, pos=(248, 8) + style=0, pos=(248, 8) ) self.bottomCheckBox.SetConstraints( diff --git a/wxPython/demo/StyledTextCtrl_1.py b/wxPython/demo/StyledTextCtrl_1.py index 7a7f731792..b62381bfb8 100644 --- a/wxPython/demo/StyledTextCtrl_1.py +++ b/wxPython/demo/StyledTextCtrl_1.py @@ -197,6 +197,7 @@ def runTest(frame, nb, log): # make some styles ed.StyleSetSpec(stc.STC_STYLE_DEFAULT, "size:%d,face:%s" % (pb, face3)) + ed.StyleClearAll() ed.StyleSetSpec(1, "size:%d,bold,face:%s,fore:#0000FF" % (pb+2, face1)) ed.StyleSetSpec(2, "face:%s,italic,fore:#FF0000,size:%d" % (face2, pb)) ed.StyleSetSpec(3, "face:%s,bold,size:%d" % (face2, pb+2)) -- 2.45.2