def StartingKey(self, event): key = event.GetKeyCode() event.Skip() # DEBUG seen this skip as soon as possible if key == wx.WXK_DELETE or key > 255: self._grid.HideCellEditControl() elif key == wx.WXK_BACK: self._tc.SetValue(self._original_value) else: self._tc.SetValue(unichr(key)) self._tc.SetFocus() self._tc.SetInsertionPointEnd()
def _populate_content_assist(self, event=None): value = self.GetValue() if event is not None: if event.GetKeyCode() == wx.WXK_BACK: value = value[:-1] elif event.GetKeyCode() == wx.WXK_DELETE: pos = self.GetInsertionPoint() value = value[:pos] + value[pos + 1:] elif event.GetKeyCode() == wx.WXK_ESCAPE: self.hide() return False else: value += unichr(event.GetRawKeyCode()) (self.gherkin_prefix, value) = self._remove_bdd_prefix(value) return self._popup.content_assist_for(value, row=self._row)