PyCrust 0.8.1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -373,6 +373,9 @@ Platform: %s""" % (VERSION, self.revision, self.interp.revision,
|
|||||||
|
|
||||||
def OnUpdateUI(self, event):
|
def OnUpdateUI(self, event):
|
||||||
"""Check for matching braces."""
|
"""Check for matching braces."""
|
||||||
|
# If the auto-complete window is up let it do its thing.
|
||||||
|
if self.AutoCompActive():
|
||||||
|
return
|
||||||
braceAtCaret = -1
|
braceAtCaret = -1
|
||||||
braceOpposite = -1
|
braceOpposite = -1
|
||||||
charBefore = None
|
charBefore = None
|
||||||
@@ -431,17 +434,20 @@ Platform: %s""" % (VERSION, self.revision, self.interp.revision,
|
|||||||
# Add the autocomplete character to the end of the command.
|
# Add the autocomplete character to the end of the command.
|
||||||
command = self.GetTextRange(stoppos, currpos) + chr(key)
|
command = self.GetTextRange(stoppos, currpos) + chr(key)
|
||||||
self.write(chr(key))
|
self.write(chr(key))
|
||||||
if self.autoComplete: self.autoCompleteShow(command)
|
if self.autoComplete:
|
||||||
|
self.autoCompleteShow(command)
|
||||||
elif key == ord('('):
|
elif key == ord('('):
|
||||||
# The left paren activates a call tip and cancels
|
# The left paren activates a call tip and cancels
|
||||||
# an active auto completion.
|
# an active auto completion.
|
||||||
if self.AutoCompActive(): self.AutoCompCancel()
|
if self.AutoCompActive():
|
||||||
|
self.AutoCompCancel()
|
||||||
# Get the command between the prompt and the cursor.
|
# Get the command between the prompt and the cursor.
|
||||||
# Add the '(' to the end of the command.
|
# Add the '(' to the end of the command.
|
||||||
self.ReplaceSelection('')
|
self.ReplaceSelection('')
|
||||||
command = self.GetTextRange(stoppos, currpos) + '('
|
command = self.GetTextRange(stoppos, currpos) + '('
|
||||||
self.write('(')
|
self.write('(')
|
||||||
if self.autoCallTip: self.autoCallTipShow(command)
|
if self.autoCallTip:
|
||||||
|
self.autoCallTipShow(command)
|
||||||
else:
|
else:
|
||||||
# Allow the normal event handling to take place.
|
# Allow the normal event handling to take place.
|
||||||
event.Skip()
|
event.Skip()
|
||||||
@@ -449,6 +455,10 @@ Platform: %s""" % (VERSION, self.revision, self.interp.revision,
|
|||||||
def OnKeyDown(self, event):
|
def OnKeyDown(self, event):
|
||||||
"""Key down event handler."""
|
"""Key down event handler."""
|
||||||
|
|
||||||
|
# If the auto-complete window is up let it do its thing.
|
||||||
|
if self.AutoCompActive():
|
||||||
|
event.Skip()
|
||||||
|
return
|
||||||
# Prevent modification of previously submitted commands/responses.
|
# Prevent modification of previously submitted commands/responses.
|
||||||
key = event.KeyCode()
|
key = event.KeyCode()
|
||||||
controlDown = event.ControlDown()
|
controlDown = event.ControlDown()
|
||||||
@@ -459,20 +469,17 @@ Platform: %s""" % (VERSION, self.revision, self.interp.revision,
|
|||||||
selecting = self.GetSelectionStart() != self.GetSelectionEnd()
|
selecting = self.GetSelectionStart() != self.GetSelectionEnd()
|
||||||
# Return (Enter) is used to submit a command to the interpreter.
|
# Return (Enter) is used to submit a command to the interpreter.
|
||||||
if not controlDown and key == wx.WXK_RETURN:
|
if not controlDown and key == wx.WXK_RETURN:
|
||||||
if self.AutoCompActive(): self.AutoCompCancel()
|
if self.CallTipActive():
|
||||||
if self.CallTipActive(): self.CallTipCancel()
|
self.CallTipCancel()
|
||||||
self.processLine()
|
self.processLine()
|
||||||
# Ctrl+Return (Cntrl+Enter) is used to insert a line break.
|
# Ctrl+Return (Cntrl+Enter) is used to insert a line break.
|
||||||
elif controlDown and key == wx.WXK_RETURN:
|
elif controlDown and key == wx.WXK_RETURN:
|
||||||
if self.AutoCompActive(): self.AutoCompCancel()
|
if self.CallTipActive():
|
||||||
if self.CallTipActive(): self.CallTipCancel()
|
self.CallTipCancel()
|
||||||
if currpos == endpos:
|
if currpos == endpos:
|
||||||
self.processLine()
|
self.processLine()
|
||||||
else:
|
else:
|
||||||
self.insertLineBreak()
|
self.insertLineBreak()
|
||||||
# If the auto-complete window is up let it do its thing.
|
|
||||||
elif self.AutoCompActive():
|
|
||||||
event.Skip()
|
|
||||||
# Let Ctrl-Alt-* get handled normally.
|
# Let Ctrl-Alt-* get handled normally.
|
||||||
elif controlDown and altDown:
|
elif controlDown and altDown:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
@@ -901,7 +908,7 @@ Platform: %s""" % (VERSION, self.revision, self.interp.revision,
|
|||||||
includeMagic=self.autoCompleteIncludeMagic,
|
includeMagic=self.autoCompleteIncludeMagic,
|
||||||
includeSingle=self.autoCompleteIncludeSingle,
|
includeSingle=self.autoCompleteIncludeSingle,
|
||||||
includeDouble=self.autoCompleteIncludeDouble)
|
includeDouble=self.autoCompleteIncludeDouble)
|
||||||
if list:
|
if list and len(list) < 2000:
|
||||||
options = ' '.join(list)
|
options = ' '.join(list)
|
||||||
offset = 0
|
offset = 0
|
||||||
self.AutoCompShow(offset, options)
|
self.AutoCompShow(offset, options)
|
||||||
|
@@ -6,5 +6,5 @@ __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
|||||||
__cvsid__ = "$Id$"
|
__cvsid__ = "$Id$"
|
||||||
__revision__ = "$Revision$"[11:-2]
|
__revision__ = "$Revision$"[11:-2]
|
||||||
|
|
||||||
VERSION = '0.8'
|
VERSION = '0.8.1'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user