]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxKeyEvents.py
support Show() in wxFlexGridSizer (patch 737850)
[wxWidgets.git] / wxPython / demo / wxKeyEvents.py
index 4811892fe856499d13428f25c82d5a06b07ad534..7e214089f50803dd3a3b04a1268a75c4e8d52125 100644 (file)
@@ -114,14 +114,17 @@ keyMap = {
 
 class KeySink(wxWindow):
     def __init__(self, parent):
-        wxWindow.__init__(self, parent, -1,
-                          style=wxRAISED_BORDER | wxWANTS_CHARS)
+        wxWindow.__init__(self, parent, -1, style =
+                          wxWANTS_CHARS
+                          #| wxRAISED_BORDER
+                          #| wxSUNKEN_BORDER
+                          )
         self.SetBackgroundColour(wxBLUE)
-        self.haveFocus = false
-        self.callSkip = false
-        self.logKeyDn = true
-        self.logKeyUp = true
-        self.logChar = true
+        self.haveFocus = False
+        self.callSkip = False
+        self.logKeyDn = True
+        self.logKeyUp = True
+        self.logChar = True
 
         EVT_PAINT(self, self.OnPaint)
         EVT_SET_FOCUS(self, self.OnSetFocus)
@@ -161,11 +164,11 @@ class KeySink(wxWindow):
 
 
     def OnSetFocus(self, evt):
-        self.haveFocus = true
+        self.haveFocus = True
         self.Refresh()
 
     def OnKillFocus(self, evt):
-        self.haveFocus = false
+        self.haveFocus = False
         self.Refresh()
 
     def OnMouse(self, evt):
@@ -239,7 +242,7 @@ class KeyLog(wxListCtrl, wxListCtrlAutoWidthMixin):
             else:
                 modifiers += '-'
 
-        id = self.InsertStringItem(0xffffff, evType)
+        id = self.InsertStringItem(self.GetItemCount(), evType)
         self.SetStringItem(id, 1, keyname)
         self.SetStringItem(id, 2, str(keycode))
         self.SetStringItem(id, 3, modifiers)
@@ -274,15 +277,15 @@ class TestPanel(wxPanel):
 
         cb2 = wxCheckBox(self, -1, "EVT_KEY_UP")
         EVT_CHECKBOX(self, cb2.GetId(), self.OnKeyUpCB)
-        cb2.SetValue(true)
+        cb2.SetValue(True)
 
         cb3 = wxCheckBox(self, -1, "EVT_KEY_DOWN")
         EVT_CHECKBOX(self, cb3.GetId(), self.OnKeyDnCB)
-        cb3.SetValue(true)
+        cb3.SetValue(True)
 
         cb4 = wxCheckBox(self, -1, "EVT_CHAR")
         EVT_CHECKBOX(self, cb4.GetId(), self.OnCharCB)
-        cb4.SetValue(true)
+        cb4.SetValue(True)
 
         buttons = wxBoxSizer(wxHORIZONTAL)
         buttons.Add(btn, 0, wxALL, 4)