Merge #3 from the 2.6 branch, containing last set of changes before
the 2.6.2 release. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36806 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f533e26f39
commit
486afba9a4
@ -3,6 +3,18 @@ import wx
|
|||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class StaticText(wx.StaticText):
|
||||||
|
"""
|
||||||
|
A StaticText that only updates the label if it has changed, to
|
||||||
|
help reduce potential flicker since these controls would be
|
||||||
|
updated very frequently otherwise.
|
||||||
|
"""
|
||||||
|
def SetLabel(self, label):
|
||||||
|
if label <> self.GetLabel():
|
||||||
|
wx.StaticText.SetLabel(self, label)
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
class TestPanel(wx.Panel):
|
class TestPanel(wx.Panel):
|
||||||
def __init__(self, parent, log):
|
def __init__(self, parent, log):
|
||||||
self.log = log
|
self.log = log
|
||||||
@ -23,57 +35,57 @@ class TestPanel(wx.Panel):
|
|||||||
fgs = wx.FlexGridSizer(cols=2, hgap=5, vgap=10)
|
fgs = wx.FlexGridSizer(cols=2, hgap=5, vgap=10)
|
||||||
row.Add(fgs, 0, wx.ALL, 30)
|
row.Add(fgs, 0, wx.ALL, 30)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "X pos:")
|
lbl = StaticText(self, -1, "X pos:")
|
||||||
self.x = wx.StaticText(self, -1, "00000")
|
self.x = StaticText(self, -1, "00000")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.x)
|
fgs.Add(self.x)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Y pos:")
|
lbl = StaticText(self, -1, "Y pos:")
|
||||||
self.y = wx.StaticText(self, -1, "00000")
|
self.y = StaticText(self, -1, "00000")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.y)
|
fgs.Add(self.y)
|
||||||
|
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Left down:")
|
lbl = StaticText(self, -1, "Left down:")
|
||||||
self.lft = wx.StaticText(self, -1, "False")
|
self.lft = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.lft)
|
fgs.Add(self.lft)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Middle Down:")
|
lbl = StaticText(self, -1, "Middle Down:")
|
||||||
self.mid = wx.StaticText(self, -1, "False")
|
self.mid = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.mid)
|
fgs.Add(self.mid)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Right down:")
|
lbl = StaticText(self, -1, "Right down:")
|
||||||
self.rgt = wx.StaticText(self, -1, "False")
|
self.rgt = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.rgt)
|
fgs.Add(self.rgt)
|
||||||
|
|
||||||
fgs = wx.FlexGridSizer(cols=2, hgap=5, vgap=10)
|
fgs = wx.FlexGridSizer(cols=2, hgap=5, vgap=10)
|
||||||
row.Add(fgs, 0, wx.ALL, 30)
|
row.Add(fgs, 0, wx.ALL, 30)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Control down:")
|
lbl = StaticText(self, -1, "Control down:")
|
||||||
self.ctrl = wx.StaticText(self, -1, "False")
|
self.ctrl = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.ctrl)
|
fgs.Add(self.ctrl)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Shift down:")
|
lbl = StaticText(self, -1, "Shift down:")
|
||||||
self.shft = wx.StaticText(self, -1, "False")
|
self.shft = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.shft)
|
fgs.Add(self.shft)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Alt down:")
|
lbl = StaticText(self, -1, "Alt down:")
|
||||||
self.alt = wx.StaticText(self, -1, "False")
|
self.alt = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.alt)
|
fgs.Add(self.alt)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Meta down:")
|
lbl = StaticText(self, -1, "Meta down:")
|
||||||
self.meta = wx.StaticText(self, -1, "False")
|
self.meta = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.meta)
|
fgs.Add(self.meta)
|
||||||
|
|
||||||
lbl = wx.StaticText(self, -1, "Cmd down:")
|
lbl = StaticText(self, -1, "Cmd down:")
|
||||||
self.cmd = wx.StaticText(self, -1, "False")
|
self.cmd = StaticText(self, -1, "False")
|
||||||
fgs.Add(lbl)
|
fgs.Add(lbl)
|
||||||
fgs.Add(self.cmd)
|
fgs.Add(self.cmd)
|
||||||
|
|
||||||
@ -114,7 +126,7 @@ overview = """<html><body>
|
|||||||
The mouse and modifier state can be polled with the wx.GetMouseState
|
The mouse and modifier state can be polled with the wx.GetMouseState
|
||||||
function. It returns an instance of a wx.MouseState object that
|
function. It returns an instance of a wx.MouseState object that
|
||||||
contains the current position of the mouse pointer in screen
|
contains the current position of the mouse pointer in screen
|
||||||
coordinants, as well as boolean values indicating the up/down status
|
coordinates, as well as boolean values indicating the up/down status
|
||||||
of the mouse buttons and the modifier keys.
|
of the mouse buttons and the modifier keys.
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,12 +35,19 @@ class TestPanel(wx.Panel):
|
|||||||
exe, spawn = self.GetPyExecutable()
|
exe, spawn = self.GetPyExecutable()
|
||||||
spawn(os.P_NOWAIT, exe, exe, "MDISashDemo.py")
|
spawn(os.P_NOWAIT, exe, exe, "MDISashDemo.py")
|
||||||
|
|
||||||
|
# TODO: This hack can be removed once we fix the way the Python
|
||||||
|
# app bundles are generated so that they are not bundling and
|
||||||
|
# pointing to an otherwise unused and non-GUI-friendly version of
|
||||||
|
# Python on OS X.
|
||||||
def GetPyExecutable(self):
|
def GetPyExecutable(self):
|
||||||
if 'wxMac' in wx.PlatformInfo:
|
if 'wxMac' in wx.PlatformInfo:
|
||||||
# sys.executable will be wrong if running the demo from
|
# sys.executable will be wrong if running the demo from
|
||||||
# an app bundle. Just find pythonw on the path instead.
|
# an app bundle. But the bundle is always using a system
|
||||||
return 'pythonw' + sys.version[:3], os.spawnlp
|
# framework so just hardcode the path to it.
|
||||||
|
if sys.version[:3] == "2.4":
|
||||||
|
return '/usr/local/bin/pythonw', os.spawnl
|
||||||
|
else:
|
||||||
|
return '/usr/bin/pythonw', os.spawnl
|
||||||
else:
|
else:
|
||||||
return sys.executable, os.spawnl
|
return sys.executable, os.spawnl
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ _treeList = [
|
|||||||
'MultiSplitterWindow',
|
'MultiSplitterWindow',
|
||||||
'Throbber',
|
'Throbber',
|
||||||
'GetMouseState',
|
'GetMouseState',
|
||||||
|
'FloatCanvas',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# managed windows == things with a (optional) caption you can close
|
# managed windows == things with a (optional) caption you can close
|
||||||
@ -161,12 +162,11 @@ _treeList = [
|
|||||||
'HtmlWindow',
|
'HtmlWindow',
|
||||||
'HyperLinkCtrl',
|
'HyperLinkCtrl',
|
||||||
'IntCtrl',
|
'IntCtrl',
|
||||||
'MediaCtrl',
|
|
||||||
'MultiSplitterWindow',
|
|
||||||
'MVCTree',
|
'MVCTree',
|
||||||
'MaskedEditControls',
|
'MaskedEditControls',
|
||||||
'MaskedNumCtrl',
|
'MaskedNumCtrl',
|
||||||
'MimeTypesManager',
|
'MediaCtrl',
|
||||||
|
'MultiSplitterWindow',
|
||||||
'PyCrust',
|
'PyCrust',
|
||||||
'PyPlot',
|
'PyPlot',
|
||||||
'PyShell',
|
'PyShell',
|
||||||
@ -233,7 +233,9 @@ _treeList = [
|
|||||||
'DrawXXXList',
|
'DrawXXXList',
|
||||||
'FileHistory',
|
'FileHistory',
|
||||||
'FontEnumerator',
|
'FontEnumerator',
|
||||||
|
'GLCanvas',
|
||||||
'Joystick',
|
'Joystick',
|
||||||
|
'MimeTypesManager',
|
||||||
'MouseGestures',
|
'MouseGestures',
|
||||||
'OGL',
|
'OGL',
|
||||||
'PrintFramework',
|
'PrintFramework',
|
||||||
@ -243,11 +245,6 @@ _treeList = [
|
|||||||
'Unicode',
|
'Unicode',
|
||||||
]),
|
]),
|
||||||
|
|
||||||
# need libs not coming with the demo
|
|
||||||
('Samples using an external library', [
|
|
||||||
'GLCanvas',
|
|
||||||
]),
|
|
||||||
|
|
||||||
|
|
||||||
('Check out the samples dir too', [
|
('Check out the samples dir too', [
|
||||||
]),
|
]),
|
||||||
|
@ -17,6 +17,13 @@ import pprint
|
|||||||
import wx
|
import wx
|
||||||
import images
|
import images
|
||||||
|
|
||||||
|
|
||||||
|
# helper function to make sure we don't convert unicode objects to strings
|
||||||
|
# or vice versa when converting lists and None values to text.
|
||||||
|
convert = str
|
||||||
|
if 'unicode' in wx.PlatformInfo:
|
||||||
|
convert = unicode
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
class MimeTypesDemoPanel(wx.Panel):
|
class MimeTypesDemoPanel(wx.Panel):
|
||||||
@ -199,8 +206,16 @@ class MimeTypesDemoPanel(wx.Panel):
|
|||||||
mtypes = wx.TheMimeTypesManager.EnumAllFileTypes()
|
mtypes = wx.TheMimeTypesManager.EnumAllFileTypes()
|
||||||
except wx.PyAssertionError:
|
except wx.PyAssertionError:
|
||||||
mtypes = []
|
mtypes = []
|
||||||
|
|
||||||
|
# TODO: On wxMac, EnumAllFileTypes produces tons of dupes, which
|
||||||
|
# causes quirky behavior because the list control doesn't expect
|
||||||
|
# dupes, and simply wastes space. So remove the dupes for now,
|
||||||
|
# then remove this hack when we fix EnumAllFileTypes on Mac.
|
||||||
|
mimes = []
|
||||||
for mt in mtypes:
|
for mt in mtypes:
|
||||||
self.mimelist.Append(mt)
|
if mt not in mimes:
|
||||||
|
self.mimelist.Append(mt)
|
||||||
|
mimes.append(mt)
|
||||||
|
|
||||||
# Do a lookup of *.wav for a starting position
|
# Do a lookup of *.wav for a starting position
|
||||||
self.OnLookup()
|
self.OnLookup()
|
||||||
@ -234,10 +249,10 @@ class MimeTypesDemoPanel(wx.Panel):
|
|||||||
|
|
||||||
# Select the entered value in the list
|
# Select the entered value in the list
|
||||||
if fileType:
|
if fileType:
|
||||||
if self.mimelist.FindString(str(fileType.GetMimeType())) != -1:
|
if self.mimelist.FindString(convert(fileType.GetMimeType())) != -1:
|
||||||
# Using CallAfter to ensure that GUI is ready before trying to
|
# Using CallAfter to ensure that GUI is ready before trying to
|
||||||
# select it (otherwise, it's selected but not visible)
|
# select it (otherwise, it's selected but not visible)
|
||||||
wx.CallAfter(self.mimelist.SetSelection, self.mimelist.FindString(str(fileType.GetMimeType())))
|
wx.CallAfter(self.mimelist.SetSelection, self.mimelist.FindString(convert(fileType.GetMimeType())))
|
||||||
|
|
||||||
|
|
||||||
if fileType is None:
|
if fileType is None:
|
||||||
@ -264,23 +279,23 @@ class MimeTypesDemoPanel(wx.Panel):
|
|||||||
bmp = images.getNoIconBitmap()
|
bmp = images.getNoIconBitmap()
|
||||||
self.icon.SetBitmap(bmp)
|
self.icon.SetBitmap(bmp)
|
||||||
self.iconsource.SetValue(file)
|
self.iconsource.SetValue(file)
|
||||||
self.iconoffset.SetValue(str(idx))
|
self.iconoffset.SetValue(convert(idx))
|
||||||
|
|
||||||
#------- MIME type
|
#------- MIME type
|
||||||
self.mimetype.SetValue(str(ft.GetMimeType()))
|
self.mimetype.SetValue(convert(ft.GetMimeType()))
|
||||||
#------- MIME types
|
#------- MIME types
|
||||||
self.mimetypes.SetValue(str(ft.GetMimeTypes()))
|
self.mimetypes.SetValue(convert(ft.GetMimeTypes()))
|
||||||
#------- Associated extensions
|
#------- Associated extensions
|
||||||
self.extensions.SetValue(str(ft.GetExtensions()))
|
self.extensions.SetValue(convert(ft.GetExtensions()))
|
||||||
#------- Description of file type
|
#------- Description of file type
|
||||||
self.description.SetValue(str(ft.GetDescription()))
|
self.description.SetValue(convert(ft.GetDescription()))
|
||||||
|
|
||||||
#------- Prep a fake command line command
|
#------- Prep a fake command line command
|
||||||
extList = ft.GetExtensions()
|
extList = ft.GetExtensions()
|
||||||
|
|
||||||
if extList:
|
if extList:
|
||||||
ext = extList[0]
|
ext = extList[0]
|
||||||
if ext[0] == ".": ext = ext[1:]
|
if len(ext) > 0 and ext[0] == ".": ext = ext[1:]
|
||||||
else:
|
else:
|
||||||
ext = ""
|
ext = ""
|
||||||
|
|
||||||
@ -289,11 +304,11 @@ class MimeTypesDemoPanel(wx.Panel):
|
|||||||
|
|
||||||
#------- OPEN command
|
#------- OPEN command
|
||||||
cmd = ft.GetOpenCommand(filename, mime)
|
cmd = ft.GetOpenCommand(filename, mime)
|
||||||
self.opencommand.SetValue(str(cmd))
|
self.opencommand.SetValue(convert(cmd))
|
||||||
|
|
||||||
#------- PRINT command
|
#------- PRINT command
|
||||||
cmd = ft.GetPrintCommand(filename, mime)
|
cmd = ft.GetPrintCommand(filename, mime)
|
||||||
self.printcommand.SetValue(str(cmd))
|
self.printcommand.SetValue(convert(cmd))
|
||||||
|
|
||||||
#------- All commands
|
#------- All commands
|
||||||
all = ft.GetAllCommands(filename, mime)
|
all = ft.GetAllCommands(filename, mime)
|
||||||
|
@ -12,15 +12,15 @@ page for more information about managing multiple installs:
|
|||||||
|
|
||||||
In addition to the wxPython modules, several tools scripts (such as
|
In addition to the wxPython modules, several tools scripts (such as
|
||||||
XRCed and PyShell) and batch file launchers have been installed to
|
XRCed and PyShell) and batch file launchers have been installed to
|
||||||
Python's Scripts directory. (For example, c:\Python23\Scripts.) IF
|
Python's Scripts directory. (For example, c:\Python23\Scripts.) If
|
||||||
you have multiple versions of wxPython installed these tool scripts
|
you have multiple versions of wxPython installed these tool scripts
|
||||||
will use whichever is the default install. If you would like to
|
will use whichever is the default install. If you would like to
|
||||||
control which version is used then follow the directions at the wiki
|
control which version is used then follow the directions at the wiki
|
||||||
page for using wxversion.
|
page for using wxversion.
|
||||||
|
|
||||||
This installer does *not* include the wxPython documentation, the
|
This installer does *not* include the wxPython documentation, the
|
||||||
wxPython demo and other sample applications are provided as part of
|
wxPython demo and other sample applications that are provided as part
|
||||||
wxPython. Those are available in a separate installer named
|
of wxPython. Those are available in a separate installer named
|
||||||
wxPython2.6-win32-docs-demos-*.exe which should also be located from
|
wxPython2.6-win32-docs-demos-*.exe which should also be located from
|
||||||
wherever you downloaded this package from. The Docs and Demos
|
wherever you downloaded this package from. The Docs and Demos
|
||||||
installer will also create Start Menu shortcuts for the tool scripts
|
installer will also create Start Menu shortcuts for the tool scripts
|
||||||
|
@ -29,7 +29,7 @@ if [ $KIND = daily ]; then
|
|||||||
destdir=$UPLOAD_DAILY_ROOT/$DAILY
|
destdir=$UPLOAD_DAILY_ROOT/$DAILY
|
||||||
echo "Copying to the starship at $destdir..."
|
echo "Copying to the starship at $destdir..."
|
||||||
ssh $UPLOAD_HOST "mkdir -p $destdir"
|
ssh $UPLOAD_HOST "mkdir -p $destdir"
|
||||||
scp $STAGING_DIR/* $UPLOAD_HOST:/$destdir
|
scp -p $STAGING_DIR/* $UPLOAD_HOST:/$destdir
|
||||||
ssh $UPLOAD_HOST "cd $destdir && ls -al"
|
ssh $UPLOAD_HOST "cd $destdir && ls -al"
|
||||||
|
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ if [ $KIND = release ]; then
|
|||||||
echo "Copying to the starship..."
|
echo "Copying to the starship..."
|
||||||
destdir=$UPLOAD_PREVIEW_ROOT/$VERSION
|
destdir=$UPLOAD_PREVIEW_ROOT/$VERSION
|
||||||
ssh $UPLOAD_HOST "mkdir -p $destdir"
|
ssh $UPLOAD_HOST "mkdir -p $destdir"
|
||||||
scp $STAGING_DIR/* $UPLOAD_HOST:/$destdir
|
scp -p $STAGING_DIR/* $UPLOAD_HOST:/$destdir
|
||||||
|
|
||||||
# Send email to wxPython-dev
|
# Send email to wxPython-dev
|
||||||
DATE=`date`
|
DATE=`date`
|
||||||
|
@ -110,7 +110,7 @@ is useful, for example, if you would like to remove some output
|
|||||||
or errors or etc. from the buffer before doing a copy/paste.
|
or errors or etc. from the buffer before doing a copy/paste.
|
||||||
The free edit mode is designated by the use of a red,
|
The free edit mode is designated by the use of a red,
|
||||||
non-flashing caret.</li>
|
non-flashing caret.</li>
|
||||||
<li>Ctrl-H will fold/unfold (hide/show) the selected lines.</li>
|
<li>Ctrl-Shift-F will fold/unfold (hide/show) the selected lines.</li>
|
||||||
<li>General code cleanup and fixes.</li>
|
<li>General code cleanup and fixes.</li>
|
||||||
<li>Use wx.StandardPaths to determine the location of the config
|
<li>Use wx.StandardPaths to determine the location of the config
|
||||||
files.</li>
|
files.</li>
|
||||||
|
@ -159,7 +159,7 @@ tweaked and finished up by me. The changes include the following:
|
|||||||
The free edit mode is designated by the use of a red,
|
The free edit mode is designated by the use of a red,
|
||||||
non-flashing caret.
|
non-flashing caret.
|
||||||
|
|
||||||
* Ctrl-H will fold/unfold (hide/show) the selected lines.
|
* Ctrl-Shift-F will fold/unfold (hide/show) the selected lines.
|
||||||
|
|
||||||
* General code cleanup and fixes.
|
* General code cleanup and fixes.
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ history. Bound to Shift-Return.</li>
|
|||||||
useful, for example, if you would like to remove some output or
|
useful, for example, if you would like to remove some output or
|
||||||
errors or etc. from the buffer before doing a copy/paste. The free
|
errors or etc. from the buffer before doing a copy/paste. The free
|
||||||
edit mode is designated by the use of a red, non-flashing caret.</li>
|
edit mode is designated by the use of a red, non-flashing caret.</li>
|
||||||
<li>Ctrl-H will fold/unfold (hide/show) the selected lines.</li>
|
<li>Ctrl-Shift-F will fold/unfold (hide/show) the selected lines.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>On top of these changes I (Robin Dunn) added the following:</p>
|
<p>On top of these changes I (Robin Dunn) added the following:</p>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
|
@ -1905,7 +1905,7 @@ class FloatCanvas(wx.Panel):
|
|||||||
self.ObjectUnderMouse = None
|
self.ObjectUnderMouse = None
|
||||||
|
|
||||||
# called just to make sure everything is initialized
|
# called just to make sure everything is initialized
|
||||||
self.OnSize(None)
|
##self.OnSize(None)
|
||||||
|
|
||||||
self.InHereNum = 0
|
self.InHereNum = 0
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Their changes include the following:
|
|||||||
errors or etc. from the buffer before doing a copy/paste. The free
|
errors or etc. from the buffer before doing a copy/paste. The free
|
||||||
edit mode is designated by the use of a red, non-flashing caret.
|
edit mode is designated by the use of a red, non-flashing caret.
|
||||||
|
|
||||||
* Ctrl-H will fold/unfold (hide/show) the selected lines.
|
* Ctrl-Shift-F will fold/unfold (hide/show) the selected lines.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,26 +176,37 @@ class Frame(wx.Frame):
|
|||||||
'Call Tip Options')
|
'Call Tip Options')
|
||||||
|
|
||||||
if wx.Platform == "__WXMAC__":
|
if wx.Platform == "__WXMAC__":
|
||||||
m.Append(ID_USEAA, '&Use AntiAliasing\tCtrl+Shift+A',
|
m.Append(ID_USEAA, '&Use AntiAliasing',
|
||||||
'Use anti-aliased fonts', wx.ITEM_CHECK)
|
'Use anti-aliased fonts', wx.ITEM_CHECK)
|
||||||
|
|
||||||
m.AppendSeparator()
|
m.AppendSeparator()
|
||||||
m.Append(ID_SAVEHISTORY, '&Save History\tAlt+Ctrl+A', 'Automatically save history on close', wx.ITEM_CHECK)
|
m.Append(ID_SAVEHISTORY, '&Save History',
|
||||||
|
'Automatically save history on close', wx.ITEM_CHECK)
|
||||||
self.startupMenu = wx.Menu()
|
self.startupMenu = wx.Menu()
|
||||||
self.startupMenu.Append(ID_EXECSTARTUPSCRIPT, 'E&xecute Startup Script\tAlt+Ctrl+X', 'Execute Startup Script', wx.ITEM_CHECK)
|
self.startupMenu.Append(ID_EXECSTARTUPSCRIPT,
|
||||||
self.startupMenu.Append(ID_EDITSTARTUPSCRIPT, '&Edit Startup Script\tAlt+Ctrl+E', 'Edit Startup Script')
|
'E&xecute Startup Script',
|
||||||
|
'Execute Startup Script', wx.ITEM_CHECK)
|
||||||
|
self.startupMenu.Append(ID_EDITSTARTUPSCRIPT,
|
||||||
|
'&Edit Startup Script',
|
||||||
|
'Edit Startup Script')
|
||||||
m.AppendMenu(ID_STARTUP, '&Startup', self.startupMenu, 'Startup Options')
|
m.AppendMenu(ID_STARTUP, '&Startup', self.startupMenu, 'Startup Options')
|
||||||
|
|
||||||
self.settingsMenu = wx.Menu()
|
self.settingsMenu = wx.Menu()
|
||||||
self.settingsMenu.Append(ID_AUTO_SAVESETTINGS, '&Auto Save Settings\tAlt+Ctrl+A', 'Automatically save settings on close', wx.ITEM_CHECK)
|
self.settingsMenu.Append(ID_AUTO_SAVESETTINGS,
|
||||||
self.settingsMenu.Append(ID_SAVESETTINGS, '&Save Settings\tAlt+Ctrl+S', 'Save settings now')
|
'&Auto Save Settings',
|
||||||
self.settingsMenu.Append(ID_DELSETTINGSFILE, '&Revert to default\tAlt+Ctrl+R', 'Revert to the default settings')
|
'Automatically save settings on close', wx.ITEM_CHECK)
|
||||||
|
self.settingsMenu.Append(ID_SAVESETTINGS,
|
||||||
|
'&Save Settings',
|
||||||
|
'Save settings now')
|
||||||
|
self.settingsMenu.Append(ID_DELSETTINGSFILE,
|
||||||
|
'&Revert to default',
|
||||||
|
'Revert to the default settings')
|
||||||
m.AppendMenu(ID_SETTINGS, '&Settings', self.settingsMenu, 'Settings Options')
|
m.AppendMenu(ID_SETTINGS, '&Settings', self.settingsMenu, 'Settings Options')
|
||||||
|
|
||||||
m = self.helpMenu = wx.Menu()
|
m = self.helpMenu = wx.Menu()
|
||||||
m.Append(ID_HELP, '&Help\tF1', 'Help!')
|
m.Append(ID_HELP, '&Help\tF1', 'Help!')
|
||||||
m.AppendSeparator()
|
m.AppendSeparator()
|
||||||
m.Append(ID_ABOUT, '&About...\tAlt+A', 'About this program')
|
m.Append(ID_ABOUT, '&About...', 'About this program')
|
||||||
|
|
||||||
b = self.menuBar = wx.MenuBar()
|
b = self.menuBar = wx.MenuBar()
|
||||||
b.Append(self.fileMenu, '&File')
|
b.Append(self.fileMenu, '&File')
|
||||||
|
@ -447,6 +447,7 @@ Platform: %s""" % \
|
|||||||
if self.AutoCompActive():
|
if self.AutoCompActive():
|
||||||
event.Skip()
|
event.Skip()
|
||||||
return
|
return
|
||||||
|
|
||||||
# Prevent modification of previously submitted
|
# Prevent modification of previously submitted
|
||||||
# commands/responses.
|
# commands/responses.
|
||||||
controlDown = event.ControlDown()
|
controlDown = event.ControlDown()
|
||||||
@ -456,7 +457,7 @@ Platform: %s""" % \
|
|||||||
endpos = self.GetTextLength()
|
endpos = self.GetTextLength()
|
||||||
selecting = self.GetSelectionStart() != self.GetSelectionEnd()
|
selecting = self.GetSelectionStart() != self.GetSelectionEnd()
|
||||||
|
|
||||||
if controlDown and key in (ord('H'), ord('h')):
|
if controlDown and shiftDown and key in (ord('F'), ord('f')):
|
||||||
li = self.GetCurrentLine()
|
li = self.GetCurrentLine()
|
||||||
m = self.MarkerGet(li)
|
m = self.MarkerGet(li)
|
||||||
if m & 1<<0:
|
if m & 1<<0:
|
||||||
@ -510,10 +511,12 @@ Platform: %s""" % \
|
|||||||
if self.CallTipActive():
|
if self.CallTipActive():
|
||||||
self.CallTipCancel()
|
self.CallTipCancel()
|
||||||
self.processLine()
|
self.processLine()
|
||||||
#Complete Text (from already typed words)
|
|
||||||
|
# Complete Text (from already typed words)
|
||||||
elif shiftDown and key == wx.WXK_RETURN:
|
elif shiftDown and key == wx.WXK_RETURN:
|
||||||
self.OnShowCompHistory()
|
self.OnShowCompHistory()
|
||||||
# Ctrl+Return (Cntrl+Enter) is used to insert a line break.
|
|
||||||
|
# Ctrl+Return (Ctrl+Enter) is used to insert a line break.
|
||||||
elif controlDown and key == wx.WXK_RETURN:
|
elif controlDown and key == wx.WXK_RETURN:
|
||||||
if self.CallTipActive():
|
if self.CallTipActive():
|
||||||
self.CallTipCancel()
|
self.CallTipCancel()
|
||||||
@ -521,40 +524,50 @@ Platform: %s""" % \
|
|||||||
self.processLine()
|
self.processLine()
|
||||||
else:
|
else:
|
||||||
self.insertLineBreak()
|
self.insertLineBreak()
|
||||||
|
|
||||||
# Let Ctrl-Alt-* get handled normally.
|
# Let Ctrl-Alt-* get handled normally.
|
||||||
elif controlDown and altDown:
|
elif controlDown and altDown:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
# Clear the current, unexecuted command.
|
# Clear the current, unexecuted command.
|
||||||
elif key == wx.WXK_ESCAPE:
|
elif key == wx.WXK_ESCAPE:
|
||||||
if self.CallTipActive():
|
if self.CallTipActive():
|
||||||
event.Skip()
|
event.Skip()
|
||||||
else:
|
else:
|
||||||
self.clearCommand()
|
self.clearCommand()
|
||||||
|
|
||||||
# Increase font size.
|
# Increase font size.
|
||||||
elif controlDown and key in (ord(']'),):
|
elif controlDown and key in (ord(']'), wx.WXK_NUMPAD_ADD):
|
||||||
dispatcher.send(signal='FontIncrease')
|
dispatcher.send(signal='FontIncrease')
|
||||||
|
|
||||||
# Decrease font size.
|
# Decrease font size.
|
||||||
elif controlDown and key in (ord('['),):
|
elif controlDown and key in (ord('['), wx.WXK_NUMPAD_SUBTRACT):
|
||||||
dispatcher.send(signal='FontDecrease')
|
dispatcher.send(signal='FontDecrease')
|
||||||
|
|
||||||
# Default font size.
|
# Default font size.
|
||||||
elif controlDown and key in (ord('='),):
|
elif controlDown and key in (ord('='), wx.WXK_NUMPAD_DIVIDE):
|
||||||
dispatcher.send(signal='FontDefault')
|
dispatcher.send(signal='FontDefault')
|
||||||
|
|
||||||
# Cut to the clipboard.
|
# Cut to the clipboard.
|
||||||
elif (controlDown and key in (ord('X'), ord('x'))) \
|
elif (controlDown and key in (ord('X'), ord('x'))) \
|
||||||
or (shiftDown and key == wx.WXK_DELETE):
|
or (shiftDown and key == wx.WXK_DELETE):
|
||||||
self.Cut()
|
self.Cut()
|
||||||
|
|
||||||
# Copy to the clipboard.
|
# Copy to the clipboard.
|
||||||
elif controlDown and not shiftDown \
|
elif controlDown and not shiftDown \
|
||||||
and key in (ord('C'), ord('c'), wx.WXK_INSERT):
|
and key in (ord('C'), ord('c'), wx.WXK_INSERT):
|
||||||
self.Copy()
|
self.Copy()
|
||||||
|
|
||||||
# Copy to the clipboard, including prompts.
|
# Copy to the clipboard, including prompts.
|
||||||
elif controlDown and shiftDown \
|
elif controlDown and shiftDown \
|
||||||
and key in (ord('C'), ord('c'), wx.WXK_INSERT):
|
and key in (ord('C'), ord('c'), wx.WXK_INSERT):
|
||||||
self.CopyWithPrompts()
|
self.CopyWithPrompts()
|
||||||
|
|
||||||
# Copy to the clipboard, including prefixed prompts.
|
# Copy to the clipboard, including prefixed prompts.
|
||||||
elif altDown and not controlDown \
|
elif altDown and not controlDown \
|
||||||
and key in (ord('C'), ord('c'), wx.WXK_INSERT):
|
and key in (ord('C'), ord('c'), wx.WXK_INSERT):
|
||||||
self.CopyWithPromptsPrefixed()
|
self.CopyWithPromptsPrefixed()
|
||||||
|
|
||||||
# Home needs to be aware of the prompt.
|
# Home needs to be aware of the prompt.
|
||||||
elif key == wx.WXK_HOME:
|
elif key == wx.WXK_HOME:
|
||||||
home = self.promptPosEnd
|
home = self.promptPosEnd
|
||||||
@ -565,6 +578,7 @@ Platform: %s""" % \
|
|||||||
self.EnsureCaretVisible()
|
self.EnsureCaretVisible()
|
||||||
else:
|
else:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
#
|
#
|
||||||
# The following handlers modify text, so we need to see if
|
# The following handlers modify text, so we need to see if
|
||||||
# there is a selection that includes text prior to the prompt.
|
# there is a selection that includes text prior to the prompt.
|
||||||
@ -572,61 +586,78 @@ Platform: %s""" % \
|
|||||||
# Don't modify a selection with text prior to the prompt.
|
# Don't modify a selection with text prior to the prompt.
|
||||||
elif selecting and key not in NAVKEYS and not self.CanEdit():
|
elif selecting and key not in NAVKEYS and not self.CanEdit():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Paste from the clipboard.
|
# Paste from the clipboard.
|
||||||
elif (controlDown and not shiftDown and key in (ord('V'), ord('v'))) \
|
elif (controlDown and not shiftDown and key in (ord('V'), ord('v'))) \
|
||||||
or (shiftDown and not controlDown and key == wx.WXK_INSERT):
|
or (shiftDown and not controlDown and key == wx.WXK_INSERT):
|
||||||
self.Paste()
|
self.Paste()
|
||||||
|
|
||||||
|
# manually invoke AutoComplete and Calltips
|
||||||
elif controlDown and key == wx.WXK_SPACE:
|
elif controlDown and key == wx.WXK_SPACE:
|
||||||
"""AutoComplete and Calltips manually."""
|
self.OnCallTipAutoCompleteManually(shiftDown)
|
||||||
self.OnCallTipAutoCompleteManually (shiftDown)
|
|
||||||
# Paste from the clipboard, run commands.
|
# Paste from the clipboard, run commands.
|
||||||
elif controlDown and shiftDown and key in (ord('V'), ord('v')):
|
elif controlDown and shiftDown and key in (ord('V'), ord('v')):
|
||||||
self.PasteAndRun()
|
self.PasteAndRun()
|
||||||
|
|
||||||
# Replace with the previous command from the history buffer.
|
# Replace with the previous command from the history buffer.
|
||||||
elif (controlDown and key == wx.WXK_UP) \
|
elif (controlDown and key == wx.WXK_UP) \
|
||||||
or (altDown and key in (ord('P'), ord('p'))):
|
or (altDown and key in (ord('P'), ord('p'))):
|
||||||
self.OnHistoryReplace(step=+1)
|
self.OnHistoryReplace(step=+1)
|
||||||
|
|
||||||
# Replace with the next command from the history buffer.
|
# Replace with the next command from the history buffer.
|
||||||
elif (controlDown and key == wx.WXK_DOWN) \
|
elif (controlDown and key == wx.WXK_DOWN) \
|
||||||
or (altDown and key in (ord('N'), ord('n'))):
|
or (altDown and key in (ord('N'), ord('n'))):
|
||||||
self.OnHistoryReplace(step=-1)
|
self.OnHistoryReplace(step=-1)
|
||||||
|
|
||||||
# Insert the previous command from the history buffer.
|
# Insert the previous command from the history buffer.
|
||||||
elif (shiftDown and key == wx.WXK_UP) and self.CanEdit():
|
elif (shiftDown and key == wx.WXK_UP) and self.CanEdit():
|
||||||
self.OnHistoryInsert(step=+1)
|
self.OnHistoryInsert(step=+1)
|
||||||
|
|
||||||
# Insert the next command from the history buffer.
|
# Insert the next command from the history buffer.
|
||||||
elif (shiftDown and key == wx.WXK_DOWN) and self.CanEdit():
|
elif (shiftDown and key == wx.WXK_DOWN) and self.CanEdit():
|
||||||
self.OnHistoryInsert(step=-1)
|
self.OnHistoryInsert(step=-1)
|
||||||
|
|
||||||
# Search up the history for the text in front of the cursor.
|
# Search up the history for the text in front of the cursor.
|
||||||
elif key == wx.WXK_F8:
|
elif key == wx.WXK_F8:
|
||||||
self.OnHistorySearch()
|
self.OnHistorySearch()
|
||||||
|
|
||||||
# Don't backspace over the latest non-continuation prompt.
|
# Don't backspace over the latest non-continuation prompt.
|
||||||
elif key == wx.WXK_BACK:
|
elif key == wx.WXK_BACK:
|
||||||
if selecting and self.CanEdit():
|
if selecting and self.CanEdit():
|
||||||
event.Skip()
|
event.Skip()
|
||||||
elif currpos > self.promptPosEnd:
|
elif currpos > self.promptPosEnd:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
# Only allow these keys after the latest prompt.
|
# Only allow these keys after the latest prompt.
|
||||||
elif key in (wx.WXK_TAB, wx.WXK_DELETE):
|
elif key in (wx.WXK_TAB, wx.WXK_DELETE):
|
||||||
if self.CanEdit():
|
if self.CanEdit():
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
# Don't toggle between insert mode and overwrite mode.
|
# Don't toggle between insert mode and overwrite mode.
|
||||||
elif key == wx.WXK_INSERT:
|
elif key == wx.WXK_INSERT:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Don't allow line deletion.
|
# Don't allow line deletion.
|
||||||
elif controlDown and key in (ord('L'), ord('l')):
|
elif controlDown and key in (ord('L'), ord('l')):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Don't allow line transposition.
|
# Don't allow line transposition.
|
||||||
elif controlDown and key in (ord('T'), ord('t')):
|
elif controlDown and key in (ord('T'), ord('t')):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Basic navigation keys should work anywhere.
|
# Basic navigation keys should work anywhere.
|
||||||
elif key in NAVKEYS:
|
elif key in NAVKEYS:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
# Protect the readonly portion of the shell.
|
# Protect the readonly portion of the shell.
|
||||||
elif not self.CanEdit():
|
elif not self.CanEdit():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
|
|
||||||
def OnShowCompHistory(self):
|
def OnShowCompHistory(self):
|
||||||
"""Show possible autocompletion Words from already typed words."""
|
"""Show possible autocompletion Words from already typed words."""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user