another merge from WX_2_6_BRANCH

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2006-01-06 07:05:15 +00:00
parent 2091f5e71a
commit 095315e20d
41 changed files with 3008 additions and 38638 deletions

View File

@ -138,8 +138,14 @@ FLAVOUR = "" # Optional flavour string to be appended to VERSION
EP_ADD_OPTS = 1 # When doing MULTIVERSION installs the wx port and
# ansi/unicode settings can optionally be added to the
# subdir path used in site-packages
EP_FULL_VER = 0 # When doing MULTIVERSION installs the default is to
# put only 2 or 3 (depending on stable/unstable) of
# the version compnonents into the "extra path"
# subdir of site-packages. Setting this option to
# 1 will cause the full 4 components of the version
# number to be used instead.
WX_CONFIG = None # Usually you shouldn't need to touch this, but you can set
# it to pass an alternate version of wx-config or alternate
# flags, eg. as required by the .deb in-tree build. By
@ -254,7 +260,7 @@ for flag in [ 'BUILD_ACTIVEX', 'BUILD_ANIMATE', 'BUILD_DLLWIDGET',
'BUILD_OGL', 'BUILD_STC',
'CORE_ONLY', 'PREP_ONLY', 'USE_SWIG', 'UNICODE',
'UNDEF_NDEBUG', 'NO_SCRIPTS', 'NO_HEADERS', 'BUILD_RENAMERS',
'FULL_DOCS', 'INSTALL_MULTIVERSION', 'EP_ADD_OPTS',
'FULL_DOCS', 'INSTALL_MULTIVERSION', 'EP_ADD_OPTS', 'EP_FULL_VER',
'MONOLITHIC', 'FINAL', 'HYBRID', ]:
for x in range(len(sys.argv)):
if sys.argv[x].find(flag) == 0:
@ -290,13 +296,14 @@ UNDEF_NDEBUG=%d
INSTALL_MULTIVERSION=%d
FLAVOUR="%s"
EP_ADD_OPTS=%d
EP_FULL_VER=%d
WX_CONFIG="%s"
WXPORT="%s"
MONOLITHIC=%d
FINAL=%d
HYBRID=%d
""" % (UNICODE, UNDEF_NDEBUG, INSTALL_MULTIVERSION, FLAVOUR, EP_ADD_OPTS,
SYS_WX_CONFIG, WXPORT, MONOLITHIC, FINAL, HYBRID)
EP_FULL_VER, SYS_WX_CONFIG, WXPORT, MONOLITHIC, FINAL, HYBRID)
try:
from build_options import *

View File

@ -53,6 +53,7 @@ class TestWindow(wx.ScrolledWindow):
# Event handlers - moved here so events won't fire before init is
# finished.
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)

View File

@ -72,7 +72,7 @@ class TestPanel(wx.Panel):
sizer.Add(message0, 0, wx.ALIGN_CENTER | wx.ALL, 6)
sizer.Add(title2, 0, wx.ALIGN_CENTER | wx.LEFT | wx.TOP | wx.RIGHT, 16)
sizer.Add(message1, 0, wx.ALIGN_CENTER | wx.ALL, 6)
sizer.Add(buttonPanel, 0, wx.EXPAND | wx.LEFT | wx.BOTTOM | wx.RIGHT, 16)
sizer.Add(buttonPanel, 0, wx.EXPAND | wx.ALL, 16)
sizer.Add(title3, 0, wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT, 16)
sizer.Add(message2, 0, wx.ALIGN_CENTER | wx.ALL, 6)
sizer.Add(targetPanel, 2, wx.EXPAND | wx.LEFT | wx.BOTTOM | wx.RIGHT, 16)
@ -144,6 +144,7 @@ class InnerTile(wx.Window):
"""
def __init__(self, parent, log, factor, thingToWatch=None, bgColor=None):
wx.Window.__init__(self, parent, -1)
self.SetMinSize((20,20))
self.log=log
if bgColor:
self.SetBackgroundColour(bgColor)

View File

@ -79,7 +79,7 @@ class TestPanel(wx.Panel):
def OnRightClick(self, evt):
self.PopupMenu(self.menu, evt.GetPosition())
self.PopupMenu(self.menu)
def OnFileOpenDialog(self, evt):

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
import wx
from wx.lib import stattext
#---------------------------------------------------------------------------
@ -11,7 +12,8 @@ class TestPanel(wx.Panel):
btn = wx.Button(self, -1, "Select Font")
self.Bind(wx.EVT_BUTTON, self.OnSelectFont, btn)
self.sampleText = wx.TextCtrl(self, -1, "Sample Text")
self.sampleText = stattext.GenStaticText(self, -1, "Sample Text")
self.sampleText.SetBackgroundColour(wx.WHITE)
self.curFont = self.sampleText.GetFont()
self.curClr = wx.BLACK
@ -69,6 +71,7 @@ class TestPanel(wx.Panel):
def UpdateUI(self):
self.sampleText.SetFont(self.curFont)
self.sampleText.SetForegroundColour(self.curClr)
self.ps.SetLabel(str(self.curFont.GetPointSize()))
self.family.SetLabel(self.curFont.GetFamilyString())
self.style.SetLabel(self.curFont.GetStyleString())

View File

@ -0,0 +1,130 @@
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(sizer)
sizer.Add((25,25))
sizer.Add(wx.StaticText(
self, -1,
"Mouse and modifier state can be polled with wx.GetMouseState"),
0, wx.CENTER|wx.ALL, 10)
sizer.Add(wx.StaticLine(self), 0, wx.EXPAND|wx.TOP, 10)
row = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(row, 0, wx.CENTER)
fgs = wx.FlexGridSizer(cols=2, hgap=5, vgap=10)
row.Add(fgs, 0, wx.ALL, 30)
lbl = wx.StaticText(self, -1, "X pos:")
self.x = wx.StaticText(self, -1, "00000")
fgs.Add(lbl)
fgs.Add(self.x)
lbl = wx.StaticText(self, -1, "Y pos:")
self.y = wx.StaticText(self, -1, "00000")
fgs.Add(lbl)
fgs.Add(self.y)
lbl = wx.StaticText(self, -1, "Left down:")
self.lft = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.lft)
lbl = wx.StaticText(self, -1, "Middle Down:")
self.mid = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.mid)
lbl = wx.StaticText(self, -1, "Right down:")
self.rgt = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.rgt)
fgs = wx.FlexGridSizer(cols=2, hgap=5, vgap=10)
row.Add(fgs, 0, wx.ALL, 30)
lbl = wx.StaticText(self, -1, "Control down:")
self.ctrl = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.ctrl)
lbl = wx.StaticText(self, -1, "Shift down:")
self.shft = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.shft)
lbl = wx.StaticText(self, -1, "Alt down:")
self.alt = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.alt)
lbl = wx.StaticText(self, -1, "Meta down:")
self.meta = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.meta)
lbl = wx.StaticText(self, -1, "Cmd down:")
self.cmd = wx.StaticText(self, -1, "False")
fgs.Add(lbl)
fgs.Add(self.cmd)
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)
self.timer.Start(100)
def OnTimer(self, evt):
ms = wx.GetMouseState()
self.x.SetLabel( str(ms.x) )
self.y.SetLabel( str(ms.y) )
self.lft.SetLabel( str(ms.leftDown) )
self.mid.SetLabel( str(ms.middleDown) )
self.rgt.SetLabel( str(ms.rightDown) )
self.ctrl.SetLabel( str(ms.controlDown) )
self.shft.SetLabel( str(ms.shiftDown) )
self.alt.SetLabel( str(ms.altDown) )
self.meta.SetLabel( str(ms.metaDown) )
self.cmd.SetLabel( str(ms.cmdDown) )
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """<html><body>
<h2><center>wx.GetMouseState</center></h2>
The mouse and modifier state can be polled with the wx.GetMouseState
function. It returns an instance of a wx.MouseState object that
contains the current position of the mouse pointer in screen
coordinants, as well as boolean values indicating the up/down status
of the mouse buttons and the modifier keys.
</body></html>
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])

View File

@ -354,7 +354,7 @@ class MegaGrid(Grid.Grid):
self.Bind(wx.EVT_MENU, append, id=appendID)
self.Bind(wx.EVT_MENU, delete, id=deleteID)
self.PopupMenu(menu, (x, yo))
self.PopupMenu(menu)
menu.Destroy()
return
@ -388,7 +388,7 @@ class MegaGrid(Grid.Grid):
if len(cols) == 1:
self.Bind(wx.EVT_MENU, sort, id=sortID)
self.PopupMenu(menu, (xo, 0))
self.PopupMenu(menu)
menu.Destroy()
return

View File

@ -95,7 +95,7 @@ class TestPanel(wx.Panel):
ID_MENU_NO = wx.NewId()
menuPopUp.Append(ID_MENU_YES, "Yes, absolutely!")
menuPopUp.Append(ID_MENU_NO, "I've had better")
self.PopupMenu(menuPopUp, self._hyper3.GetPosition())
self.PopupMenu(menuPopUp)
menuPopUp.Destroy()

View File

@ -75,8 +75,8 @@ class TestListBox(wx.Panel):
'twelve', 'thirteen', 'fourteen']
wx.StaticText(self, -1, "This example uses the wx.ListBox control.", (45, 10))
wx.StaticText(self, -1, "Select one:", (15, 50), (65, 18))
self.lb1 = wx.ListBox(self, 60, (80, 50), (90, 120), sampleList, wx.LB_SINGLE)
wx.StaticText(self, -1, "Select one:", (15, 50))
self.lb1 = wx.ListBox(self, 60, (100, 50), (90, 120), sampleList, wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.lb1)
self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, self.lb1)
self.lb1.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton)
@ -85,8 +85,8 @@ class TestListBox(wx.Panel):
self.lb1.SetClientData(2, "This one has data");
wx.StaticText(self, -1, "Select many:", (200, 50), (65, 18))
self.lb2 = wx.ListBox(self, 70, (300, 50), (90, 120), sampleList, wx.LB_EXTENDED)
wx.StaticText(self, -1, "Select many:", (220, 50))
self.lb2 = wx.ListBox(self, 70, (320, 50), (90, 120), sampleList, wx.LB_EXTENDED)
self.Bind(wx.EVT_LISTBOX, self.EvtMultiListBox, self.lb2)
self.lb2.Bind(wx.EVT_RIGHT_UP, self.EvtRightButton)
self.lb2.SetSelection(0)
@ -96,7 +96,7 @@ class TestListBox(wx.Panel):
'test abcd' ]
sampleList.sort()
wx.StaticText(self, -1, "Find Prefix:", (15, 250))
fp = FindPrefixListBox(self, -1, (80, 250), (90, 120), sampleList, wx.LB_SINGLE)
fp = FindPrefixListBox(self, -1, (100, 250), (90, 120), sampleList, wx.LB_SINGLE)
fp.SetSelection(0)

View File

@ -200,10 +200,10 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
def OnRightDown(self, event):
self.x = event.GetX()
self.y = event.GetY()
self.log.WriteText("x, y = %s\n" % str((self.x, self.y)))
item, flags = self.list.HitTest((self.x, self.y))
x = event.GetX()
y = event.GetY()
self.log.WriteText("x, y = %s\n" % str((x, y)))
item, flags = self.list.HitTest((x, y))
if flags & wx.LIST_HITTEST_ONITEM:
self.list.Select(item)
@ -313,7 +313,7 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
# Popup the menu. If an item is selected then its handler
# will be called before PopupMenu returns.
self.PopupMenu(menu, (self.x, self.y))
self.PopupMenu(menu)
menu.Destroy()

View File

@ -28,12 +28,22 @@ class TestPanel(wx.Panel):
# some problems related to having regular frames and MDI frames in
# the same app.
def ShowMDIDemo(self, evt):
os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDIDemo.py")
exe, spawn = self.GetPyExecutable()
spawn(os.P_NOWAIT, exe, exe, "MDIDemo.py")
def ShowMDISashDemo(self, evt):
os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDISashDemo.py")
exe, spawn = self.GetPyExecutable()
spawn(os.P_NOWAIT, exe, exe, "MDISashDemo.py")
def GetPyExecutable(self):
if 'wxMac' in wx.PlatformInfo:
# sys.executable will be wrong if running the demo from
# an app bundle. Just find pythonw on the path instead.
return 'pythonw' + sys.version[:3], os.spawnlp
else:
return sys.executable, os.spawnl
#----------------------------------------------------------------------
def runTest(frame, nb, log):

View File

@ -52,6 +52,7 @@ _treeList = [
'HyperLinkCtrl',
'MultiSplitterWindow',
'Throbber',
'GetMouseState',
]),
# managed windows == things with a (optional) caption you can close
@ -82,7 +83,6 @@ _treeList = [
# dialogs from libraries
('More Dialogs', [
'ImageBrowser',
'MultipleChoiceDialog',
'ScrolledMessageDialog',
]),

View File

@ -3,8 +3,6 @@ import wx
import wx.media
import os
from Main import opj
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
@ -34,6 +32,7 @@ class TestPanel(wx.Panel):
slider = wx.Slider(self, -1, 0, 0, 0)
self.slider = slider
slider.SetMinSize((150, -1))
self.Bind(wx.EVT_SLIDER, self.OnSeek, slider)
self.st_size = wx.StaticText(self, -1, size=(100,-1))
@ -54,7 +53,7 @@ class TestPanel(wx.Panel):
sizer.Add(self.st_pos, (3, 5))
self.SetSizer(sizer)
self.DoLoadFile(opj("data/testmovie.mpg"))
self.DoLoadFile(os.path.abspath("data/testmovie.mpg"))
self.mc.Stop()
self.timer = wx.Timer(self)
@ -81,8 +80,8 @@ class TestPanel(wx.Panel):
else:
self.mc.SetBestFittingSize()
self.GetSizer().Layout()
self.slider.SetRange(0, self.mc.Length())
self.mc.Play()
self.slider.SetRange(0, self.mc.Length())
def OnPlay(self, evt):

View File

@ -97,7 +97,7 @@ class TestPanel(wx.Panel):
# Popup the menu. If an item is selected then its handler
# will be called before PopupMenu returns.
self.PopupMenu(menu, event.GetPosition())
self.PopupMenu(menu)
menu.Destroy()

View File

@ -36,6 +36,8 @@ class TestToolBar(wx.Frame):
open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, tsize)
copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR, tsize)
paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR, tsize)
tb.SetToolBitmapSize(tsize)
tb.AddSimpleTool(10, new_bmp, "New", "Long help for 'New'")
#tb.AddLabelTool(10, "New", new_bmp, shortHelp="New", longHelp="Long help for 'New'")

File diff suppressed because it is too large Load Diff

View File

@ -361,7 +361,8 @@ LicenseFile = licence\licence.txt
Source: "demo\demo.py"; DestDir: "{app}\demo"; DestName: "demo.pyw";
Source: "demo\*.py"; DestDir: "{app}\demo";
Source: "demo\*.xml"; DestDir: "{app}\demo";
Source: "demo\*.txt"; DestDir: "{app}\demo";
Source: "demo\*.txt"; DestDir: "{app}\demo";
Source: "demo\*.ico"; DestDir: "{app}\demo";
Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\demo\bitmaps";
Source: "demo\bitmaps\*.gif"; DestDir: "{app}\demo\bitmaps";

View File

@ -58,13 +58,30 @@
# Used to set the Release tag below. I normally use it to define what
# distro the RPM was build on and also include the version of Python
# distro the RPM was built on and also include the version of Python
# it was built with.
%if %{?release:0}%{!?release:1}
%define release 1_py%{pyver}
%endif
# This one is used to control whether the full 4 components of the
# verseion number are used in the site-packages subdirectory name. By
# default only 2 or 3 components (depending on stable/unstable status)
# are used.
%if %{?fullver:0}%{!?fullver:1}
%define fullver 0
%endif
# Whether to add --enable-mediactrl to the wxWidgets configure. For
# some older versions of gstreamer-0.8 it currently incorerctly allows
# its use eventhough there is a compatibility problem that causes a
# failed compile.
%if %{?mediactrl:0}%{!?mediactrl:1}
%define mediactrl 0
%endif
#----------------------------------------------------------------------
# Other variables used below
@ -195,6 +212,9 @@ cd bld
--enable-geometry \
--enable-optimise \
--enable-sound --with-sdl \
%if %{mediactrl}
--enable-mediactrl \
%endif
--enable-display \
%if %{unicode}
--enable-unicode \
@ -226,6 +246,7 @@ cd $WXDIR/wxPython
WXPORT=%{port} \
UNICODE=%{unicode} \
EP_ADD_OPTS=1 \
EP_FULL_VER=%{fullver} \
NO_SCRIPTS=1 \
WX_CONFIG="$WXDIR/bld/wx-config --no_rpath" \
build_ext --rpath=%{wxpref}/lib \
@ -253,6 +274,7 @@ cd $WXDIR/wxPython
WXPORT=%{port} \
UNICODE=%{unicode} \
EP_ADD_OPTS=1 \
EP_FULL_VER=%{fullver} \
NO_SCRIPTS=1 \
WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref} --no_rpath" \
build_ext --rpath=%{wxpref}/lib \

View File

@ -78,6 +78,7 @@ cd bld
--enable-debug \
--enable-geometry \
--enable-sound --with-sdl \
--enable-mediactrl \
--enable-display \
--disable-debugreport \
</pre>

View File

@ -81,6 +81,7 @@ place, then do the same for wxPython.
--enable-debug \
--enable-geometry \
--enable-sound --with-sdl \
--enable-mediactrl \
--enable-display \
--disable-debugreport \

View File

@ -11,7 +11,174 @@
<div class="document" id="recent-changes-for-wxpython">
<h1 class="title">Recent Changes for wxPython</h1>
<div class="section" id="id1">
<h1><a name="id1">2.6.1.0</a></h1>
<h1><a name="id1">2.6.2.1</a></h1>
<p>wxMSW: Fix for bug #1211907, popup menu indenting inconsistent with
bitmaps.</p>
<p>wxMac: Don't send an event for wx.RadioButton deselections, just the
selections. This was done to make it consistent with the other
platforms.</p>
<p>wxMSW: Always set flat toolbar style, even under XP with themes: this
is necessary or separators aren't shown at all.</p>
<p>Fixes for bug #1217872, pydocview.DocService not correctly initialized.</p>
<p>Fix for bug #1217874, Error in parameter name in DocManager.CreateView.</p>
<p>Added wrappers for the wx.RendererNative class.</p>
<p>Added the wx.lib.splitter module, which contains the
MultiSplitterWindow class. This class is much like the standard
wx.SplitterWindow class, except it allows more than one split, so it
can manage more than two child windows.</p>
<p>Docview and IDE patch from Morgan Hua with fix for bug #1217890
&quot;Closing view crashes Python&quot; plus some new features:</p>
<pre class="literal-block">
New feature added to the IDE is 'Extensions'. Under
Tools|Options|Extensions, you can add calls to external programs.
For example you can add a &quot;Notepad&quot; extension (under windows) that
will exec Notepad on the currently open file. A new &quot;Notepad&quot;
menu item will appear under the Tools menu.
</pre>
<p>Some fixes to XRCed to make encoding errors a bit more user friendly.</p>
<p>XRCed changes from Roman Rolinsky:</p>
<blockquote>
<ul class="simple">
<li>Added new controls (Choicebook, Listbook, StatusBar,
DatePicker), and completed style flags. Test window is opened
for an available parent control if no specific view
defined. Better handling of exceptions (highlighting does not
'stick' anymore).</li>
<li>Use system clipboard for Copy/Paste.</li>
<li>Improved some dialogs (window styles, growable cols). Changed
the range for wxSpinCtrl min/max to all integers (default 0/100
is not always good).</li>
</ul>
</blockquote>
<p>Updates for wx.lib.foldpanelbar and wx.lib.hyperlink from Andrea
Gavana.</p>
<p>Fix for Bug #1283496: wxPython TheClipboard class causes problems for
pychecker. Ensure the app has been created before initializing
wx.TheClipboard.</p>
<p>Fix for Bug #1352602: FileBrowseButtonWithHistory can't type in Value.</p>
<p>wxHTML: Added space after list item number.</p>
<p>wx.lib.printout: Applied patch #1384440.</p>
<p>wxMSW: Fix for Bug #1293225 Window_FromHWND crashes if parent is
None.</p>
<p>Fix for Bug #1261669, use a wx.TE_RICH2 style for the Process demo so
it doesn't fill up too soon.</p>
<p>Applied Patch #1354389: wxPython MenuItem SetBitmaps fix.</p>
<p>Applied Patch #1239456: wxPython wx.DataObject.GetAllFormats fix.</p>
<p>Applied Patch # #1230107 which allows image handlers to be written in
Python by deriving from wx.PyImageHandler.</p>
<p>Applied patch #1072210: generalize printout.py to allow text printing.</p>
<p>Applied patch #1243907: Give Throbber much more flexibility by
allowing the user to set the rest image, the direction, the current
index, custom sequence. Allows user to manually step through the
sequence with Next(), Previous(), Increment(), Decrement() &amp;
SetCurrent(). Very handy if you have multiple throbbers that you want
to synchronize with a single timer.</p>
<p>Fix for bug #1336711: wx.lib.calendar.CalenDlg can yield incorrect
result.</p>
<p>Applied patch from Morgan Hua for updates to ActiveGrid code
(pydocview, ActiveGrid IDE, etc.)</p>
<p>Applied patch #1326241: Supporting &quot;setup.py install --install-headers=path&quot;</p>
<p>Applied patch from Morgan Hua to fix bug #1219423: CommandManager
should not repeat old commands after a branch.</p>
<p>Applied patch #1238825 adding search backward capabilities to the
demo. Modified to use the up/down options in the wx.FindReplaceDialog
instead of a separate menu item.</p>
<p>Fix for bug #1266745 and #1387725 in the wx.FindReplaceDialog on MSW.
Actually check we are using MSLU before doing the hack designed to
workaround a bug in MSLU!</p>
<p>wxMSW: wx.lib.iewin.IEHtmlWindow now properly handles tabbing, return
and other special keys properly.</p>
<p>Lots of PyCrust enhancments started by Franz Steinaeusler, Adi Sieker,
and Sebastian Haase, and which in turn were further enhanced, fixed
tweaked and finished up by me. The changes include the following:</p>
<blockquote>
<ul class="simple">
<li>The Autocomplete and Calltip windows can now be opened manually
with Ctrl-Space and Ctrl-Shift-Space.</li>
<li>In the stand alone PyCrust app the various option settings,
window size and position, and etc. are saved and restored at the
next run.</li>
<li>Added a help dialog bound to the F1 key that shows the key
bindings.</li>
<li>Added a new text completion function that suggests words from
the history. Bound to Shift-Return.</li>
<li>F11 will toggle the maximized state of the frame.</li>
<li>switched to Bind() from wx.EVT_*().</li>
<li>Display of line numbers can be toggled.</li>
<li>F12 toggles a &quot;free edit&quot; mode of the shell buffer. This mode
is 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 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>General code cleanup and fixes.</li>
<li>Use wx.StandardPaths to determine the location of the config
files.</li>
<li>Use wx.SP_LIVE_UPDATE on crust and filling windows.</li>
<li>Extended the saving of the config info and other new features to
the PyShell app too. Additionally, other apps that embed a
PyCrust or a PyShell can pass their own wx.Config object and
have the Py code save/restore its settings to/from there.</li>
<li>All of the classes with config info get an opportunity to
save/load their own settings instead of putting all the
save/load code in one place that then has to reach all over the
place to do anything.</li>
<li>Enable editing of the startup python code, which will either be
the file pointed to by PYTHONSTARTUP or a file in the config dir
if PYTHONSTARTUP is not set in the environment.</li>
<li>Added an option to skip the running of the startup code when
PyShell or PyCrust starts.</li>
<li>PyCrust adds a pp(item) function to the shell's namespace that
pretty prints the item in the Display tab of the notebook.
Added code to raise that tab when pp() is called.</li>
<li>Added an option for whether to insert text for function
parameters when popping up the call tip.</li>
<li>Added Find and Find-Next functions that use the
wx.FindReplaceDialog.</li>
</ul>
</blockquote>
<p>Applied patches from Will Sadkin for wx.lib.masked modules:</p>
<blockquote>
<ul class="simple">
<li>Now ignores kill focus events when being destroyed.</li>
<li>Added missing call to set insertion point on changing fields.</li>
<li>Modified SetKeyHandler() to accept None as means of removing
one.</li>
<li>Fixed keyhandler processing for group and decimal character
changes.</li>
<li>Fixed a problem that prevented input into the integer digit of a
integerwidth=1 numctrl, if the current value was 0.</li>
<li>Fixed logic involving processing of &quot;_signOk&quot; flag, to remove
default sign key handlers if false, so that
SetAllowNegative(False) in the NumCtrl works properly.</li>
<li>Fixed selection logic for numeric controls so that if
selectOnFieldEntry is true, and the integer portion of an
integer format control is selected and the sign position is
selected, the sign keys will always result in a negative value,
rather than toggling the previous sign.</li>
</ul>
</blockquote>
<p>wx.FontMapper.SetConfig is deprecated. You should instead just set an
application-wide config object with wx.Config.Set, which wx.FontMapper
will use by default.</p>
<p>Added wx.GetMouseState which returns the current state of the mouse.
It returns an instance of a wx.MouseState object that contains the
current position of the mouse pointer in screen coordinants, as well
as boolean values indicating the up/down status of the mouse buttons
and the modifier keys.</p>
<p>Added wx.SizerItem.SetUserData</p>
<p>A variety of updates to wx.lib.floatcanvas, including Added
DrawObjects, including a ScaledTextBox, with auto-wrapping, etc, and
Scaled and Unscaled Bitmap Objects.</p>
<blockquote>
WARNING: Changed all DrawObjects to take an (x,y) pair rather
than individual x,y parameters. Also changed rectangles and
ellipses to take (w,h) pair. This is an API change, but should
be easy to accommodate, all you need to do is add a parenthesis
pair: (...x, y, ...) ---&gt; (...(x,y), ...)</blockquote>
</div>
<div class="section" id="id2">
<h1><a name="id2">2.6.1.0</a></h1>
<ul class="simple">
<li>4-June-2005</li>
</ul>
@ -38,8 +205,8 @@ calls.</p>
<p>wx.FileConfig: fixed DeleteEntry to set the dirty flag properly so the
change will get written at the next flush.</p>
</div>
<div class="section" id="id2">
<h1><a name="id2">2.6.0.1</a></h1>
<div class="section" id="id3">
<h1><a name="id3">2.6.0.1</a></h1>
<ul class="simple">
<li>30-May-2005</li>
</ul>
@ -151,8 +318,8 @@ usual.</p>
there is a range of allowed values (so a wx.SpinCtrl is used instead
of a wx.TextCtrl.)</p>
</div>
<div class="section" id="id3">
<h1><a name="id3">2.6.0.0</a></h1>
<div class="section" id="id4">
<h1><a name="id4">2.6.0.0</a></h1>
<ul class="simple">
<li>26-Apr-2005</li>
</ul>
@ -229,8 +396,8 @@ EVT_KEY_UP and EVT_TEXT events from its embedded text control.</p>
</dd>
</dl>
</div>
<div class="section" id="id4">
<h1><a name="id4">2.5.5.1</a></h1>
<div class="section" id="id5">
<h1><a name="id5">2.5.5.1</a></h1>
<ul class="simple">
<li>8-Apr-2005</li>
</ul>
@ -298,8 +465,8 @@ list of top-level windows that currently exist in the application.</p>
folks.</p>
<p>Added the ActiveGrid IDE as a sample application.</p>
</div>
<div class="section" id="id5">
<h1><a name="id5">2.5.4.1</a></h1>
<div class="section" id="id6">
<h1><a name="id6">2.5.4.1</a></h1>
<ul class="simple">
<li>16-Mar-2005</li>
</ul>
@ -532,8 +699,8 @@ wx.Image.</p>
</dd>
</dl>
</div>
<div class="section" id="id6">
<h1><a name="id6">2.5.3.1</a></h1>
<div class="section" id="id7">
<h1><a name="id7">2.5.3.1</a></h1>
<ul class="simple">
<li>9-Nov-2004</li>
</ul>
@ -689,8 +856,8 @@ it.</p>
<p>wxPython on OSX can now be built in Unicode mode, can support multiple
version installs, and comes with an uninstaller script.</p>
</div>
<div class="section" id="id7">
<h1><a name="id7">2.5.2.8</a></h1>
<div class="section" id="id8">
<h1><a name="id8">2.5.2.8</a></h1>
<ul class="simple">
<li>27-Aug-2004</li>
</ul>
@ -721,8 +888,8 @@ wxCheckListBox.</li>
</ul>
</blockquote>
</div>
<div class="section" id="id8">
<h1><a name="id8">2.5.2.7</a></h1>
<div class="section" id="id9">
<h1><a name="id9">2.5.2.7</a></h1>
<ul class="simple">
<li>14-Aug-2004</li>
</ul>
@ -905,8 +1072,8 @@ migrating away from using activexwrapper as well. Please see the
MigrationGuide for more details on using the new module.</p>
<p>Floats are allowed again as function parameters where ints are expected.</p>
</div>
<div class="section" id="id10">
<h1><a name="id10">2.4.2.4</a></h1>
<div class="section" id="id11">
<h1><a name="id11">2.4.2.4</a></h1>
<ul class="simple">
<li>1-Oct-2003</li>
</ul>
@ -918,8 +1085,8 @@ demonstrated in the Threads sample in the demo.</p>
<p>Added wxMaskedNumCtrl.</p>
<p>Added Chris Barker's FloatCanvas.</p>
</div>
<div class="section" id="id11">
<h1><a name="id11">2.4.1.2</a></h1>
<div class="section" id="id12">
<h1><a name="id12">2.4.1.2</a></h1>
<ul class="simple">
<li>19-Jun-2003</li>
</ul>
@ -973,8 +1140,8 @@ release,) SetItemMinSize can now take a wxSize (or 2-tuple) parameter,
and Spacers can be specified with a wxSize (or 2-tuple) parameter</p>
<p>Added wxCursorFromBits.</p>
</div>
<div class="section" id="id12">
<h1><a name="id12">2.4.0.7</a></h1>
<div class="section" id="id13">
<h1><a name="id13">2.4.0.7</a></h1>
<ul class="simple">
<li>24-Mar-2003</li>
</ul>
@ -1013,8 +1180,8 @@ think I am testing in the future...</p>
<p>Updated pycolourchooser.</p>
<p>Updated to 0.9b of PyCrust.</p>
</div>
<div class="section" id="id13">
<h1><a name="id13">2.4.0.4</a></h1>
<div class="section" id="id14">
<h1><a name="id14">2.4.0.4</a></h1>
<ul class="simple">
<li>7-Mar-2003</li>
</ul>
@ -1074,8 +1241,8 @@ doesn't have a standard place for them.</p>
<p>Fixed typemaps for wxGridCellCoordsArray.</p>
<p>Updated to the 0.9a version of PyCrust</p>
</div>
<div class="section" id="id14">
<h1><a name="id14">2.4.0.2</a></h1>
<div class="section" id="id15">
<h1><a name="id15">2.4.0.2</a></h1>
<ul class="simple">
<li>23-Jan-2003</li>
</ul>
@ -1083,8 +1250,8 @@ doesn't have a standard place for them.</p>
<p>Added wxIntCtrl from Will Sadkin.</p>
<p>Added wxPyColourChooser by Michael Gilfix.</p>
</div>
<div class="section" id="id15">
<h1><a name="id15">2.4.0.1</a></h1>
<div class="section" id="id16">
<h1><a name="id16">2.4.0.1</a></h1>
<ul class="simple">
<li>10-Jan-2003</li>
</ul>
@ -1093,15 +1260,15 @@ enhancements.</p>
<p>Added function wrappers for the common dialogs from Kevin Altis. See
wxPython/lib/dialogs.py for more details.</p>
</div>
<div class="section" id="id16">
<h1><a name="id16">2.3.4.2</a></h1>
<div class="section" id="id17">
<h1><a name="id17">2.3.4.2</a></h1>
<ul class="simple">
<li>21-Dec-2002</li>
</ul>
<p>Various bug fixes.</p>
</div>
<div class="section" id="id17">
<h1><a name="id17">2.3.4.1</a></h1>
<div class="section" id="id18">
<h1><a name="id18">2.3.4.1</a></h1>
<ul class="simple">
<li>18-Dec-2002</li>
</ul>
@ -1158,8 +1325,8 @@ windows when desired.</p>
HTMLHelp viewer does. Changed how the wxPythonDocs tarball is built
and added a script to launch the doc viewer.</p>
</div>
<div class="section" id="id18">
<h1><a name="id18">2.3.3.1</a></h1>
<div class="section" id="id19">
<h1><a name="id19">2.3.3.1</a></h1>
<ul class="simple">
<li>19-Sep-2002</li>
</ul>
@ -1304,8 +1471,8 @@ example.</p>
<p>Added wxPython.lib.mixins.rubberband module from Robb Shecter.</p>
<p>Added wxTimeCtrl from Will Sadkin.</p>
</div>
<div class="section" id="id19">
<h1><a name="id19">2.3.2.1</a></h1>
<div class="section" id="id20">
<h1><a name="id20">2.3.2.1</a></h1>
<ul class="simple">
<li>20-Dec-2001</li>
</ul>
@ -1314,8 +1481,8 @@ well as the Python thread state. This time it works on SMP machines
without barfing and is also still compatible with Python debuggers.</p>
<p>Added some patches from library contributors.</p>
</div>
<div class="section" id="id20">
<h1><a name="id20">2.3.2</a></h1>
<div class="section" id="id21">
<h1><a name="id21">2.3.2</a></h1>
<ul class="simple">
<li>11-Dec-2001</li>
</ul>
@ -1400,8 +1567,8 @@ SendCommand method, but it is still quite powerful. See
wxPython/contrib/dllwidget and wxPython/demo/dllwidget for more
details.</p>
</div>
<div class="section" id="id21">
<h1><a name="id21">2.3.1</a></h1>
<div class="section" id="id22">
<h1><a name="id22">2.3.1</a></h1>
<ul class="simple">
<li>10-Jul-2001</li>
</ul>
@ -1417,8 +1584,8 @@ subclass wxXmlResourceHandler, etc...</p>
<p>Fixed img2py to work correctly with Python 2.1.</p>
<p>Added enhanced wxVTKRenderWindow by Prabhu Ramachandran</p>
</div>
<div class="section" id="id22">
<h1><a name="id22">2.3.0</a></h1>
<div class="section" id="id23">
<h1><a name="id23">2.3.0</a></h1>
<ul class="simple">
<li>22-May-2001</li>
</ul>
@ -1517,16 +1684,16 @@ please send it to me for inclusion in this package.</p>
by having smaller functional apps to play with. They can be found in
wxPython/samples.</p>
</div>
<div class="section" id="id23">
<h1><a name="id23">2.2.7</a></h1>
<div class="section" id="id24">
<h1><a name="id24">2.2.7</a></h1>
<ul class="simple">
<li>19-Jun-2001</li>
</ul>
<p>No changes happened in the Python wrappers for this release, only
changes and fixes in the wxWindows library.</p>
</div>
<div class="section" id="id24">
<h1><a name="id24">2.2.5</a></h1>
<div class="section" id="id25">
<h1><a name="id25">2.2.5</a></h1>
<ul class="simple">
<li>30-Jan-2001</li>
</ul>

View File

@ -225,6 +225,23 @@ wx.FontMapper.SetConfig is deprecated. You should instead just set an
application-wide config object with wx.Config.Set, which wx.FontMapper
will use by default.
Added wx.GetMouseState which returns the current state of the mouse.
It returns an instance of a wx.MouseState object that contains the
current position of the mouse pointer in screen coordinants, as well
as boolean values indicating the up/down status of the mouse buttons
and the modifier keys.
Added wx.SizerItem.SetUserData
A variety of updates to wx.lib.floatcanvas, including Added
DrawObjects, including a ScaledTextBox, with auto-wrapping, etc, and
Scaled and Unscaled Bitmap Objects.
WARNING: Changed all DrawObjects to take an (x,y) pair rather
than individual x,y parameters. Also changed rectangles and
ellipses to take (w,h) pair. This is an API change, but should
be easy to accommodate, all you need to do is add a parenthesis
pair: (...x, y, ...) ---> (...(x,y), ...)

View File

@ -33,61 +33,62 @@
<div class="contents topic" id="contents">
<p class="topic-title first"><a name="contents">Contents</a></p>
<ul class="simple">
<li><a class="reference" href="#introduction" id="id3" name="id3">Introduction</a></li>
<li><a class="reference" href="#developer-reference" id="id4" name="id4">Developer Reference</a></li>
<li><a class="reference" href="#what-is-py" id="id5" name="id5">What is Py?</a></li>
<li><a class="reference" href="#pycrust-is-dead-long-live-py" id="id6" name="id6">PyCrust is dead! Long live Py!</a></li>
<li><a class="reference" href="#py-standalone-programs" id="id7" name="id7">Py standalone programs</a></li>
<li><a class="reference" href="#pyalacarte" id="id8" name="id8">PyAlaCarte</a></li>
<li><a class="reference" href="#pyalamode" id="id9" name="id9">PyAlaMode</a></li>
<li><a class="reference" href="#pycrust" id="id10" name="id10">PyCrust</a></li>
<li><a class="reference" href="#pyfilling" id="id11" name="id11">PyFilling</a></li>
<li><a class="reference" href="#pyshell" id="id12" name="id12">PyShell</a></li>
<li><a class="reference" href="#pywrap" id="id13" name="id13">PyWrap</a></li>
<li><a class="reference" href="#py-modules" id="id14" name="id14">Py modules</a></li>
<li><a class="reference" href="#projects-using-py" id="id15" name="id15">Projects using Py</a></li>
<li><a class="reference" href="#history-of-changes" id="id16" name="id16">History of changes</a><ul>
<li><a class="reference" href="#to-2004" id="id17" name="id17">0.9.4 (1/25/2004 to //2004)</a></li>
<li><a class="reference" href="#to-1-24-2004" id="id18" name="id18">0.9.3 (9/25/2003 to 1/24/2004)</a></li>
<li><a class="reference" href="#to-9-25-2003" id="id19" name="id19">0.9.2 (5/3/2003 to 9/25/2003)</a></li>
<li><a class="reference" href="#to-5-2-2003" id="id20" name="id20">0.9.1 (3/21/2003 to 5/2/2003)</a></li>
<li><a class="reference" href="#to-3-20-2003" id="id21" name="id21">0.9 (2/27/2003 to 3/20/2003)</a></li>
<li><a class="reference" href="#to-2-26-2003" id="id22" name="id22">0.8.2 (1/5/2003 to 2/26/2003)</a></li>
<li><a class="reference" href="#to-12-25-2002" id="id23" name="id23">0.8.1 (12/20/2002 to 12/25/2002)</a></li>
<li><a class="reference" href="#to-12-16-2002" id="id24" name="id24">0.8 (10/29/2002 to 12/16/2002)</a></li>
<li><a class="reference" href="#to-8-27-2002" id="id25" name="id25">0.7.2 (2/22/2002 to 8/27/2002)</a></li>
<li><a class="reference" href="#to-2-21-2002" id="id26" name="id26">0.7.1 (12/12/2001 to 2/21/2002)</a></li>
<li><a class="reference" href="#to-12-11-2001" id="id27" name="id27">0.7 (10/15/2001 to 12/11/2001)</a></li>
<li><a class="reference" href="#to-10-12-2001" id="id28" name="id28">0.6.1 (9/19/2001 to 10/12/2001)</a></li>
<li><a class="reference" href="#to-9-12-2001" id="id29" name="id29">0.6 (8/21/2001 to 9/12/2001)</a></li>
<li><a class="reference" href="#to-8-20-2001" id="id30" name="id30">0.5.4 (8/17/2001 to 8/20/2001)</a></li>
<li><a class="reference" href="#id1" id="id31" name="id31">0.5.3 (8/16/2001)</a></li>
<li><a class="reference" href="#to-8-15-2001" id="id32" name="id32">0.5.2 (8/14/2001 to 8/15/2001)</a></li>
<li><a class="reference" href="#to-8-14-2001" id="id33" name="id33">0.5.1 (8/10/2001 to 8/14/2001)</a></li>
<li><a class="reference" href="#id2" id="id34" name="id34">0.5 (8/8/2001)</a></li>
<li><a class="reference" href="#to-8-7-2001" id="id35" name="id35">0.4 (8/4/2001 to 8/7/2001)</a></li>
<li><a class="reference" href="#to-8-3-2001" id="id36" name="id36">0.3 (8/2/2001 to 8/3/2001)</a></li>
<li><a class="reference" href="#to-8-2-2001" id="id37" name="id37">0.2 (7/30/2001 to 8/2/2001)</a></li>
<li><a class="reference" href="#to-7-19-2001" id="id38" name="id38">0.1 (7/1/2001 to 7/19/2001)</a></li>
<li><a class="reference" href="#in-the-beginning-there-was-pie-7-1-2001" id="id39" name="id39">In the beginning, there was pie... (7/1/2001)</a></li>
<li><a class="reference" href="#introduction" id="id4" name="id4">Introduction</a></li>
<li><a class="reference" href="#developer-reference" id="id5" name="id5">Developer Reference</a></li>
<li><a class="reference" href="#what-is-py" id="id6" name="id6">What is Py?</a></li>
<li><a class="reference" href="#pycrust-is-dead-long-live-py" id="id7" name="id7">PyCrust is dead! Long live Py!</a></li>
<li><a class="reference" href="#py-standalone-programs" id="id8" name="id8">Py standalone programs</a></li>
<li><a class="reference" href="#pyalacarte" id="id9" name="id9">PyAlaCarte</a></li>
<li><a class="reference" href="#pyalamode" id="id10" name="id10">PyAlaMode</a></li>
<li><a class="reference" href="#pycrust" id="id11" name="id11">PyCrust</a></li>
<li><a class="reference" href="#pyfilling" id="id12" name="id12">PyFilling</a></li>
<li><a class="reference" href="#pyshell" id="id13" name="id13">PyShell</a></li>
<li><a class="reference" href="#pywrap" id="id14" name="id14">PyWrap</a></li>
<li><a class="reference" href="#py-modules" id="id15" name="id15">Py modules</a></li>
<li><a class="reference" href="#projects-using-py" id="id16" name="id16">Projects using Py</a></li>
<li><a class="reference" href="#history-of-changes" id="id17" name="id17">History of changes</a><ul>
<li><a class="reference" href="#id1" id="id18" name="id18">0.9.5 (12/23/2005)</a></li>
<li><a class="reference" href="#to-2004" id="id19" name="id19">0.9.4 (1/25/2004 to //2004)</a></li>
<li><a class="reference" href="#to-1-24-2004" id="id20" name="id20">0.9.3 (9/25/2003 to 1/24/2004)</a></li>
<li><a class="reference" href="#to-9-25-2003" id="id21" name="id21">0.9.2 (5/3/2003 to 9/25/2003)</a></li>
<li><a class="reference" href="#to-5-2-2003" id="id22" name="id22">0.9.1 (3/21/2003 to 5/2/2003)</a></li>
<li><a class="reference" href="#to-3-20-2003" id="id23" name="id23">0.9 (2/27/2003 to 3/20/2003)</a></li>
<li><a class="reference" href="#to-2-26-2003" id="id24" name="id24">0.8.2 (1/5/2003 to 2/26/2003)</a></li>
<li><a class="reference" href="#to-12-25-2002" id="id25" name="id25">0.8.1 (12/20/2002 to 12/25/2002)</a></li>
<li><a class="reference" href="#to-12-16-2002" id="id26" name="id26">0.8 (10/29/2002 to 12/16/2002)</a></li>
<li><a class="reference" href="#to-8-27-2002" id="id27" name="id27">0.7.2 (2/22/2002 to 8/27/2002)</a></li>
<li><a class="reference" href="#to-2-21-2002" id="id28" name="id28">0.7.1 (12/12/2001 to 2/21/2002)</a></li>
<li><a class="reference" href="#to-12-11-2001" id="id29" name="id29">0.7 (10/15/2001 to 12/11/2001)</a></li>
<li><a class="reference" href="#to-10-12-2001" id="id30" name="id30">0.6.1 (9/19/2001 to 10/12/2001)</a></li>
<li><a class="reference" href="#to-9-12-2001" id="id31" name="id31">0.6 (8/21/2001 to 9/12/2001)</a></li>
<li><a class="reference" href="#to-8-20-2001" id="id32" name="id32">0.5.4 (8/17/2001 to 8/20/2001)</a></li>
<li><a class="reference" href="#id2" id="id33" name="id33">0.5.3 (8/16/2001)</a></li>
<li><a class="reference" href="#to-8-15-2001" id="id34" name="id34">0.5.2 (8/14/2001 to 8/15/2001)</a></li>
<li><a class="reference" href="#to-8-14-2001" id="id35" name="id35">0.5.1 (8/10/2001 to 8/14/2001)</a></li>
<li><a class="reference" href="#id3" id="id36" name="id36">0.5 (8/8/2001)</a></li>
<li><a class="reference" href="#to-8-7-2001" id="id37" name="id37">0.4 (8/4/2001 to 8/7/2001)</a></li>
<li><a class="reference" href="#to-8-3-2001" id="id38" name="id38">0.3 (8/2/2001 to 8/3/2001)</a></li>
<li><a class="reference" href="#to-8-2-2001" id="id39" name="id39">0.2 (7/30/2001 to 8/2/2001)</a></li>
<li><a class="reference" href="#to-7-19-2001" id="id40" name="id40">0.1 (7/1/2001 to 7/19/2001)</a></li>
<li><a class="reference" href="#in-the-beginning-there-was-pie-7-1-2001" id="id41" name="id41">In the beginning, there was pie... (7/1/2001)</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="introduction">
<h1><a class="toc-backref" href="#id3" name="introduction">Introduction</a></h1>
<h1><a class="toc-backref" href="#id4" name="introduction">Introduction</a></h1>
<p>This document will show you how to use the Py programs and the Py
library of Python source code modules. Py is the new name for the
project that began as PyCrust. Py is officially part of <a class="reference" href="http://www.wxpython.org/">wxPython</a>,
and includes PyCrust, so PyCrust is no longer distributed separately.</p>
</div>
<div class="section" id="developer-reference">
<h1><a class="toc-backref" href="#id4" name="developer-reference">Developer Reference</a></h1>
<h1><a class="toc-backref" href="#id5" name="developer-reference">Developer Reference</a></h1>
<p>Source code documentation for developers is available at:</p>
<p><a class="reference" href="http://www.orbtech.com/www/wx/epydoc/public/wx.py-module.html">http://www.orbtech.com/www/wx/epydoc/public/wx.py-module.html</a></p>
</div>
<div class="section" id="what-is-py">
<h1><a class="toc-backref" href="#id5" name="what-is-py">What is Py?</a></h1>
<h1><a class="toc-backref" href="#id6" name="what-is-py">What is Py?</a></h1>
<p>Besides being <a class="reference" href="http://www.wikipedia.org/wiki/Pie">a delicious dessert</a>, Py is the name for a collection
of whimsically-named Python programs and modules that began as the
PyCrust project. So Py is really several things: a set of standalone
@ -99,7 +100,7 @@ Python and wxPython, so it works equally well on Windows, Linux and
Mac OS X.</p>
</div>
<div class="section" id="pycrust-is-dead-long-live-py">
<h1><a class="toc-backref" href="#id6" name="pycrust-is-dead-long-live-py">PyCrust is dead! Long live Py!</a></h1>
<h1><a class="toc-backref" href="#id7" name="pycrust-is-dead-long-live-py">PyCrust is dead! Long live Py!</a></h1>
<p>This project began with a program I created called PyCrust - an
interactive, graphical Python shell, developed using the wxPython GUI
toolkit. For about two years, PyCrust was hosted on <a class="reference" href="http://www.sf.net/projects/pycrust/">SourceForge</a>.
@ -136,7 +137,7 @@ use during development, or as an interface for users of your programs.
These modules are the same ones used by all the Py programs.</p>
</div>
<div class="section" id="py-standalone-programs">
<h1><a class="toc-backref" href="#id7" name="py-standalone-programs">Py standalone programs</a></h1>
<h1><a class="toc-backref" href="#id8" name="py-standalone-programs">Py standalone programs</a></h1>
<p>These are the standalone applications in the Py collection:</p>
<ul class="simple">
<li>PyAlaCarte</li>
@ -148,7 +149,7 @@ These modules are the same ones used by all the Py programs.</p>
</ul>
</div>
<div class="section" id="pyalacarte">
<h1><a class="toc-backref" href="#id8" name="pyalacarte">PyAlaCarte</a></h1>
<h1><a class="toc-backref" href="#id9" name="pyalacarte">PyAlaCarte</a></h1>
<p>PyAlaCarte is a Python source code editor. It is designed to have a
simple, single-file interface. As a standalone application, it is
good for simple, short editing tasks. But it is really meant to be
@ -156,23 +157,23 @@ more of an example of how to embed the Py editor into a wxPython
application.</p>
</div>
<div class="section" id="pyalamode">
<h1><a class="toc-backref" href="#id9" name="pyalamode">PyAlaMode</a></h1>
<h1><a class="toc-backref" href="#id10" name="pyalamode">PyAlaMode</a></h1>
<p>PyAlaMode is a Python source code editor.</p>
</div>
<div class="section" id="pycrust">
<h1><a class="toc-backref" href="#id10" name="pycrust">PyCrust</a></h1>
<h1><a class="toc-backref" href="#id11" name="pycrust">PyCrust</a></h1>
<p>PyCrust is an interactive, Python shell. But it's more than just a
shell. It includes a tabbed notebook containing a namespace tree
(PyFilling), and several other things.</p>
</div>
<div class="section" id="pyfilling">
<h1><a class="toc-backref" href="#id11" name="pyfilling">PyFilling</a></h1>
<h1><a class="toc-backref" href="#id12" name="pyfilling">PyFilling</a></h1>
<p>PyFilling is a namespace viewer. It isn't really useful as a
standalone program, but it does illustrate how to make use of the
underlying <tt class="docutils literal"><span class="pre">filling</span></tt> module.</p>
</div>
<div class="section" id="pyshell">
<h1><a class="toc-backref" href="#id12" name="pyshell">PyShell</a></h1>
<h1><a class="toc-backref" href="#id13" name="pyshell">PyShell</a></h1>
<p>PyShell is an interactive, Python shell. It shares the same base code
as PyCrust, but doesn't have any of the extra features that appear in
the PyCrust notebook interface.</p>
@ -182,7 +183,7 @@ the PyCrust notebook interface.</p>
</div>
</div>
<div class="section" id="pywrap">
<h1><a class="toc-backref" href="#id13" name="pywrap">PyWrap</a></h1>
<h1><a class="toc-backref" href="#id14" name="pywrap">PyWrap</a></h1>
<p>PyWrap is a runtime utility that lets you run an existing wxPython
program with a PyCrust frame at the same time. Inside the PyCrust
shell namespace, the local variable <tt class="docutils literal"><span class="pre">app</span></tt> is assigned to your
@ -191,7 +192,7 @@ application within the PyCrust shell, as well as the PyFilling
namespace viewer.</p>
</div>
<div class="section" id="py-modules">
<h1><a class="toc-backref" href="#id14" name="py-modules">Py modules</a></h1>
<h1><a class="toc-backref" href="#id15" name="py-modules">Py modules</a></h1>
<p>Py was designed to be modular. That means graphical code is kept
separate from non-graphical code, and many of the Py modules can be
used by other programs. Likewise, other programs can supply some of
@ -202,7 +203,7 @@ required, PyCrust will work just as well with your interpreter as with
its default interpreter.</p>
</div>
<div class="section" id="projects-using-py">
<h1><a class="toc-backref" href="#id15" name="projects-using-py">Projects using Py</a></h1>
<h1><a class="toc-backref" href="#id16" name="projects-using-py">Projects using Py</a></h1>
<ul class="simple">
<li><a class="reference" href="http://conflictsolver.sourceforge.net/">Conflict Solver</a></li>
<li><a class="reference" href="http://www.gnumed.org/">Gnumed</a></li>
@ -215,11 +216,63 @@ its default interpreter.</p>
</ul>
</div>
<div class="section" id="history-of-changes">
<h1><a class="toc-backref" href="#id16" name="history-of-changes">History of changes</a></h1>
<h1><a class="toc-backref" href="#id17" name="history-of-changes">History of changes</a></h1>
<p>This section lists all the changes that have been made to the Py
programs and modules, since the beginning.</p>
<div class="section" id="id1">
<h2><a class="toc-backref" href="#id18" name="id1">0.9.5 (12/23/2005)</a></h2>
<p>Applied a series of enhancments by Franz Steinaeusler, Adi Sieker, and
Sebastian Haase, up until their 7-31-2005 version. (Their next
version broke some existing functionality, and added some confusing
hacks, and I didn't feel that the incremental gains were worth the
loss at that point so I stopped at 7-31-2005.)</p>
<p>Their changes include the following:</p>
<ul class="simple">
<li>The Autocomplete and Calltip windows can now be opened manually with
Ctrl-Space and Ctrl-Shift-Space.</li>
<li>In the stand alone PyCrust app the various option settings, window
size and position, and etc. are saved and restored at the next run.</li>
<li>Added a help dialog bound to the F1 key that shows the key bindings.</li>
<li>Added a new text completion function that suggests words from the
history. Bound to Shift-Return.</li>
<li>F11 will toggle the maximized state of the frame.</li>
<li>switched to Bind() from wx.EVT_*().</li>
<li>Display of line numbers can be toggled.</li>
<li>F12 toggles a &quot;free edit&quot; mode of the shell buffer. This mode is
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
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>
</ul>
<p>On top of these changes I (Robin Dunn) added the following:</p>
<ul class="simple">
<li>General code cleanup and fixes.</li>
<li>Use wx.StandardPaths to determine the location of the config files.</li>
<li>Remove Orbtech attributions from the UI, they've been there long
enough.</li>
<li>Use wx.SP_LIVE_UPDATE on crust and filling windows.</li>
<li>Extended the saving of the config info and other new features to the
PyShell app too. Additionally, other apps that embed a PyCrust or a
PyShell can pass their own wx.Config object and have the Py code
save/restore its settings to/from there.</li>
<li>All of the classes with config info get an opportunity to save/load
their own settings instead of putting all the save/load code in one
place that then has to reach all over the place to do anything.</li>
<li>Enable editing of the startup python code, which will either be the
file pointed to by PYTHONSTARTUP or a file in the config dir if
PYTHONSTARTUP is not set in the environment.</li>
<li>Added an option to skip the running of the startup code when
PyShell or PyCrust starts.</li>
<li>PyCrust adds a pp(item) function to the shell's namespace that
pretty prints the item in the Display tab of the notebook. Added
code to raise that tab when pp() is called.</li>
<li>Added an option for whether to insert text for function parameters
when popping up the call tip.</li>
<li>Added Find and Find-Next functions that use the wx.FindReplaceDialog.</li>
</ul>
</div>
<div class="section" id="to-2004">
<h2><a class="toc-backref" href="#id17" name="to-2004">0.9.4 (1/25/2004 to //2004)</a></h2>
<h2><a class="toc-backref" href="#id19" name="to-2004">0.9.4 (1/25/2004 to //2004)</a></h2>
<p>Removed wxd decorators in favor of new SWIG-generated docstrings.</p>
<p>Removed docs tabs from crust interface:
* wxPython Docs
@ -230,12 +283,12 @@ programs and modules, since the beginning.</p>
empty dictionary.</p>
</div>
<div class="section" id="to-1-24-2004">
<h2><a class="toc-backref" href="#id18" name="to-1-24-2004">0.9.3 (9/25/2003 to 1/24/2004)</a></h2>
<h2><a class="toc-backref" href="#id20" name="to-1-24-2004">0.9.3 (9/25/2003 to 1/24/2004)</a></h2>
<p>Fun and games with dynamic renaming. Details of any other changes
were lost in the confusion. I'll try to do better in the future.</p>
</div>
<div class="section" id="to-9-25-2003">
<h2><a class="toc-backref" href="#id19" name="to-9-25-2003">0.9.2 (5/3/2003 to 9/25/2003)</a></h2>
<h2><a class="toc-backref" href="#id21" name="to-9-25-2003">0.9.2 (5/3/2003 to 9/25/2003)</a></h2>
<p>Changed to the new prefix-less &quot;wx&quot; package:</p>
<pre class="literal-block">
import wx
@ -278,7 +331,7 @@ def CanPaste(self):
</pre>
</div>
<div class="section" id="to-5-2-2003">
<h2><a class="toc-backref" href="#id20" name="to-5-2-2003">0.9.1 (3/21/2003 to 5/2/2003)</a></h2>
<h2><a class="toc-backref" href="#id22" name="to-5-2-2003">0.9.1 (3/21/2003 to 5/2/2003)</a></h2>
<p>PyCrust is dead! Long live Py!</p>
<ul class="simple">
<li>Renamed <tt class="docutils literal"><span class="pre">PyCrust</span></tt> package to <tt class="docutils literal"><span class="pre">py</span></tt>.</li>
@ -313,7 +366,7 @@ The current implementation of wxSTC can now handle lists this big.</p>
<p>Improved handling of <tt class="docutils literal"><span class="pre">sys.path</span></tt> to mimic the standard Python shell.</p>
</div>
<div class="section" id="to-3-20-2003">
<h2><a class="toc-backref" href="#id21" name="to-3-20-2003">0.9 (2/27/2003 to 3/20/2003)</a></h2>
<h2><a class="toc-backref" href="#id23" name="to-3-20-2003">0.9 (2/27/2003 to 3/20/2003)</a></h2>
<p>Added fontIncrease, fontDecrease, fontDefault signals, receivers and
keybindings:</p>
<pre class="literal-block">
@ -345,7 +398,7 @@ except NameError:
<p>Added <tt class="docutils literal"><span class="pre">wxd</span></tt> directory with decoration classes.</p>
</div>
<div class="section" id="to-2-26-2003">
<h2><a class="toc-backref" href="#id22" name="to-2-26-2003">0.8.2 (1/5/2003 to 2/26/2003)</a></h2>
<h2><a class="toc-backref" href="#id24" name="to-2-26-2003">0.8.2 (1/5/2003 to 2/26/2003)</a></h2>
<p>Wrapped <tt class="docutils literal"><span class="pre">sys.ps1</span></tt>, <tt class="docutils literal"><span class="pre">sys.ps2</span></tt>, and <tt class="docutils literal"><span class="pre">sys.ps3</span></tt> in <tt class="docutils literal"><span class="pre">str()</span></tt>.
(Thanks, Kieran Holland.)</p>
<p>Fixed minor things found by PyChecker.</p>
@ -380,7 +433,7 @@ func = 3 .
<p>More Filling!!! The namespace tree is now dynamically updated.</p>
</div>
<div class="section" id="to-12-25-2002">
<h2><a class="toc-backref" href="#id23" name="to-12-25-2002">0.8.1 (12/20/2002 to 12/25/2002)</a></h2>
<h2><a class="toc-backref" href="#id25" name="to-12-25-2002">0.8.1 (12/20/2002 to 12/25/2002)</a></h2>
<p>Improved keyboard handling with Autocomplete active. You can now use
Enter as well as Tab to select an item from the list.</p>
<p>Disabled autocomplete for lists of 2000 items or more. The current
@ -392,7 +445,7 @@ doing some decorating. I wonder where that would be helpful? &lt;wink&gt;)</p>
<p>Fixed handling of icon. Added <tt class="docutils literal"><span class="pre">images.py</span></tt> file.</p>
</div>
<div class="section" id="to-12-16-2002">
<h2><a class="toc-backref" href="#id24" name="to-12-16-2002">0.8 (10/29/2002 to 12/16/2002)</a></h2>
<h2><a class="toc-backref" href="#id26" name="to-12-16-2002">0.8 (10/29/2002 to 12/16/2002)</a></h2>
<p>Added &quot;help&quot; to startup banner info.</p>
<p>Made all <tt class="docutils literal"><span class="pre">wx</span></tt> and <tt class="docutils literal"><span class="pre">stc</span></tt> imports explicit. No more <tt class="docutils literal"><span class="pre">import</span> <span class="pre">*</span></tt>.</p>
<p>Replaced use of the <tt class="docutils literal"><span class="pre">wx</span></tt> module's <tt class="docutils literal"><span class="pre">true</span></tt> and <tt class="docutils literal"><span class="pre">false</span></tt> with
@ -419,7 +472,7 @@ Platform: linux2
handler to free up the CPU.</p>
</div>
<div class="section" id="to-8-27-2002">
<h2><a class="toc-backref" href="#id25" name="to-8-27-2002">0.7.2 (2/22/2002 to 8/27/2002)</a></h2>
<h2><a class="toc-backref" href="#id27" name="to-8-27-2002">0.7.2 (2/22/2002 to 8/27/2002)</a></h2>
<p>Tweaked <tt class="docutils literal"><span class="pre">getAttributeNames()</span></tt> to pick up a few more attributes:</p>
<pre class="literal-block">
'__bases__', '__class__', '__dict__', '__name__', 'func_closure',
@ -457,7 +510,7 @@ boxes. Renamed <tt class="docutils literal"><span class="pre">readIn</span></tt
<tt class="docutils literal"><span class="pre">raw_input</span></tt>.</p>
</div>
<div class="section" id="to-2-21-2002">
<h2><a class="toc-backref" href="#id26" name="to-2-21-2002">0.7.1 (12/12/2001 to 2/21/2002)</a></h2>
<h2><a class="toc-backref" href="#id28" name="to-2-21-2002">0.7.1 (12/12/2001 to 2/21/2002)</a></h2>
<p>Fixed <tt class="docutils literal"><span class="pre">OnChar()</span></tt> issues effecting European keyboards, as reported by
Jean-Michel Fauth.</p>
<p>Fixed <tt class="docutils literal"><span class="pre">introspect.py</span></tt> issue with xmlrpc objects reported by Kevin
@ -484,7 +537,7 @@ to insert from history - Shift+Up and Shift+Down.</p>
<p>Improved call tip positioning calculation.</p>
</div>
<div class="section" id="to-12-11-2001">
<h2><a class="toc-backref" href="#id27" name="to-12-11-2001">0.7 (10/15/2001 to 12/11/2001)</a></h2>
<h2><a class="toc-backref" href="#id29" name="to-12-11-2001">0.7 (10/15/2001 to 12/11/2001)</a></h2>
<p>Changed how command history retrieval functions work. Added Alt-P,
Alt-N as keybindings for Retrieve-Previous, Retrieve-Next.</p>
<p>Added full support for multi-line commands, similar to IDLE.</p>
@ -508,7 +561,7 @@ package/module name conflicts that kept you from doing <tt class="docutils liter
<p>Fixed bug in <tt class="docutils literal"><span class="pre">introspect.getCallTip()</span></tt>, reported by Kevin Altis.</p>
</div>
<div class="section" id="to-10-12-2001">
<h2><a class="toc-backref" href="#id28" name="to-10-12-2001">0.6.1 (9/19/2001 to 10/12/2001)</a></h2>
<h2><a class="toc-backref" href="#id30" name="to-10-12-2001">0.6.1 (9/19/2001 to 10/12/2001)</a></h2>
<p>Changed <tt class="docutils literal"><span class="pre">Shell.run()</span></tt> to always position to the end of existing
text, as suggested by Raul Cota.</p>
<p>Changed <tt class="docutils literal"><span class="pre">introspect.getAllAttributeNames()</span></tt> to break circular
@ -526,7 +579,7 @@ ZODB objects that are asleep - in a &quot;ghost&quot; state. Otherwise it
returns incomplete info.</p>
</div>
<div class="section" id="to-9-12-2001">
<h2><a class="toc-backref" href="#id29" name="to-9-12-2001">0.6 (8/21/2001 to 9/12/2001)</a></h2>
<h2><a class="toc-backref" href="#id31" name="to-9-12-2001">0.6 (8/21/2001 to 9/12/2001)</a></h2>
<p>Added <tt class="docutils literal"><span class="pre">PyFilling.py</span></tt> and <tt class="docutils literal"><span class="pre">filling.py</span></tt>.</p>
<p><tt class="docutils literal"><span class="pre">PyShell.py</span></tt> and <tt class="docutils literal"><span class="pre">PyFilling.py</span></tt> can now be run standalone, as well
as <tt class="docutils literal"><span class="pre">PyCrust.py</span></tt>.</p>
@ -547,7 +600,7 @@ sys.path.insert(0, os.curdir)
<p>Added support for distutils installations.</p>
</div>
<div class="section" id="to-8-20-2001">
<h2><a class="toc-backref" href="#id30" name="to-8-20-2001">0.5.4 (8/17/2001 to 8/20/2001)</a></h2>
<h2><a class="toc-backref" href="#id32" name="to-8-20-2001">0.5.4 (8/17/2001 to 8/20/2001)</a></h2>
<p>Changed default font size under Linux to:</p>
<pre class="literal-block">
'size' : 12,
@ -564,15 +617,15 @@ demo.</p>
<p>Split <tt class="docutils literal"><span class="pre">PyCrust.py</span></tt> into <tt class="docutils literal"><span class="pre">PyCrust.py</span></tt> and <tt class="docutils literal"><span class="pre">PyShell.py</span></tt> in
anticipation of <tt class="docutils literal"><span class="pre">PyFilling.py</span></tt>.</p>
</div>
<div class="section" id="id1">
<h2><a class="toc-backref" href="#id31" name="id1">0.5.3 (8/16/2001)</a></h2>
<div class="section" id="id2">
<h2><a class="toc-backref" href="#id33" name="id2">0.5.3 (8/16/2001)</a></h2>
<p>Added patch to <tt class="docutils literal"><span class="pre">PyCrust.py</span></tt> to fix wxPython bug:</p>
<pre class="literal-block">
wxID_SELECTALL = NewId() # This *should* be defined by wxPython.
</pre>
</div>
<div class="section" id="to-8-15-2001">
<h2><a class="toc-backref" href="#id32" name="to-8-15-2001">0.5.2 (8/14/2001 to 8/15/2001)</a></h2>
<h2><a class="toc-backref" href="#id34" name="to-8-15-2001">0.5.2 (8/14/2001 to 8/15/2001)</a></h2>
<p>Shortened module names by dropping &quot;PyCrust&quot; as a prefix.</p>
<p>Changed <tt class="docutils literal"><span class="pre">version</span></tt> to <tt class="docutils literal"><span class="pre">VERSION</span></tt> in <tt class="docutils literal"><span class="pre">version</span></tt> module.</p>
<p>Added Options menu to PyCrust application.</p>
@ -583,7 +636,7 @@ Plus, Shell will be much easier for gui toolkits/designers to deal
with now.</p>
</div>
<div class="section" id="to-8-14-2001">
<h2><a class="toc-backref" href="#id33" name="to-8-14-2001">0.5.1 (8/10/2001 to 8/14/2001)</a></h2>
<h2><a class="toc-backref" href="#id35" name="to-8-14-2001">0.5.1 (8/10/2001 to 8/14/2001)</a></h2>
<p>Added <tt class="docutils literal"><span class="pre">introspect</span></tt> module.</p>
<p>Moved some functionality from <tt class="docutils literal"><span class="pre">PyCrustInterp</span></tt> to <tt class="docutils literal"><span class="pre">introspect</span></tt>.</p>
<p>Changed <tt class="docutils literal"><span class="pre">introspect.getRoot()</span></tt> to no longer remove whitespace from
@ -634,24 +687,24 @@ exclude one or the other or both with:</p>
&gt;&gt;&gt; shell.editor.autoCompleteExcludeDouble = 1
</pre>
</div>
<div class="section" id="id2">
<h2><a class="toc-backref" href="#id34" name="id2">0.5 (8/8/2001)</a></h2>
<div class="section" id="id3">
<h2><a class="toc-backref" href="#id36" name="id3">0.5 (8/8/2001)</a></h2>
<p>Mostly just a final version change before creating a release.</p>
</div>
<div class="section" id="to-8-7-2001">
<h2><a class="toc-backref" href="#id35" name="to-8-7-2001">0.4 (8/4/2001 to 8/7/2001)</a></h2>
<h2><a class="toc-backref" href="#id37" name="to-8-7-2001">0.4 (8/4/2001 to 8/7/2001)</a></h2>
<p>Changed version/revision handling.</p>
<p>Fixed bugs.</p>
</div>
<div class="section" id="to-8-3-2001">
<h2><a class="toc-backref" href="#id36" name="to-8-3-2001">0.3 (8/2/2001 to 8/3/2001)</a></h2>
<h2><a class="toc-backref" href="#id38" name="to-8-3-2001">0.3 (8/2/2001 to 8/3/2001)</a></h2>
<p>Removed lots of cruft.</p>
<p>Added lots of docstrings.</p>
<p>Imported to CVS repository at SourceForge.</p>
<p>Added call tips.</p>
</div>
<div class="section" id="to-8-2-2001">
<h2><a class="toc-backref" href="#id37" name="to-8-2-2001">0.2 (7/30/2001 to 8/2/2001)</a></h2>
<h2><a class="toc-backref" href="#id39" name="to-8-2-2001">0.2 (7/30/2001 to 8/2/2001)</a></h2>
<p>Renamed several files.</p>
<p>Added command autocompletion.</p>
<p>Added menus to PyCrust.py: File, Edit and Help.</p>
@ -659,7 +712,7 @@ exclude one or the other or both with:</p>
<tt class="docutils literal"><span class="pre">PyCrustAlaMode.py</span></tt>, and <tt class="docutils literal"><span class="pre">PyCrustMinimus.py</span></tt>.</p>
</div>
<div class="section" id="to-7-19-2001">
<h2><a class="toc-backref" href="#id38" name="to-7-19-2001">0.1 (7/1/2001 to 7/19/2001)</a></h2>
<h2><a class="toc-backref" href="#id40" name="to-7-19-2001">0.1 (7/1/2001 to 7/19/2001)</a></h2>
<p>Added basic syntax coloring much like Boa.</p>
<p>Added read-only logging much like IDLE.</p>
<p>Can retrieve a previous command by putting the cursor back on that
@ -672,7 +725,7 @@ response.</p>
<p>Created SourceForge account, but nothing was posted.</p>
</div>
<div class="section" id="in-the-beginning-there-was-pie-7-1-2001">
<h2><a class="toc-backref" href="#id39" name="in-the-beginning-there-was-pie-7-1-2001">In the beginning, there was pie... (7/1/2001)</a></h2>
<h2><a class="toc-backref" href="#id41" name="in-the-beginning-there-was-pie-7-1-2001">In the beginning, there was pie... (7/1/2001)</a></h2>
<p>Blame it all on IDLE, Boa and PythonWin. I was using all three, got
frustrated with their dissimilarities, and began to let everyone know
how I felt. At the same time, Scintilla looked like an interesting

View File

@ -727,7 +727,7 @@ else:
if INSTALL_MULTIVERSION:
EXTRA_PATH = getExtraPath(addOpts=EP_ADD_OPTS)
EXTRA_PATH = getExtraPath(addOpts=EP_ADD_OPTS, shortVer=not EP_FULL_VER)
open("src/wx.pth", "w").write(EXTRA_PATH)
CLEANUP.append("src/wx.pth")
else:

View File

@ -105,7 +105,6 @@
%rename(Bell) wxBell;
%rename(EndBusyCursor) wxEndBusyCursor;
%rename(GetElapsedTime) wxGetElapsedTime;
%rename(GetMousePosition) wxGetMousePosition;
%rename(IsBusy) wxIsBusy;
%rename(Now) wxNow;
%rename(Shell) wxShell;
@ -151,12 +150,15 @@
%rename(SetCursor) wxSetCursor;
%rename(GetXDisplay) wxGetXDisplay;
%rename(BeginBusyCursor) wxBeginBusyCursor;
%rename(GetMousePosition) wxGetMousePosition;
%rename(GetActiveWindow) wxGetActiveWindow;
%rename(GenericFindWindowAtPoint) wxGenericFindWindowAtPoint;
%rename(FindWindowAtPoint) wxFindWindowAtPoint;
%rename(GetTopLevelParent) wxGetTopLevelParent;
%rename(LaunchDefaultBrowser) wxLaunchDefaultBrowser;
%rename(GetKeyState) wxGetKeyState;
%rename(MouseState) wxMouseState;
%rename(GetMouseState) wxGetMouseState;
%rename(WakeUpMainThread) wxWakeUpMainThread;
%rename(MutexGuiEnter) wxMutexGuiEnter;
%rename(MutexGuiLeave) wxMutexGuiLeave;

View File

@ -803,7 +803,7 @@ public:
DocStr(wxURLDataObject,
"This data object holds a URL in a format that is compatible with some
browsers such that it is able to be dragged to or from them.", "");
class wxURLDataObject : public wxDataObjectComposite {
class wxURLDataObject : public wxDataObject/*Composite*/ {
public:
wxURLDataObject();

View File

@ -53,11 +53,6 @@ void wxEndBusyCursor();
long wxGetElapsedTime(bool resetTimer = true);
MustHaveApp(wxGetMousePosition);
DocDeclA(
void, wxGetMousePosition(int* OUTPUT, int* OUTPUT),
"GetMousePosition() -> (x,y)");
bool wxIsBusy();
wxString wxNow();
bool wxShell(const wxString& command = wxPyEmptyString);
@ -278,8 +273,29 @@ other platforms.", "");
MustHaveApp(wxBeginBusyCursor);
void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
MustHaveApp(wxGetMousePosition);
DocDeclStr(
wxPoint, wxGetMousePosition(),
"Get the current mouse position on the screen.", "");
MustHaveApp(FindWindowAtPointer);
DocStr(FindWindowAtPointer,
"Returns the window currently under the mouse pointer, if it belongs to
this application. Otherwise it returns None.", "");
%inline %{
wxWindow* FindWindowAtPointer() {
wxPoint unused;
return wxFindWindowAtPointer(unused);
}
%}
MustHaveApp(wxGetActiveWindow);
wxWindow * wxGetActiveWindow();
DocDeclStr(
wxWindow *, wxGetActiveWindow(),
"Get the currently active window of this application, or None", "");
MustHaveApp(wxGenericFindWindowAtPoint);
wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
@ -304,11 +320,73 @@ DocDeclStr(
bool , wxGetKeyState(wxKeyCode key),
"Get the state of a key (true if pressed or toggled on, false if not.)
This is generally most useful getting the state of the modifier or
toggle keys. On some platforms those may be the only keys that work.
toggle keys. On some platforms those may be the only keys that this
function is able to detect.
", "");
//---------------------------------------------------------------------------
DocStr(wxMouseState,
"`wx.MouseState` is used to hold information about mouse button and
modifier key states and is what is returned from `wx.GetMouseState`.",
"");
class wxMouseState
{
public:
wxMouseState();
~wxMouseState();
wxCoord GetX();
wxCoord GetY();
bool LeftDown();
bool MiddleDown();
bool RightDown();
bool ControlDown();
bool ShiftDown();
bool AltDown();
bool MetaDown();
bool CmdDown();
void SetX(wxCoord x);
void SetY(wxCoord y);
void SetLeftDown(bool down);
void SetMiddleDown(bool down);
void SetRightDown(bool down);
void SetControlDown(bool down);
void SetShiftDown(bool down);
void SetAltDown(bool down);
void SetMetaDown(bool down);
%pythoncode {
x = property(GetX, SetX)
y = property(GetY, SetY)
leftDown = property(LeftDown, SetLeftDown)
middleDown = property(MiddleDown, SetMiddleDown)
rightDown = property(RightDown, SetRightDown)
controlDown = property(ControlDown, SetControlDown)
shiftDown = property(ShiftDown, SetShiftDown)
altDown = property(AltDown, SetAltDown)
metaDown = property(MetaDown, SetMetaDown)
cmdDown = property(CmdDown)
}
};
DocDeclStr(
wxMouseState , wxGetMouseState(),
"Returns the current state of the mouse. Returns an instance of a
`wx.MouseState` object that contains the current position of the mouse
pointer in screen coordinants, as well as boolean values indicating
the up/down status of the mouse buttons and the modifier keys.", "");
//---------------------------------------------------------------------------
MustHaveApp(wxWakeUpMainThread);

View File

@ -261,6 +261,18 @@ isn't any.", "");
return Py_None;
}
}
DocStr(SetUserData,
"Associate a Python object with this sizer item.", "");
void SetUserData(PyObject* userData) {
wxPyUserData* data = NULL;
if ( userData ) {
wxPyBlock_t blocked = wxPyBeginBlockThreads();
data = new wxPyUserData(userData);
wxPyEndBlockThreads(blocked);
}
self->SetUserData(data);
}
}
};

View File

@ -122,6 +122,7 @@ public:
const wxEventType wxEVT_MEDIA_FINISHED = 0;
const wxEventType wxEVT_MEDIA_STOP = 0;
const wxEventType wxEVT_MEDIA_LOADED = 0;
#endif
%}
@ -218,10 +219,12 @@ public:
%constant wxEventType wxEVT_MEDIA_FINISHED;
%constant wxEventType wxEVT_MEDIA_STOP;
%constant wxEventType wxEVT_MEDIA_LOADED;
%pythoncode {
EVT_MEDIA_FINISHED = wx.PyEventBinder( wxEVT_MEDIA_FINISHED, 1)
EVT_MEDIA_STOP = wx.PyEventBinder( wxEVT_MEDIA_STOP, 1)
EVT_MEDIA_LOADED = wx.PyEventBinder( wxEVT_MEDIA_LOADED, 1)
}
//---------------------------------------------------------------------------

View File

@ -483,6 +483,7 @@ class Editor(wx.ScrolledWindow):
self.SelectEnd = None
self.UpdateView()
self.CaptureMouse()
self.SetFocus()
def OnLeftUp(self, event):
if not self.HasCapture():

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ class NavCanvas(wx.Panel):
This is a high level window that encloses the FloatCanvas in a panel
and adds a Navigation toolbar.
Copyright: wxWindows Software Foundation (Assigned by: Christopher Barker)
Copyright: Christopher Barker)
License: Same as the version of wxPython you are using it with
@ -72,18 +72,18 @@ class NavCanvas(wx.Panel):
tb = wx.ToolBar(self,-1)
self.ToolBar = tb
tb.SetToolBitmapSize((23,23))
tb.SetToolBitmapSize((24,24))
tb.AddTool(ID_POINTER_BUTTON, Resources.GetPointerBitmap(), isToggle=True, shortHelpString = "Pointer")
tb.AddTool(ID_POINTER_BUTTON, Resources.getPointerBitmap(), isToggle=True, shortHelpString = "Pointer")
wx.EVT_TOOL(self, ID_POINTER_BUTTON, self.SetToolMode)
tb.AddTool(ID_ZOOM_IN_BUTTON, Resources.GetPlusBitmap(), isToggle=True, shortHelpString = "Zoom In")
tb.AddTool(ID_ZOOM_IN_BUTTON, Resources.getMagPlusBitmap(), isToggle=True, shortHelpString = "Zoom In")
wx.EVT_TOOL(self, ID_ZOOM_IN_BUTTON, self.SetToolMode)
tb.AddTool(ID_ZOOM_OUT_BUTTON, Resources.GetMinusBitmap(), isToggle=True, shortHelpString = "Zoom Out")
tb.AddTool(ID_ZOOM_OUT_BUTTON, Resources.getMagMinusBitmap(), isToggle=True, shortHelpString = "Zoom Out")
wx.EVT_TOOL(self, ID_ZOOM_OUT_BUTTON, self.SetToolMode)
tb.AddTool(ID_MOVE_MODE_BUTTON, Resources.GetHandBitmap(), isToggle=True, shortHelpString = "Move")
tb.AddTool(ID_MOVE_MODE_BUTTON, Resources.getHandBitmap(), isToggle=True, shortHelpString = "Move")
wx.EVT_TOOL(self, ID_MOVE_MODE_BUTTON, self.SetToolMode)
tb.AddSeparator()

View File

@ -1,66 +1,316 @@
"""
Resources.py Various resources needed by the FloatCanvas package
Includes, icons, etc.
"""
### These are some functions for bitmaps of icons.
import wx, cPickle, zlib
def GetHandData():
return cPickle.loads(zlib.decompress(
'x\xda\xd3\xc8)0\xe4\nV72T\x00!\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\xe4l0O\
\x01\xc8S\xb6t\x06A(\x1f\x0b\xa0\xa9\x8c\x9e\x1e6\x19\xa0\xa8\x1e\x88\xd4C\
\x97\xd1\x83\xe8\x80 \x9c2zh\xa6\xc1\x11X\n\xab\x8c\x02\x8a\x0cD!\x92\x12\
\x98\x8c\x1e\x8a\x8b\xd1d\x14\xf4\x90%\x90LC\xf6\xbf\x1e\xba\xab\x91%\xd0\
\xdc\x86C\x06\xd9m\xe8!\xaa\x87S\x86\x1a1\xa7\x07\x00v\x0f[\x17' ))
def GetHandBitmap():
return wx.BitmapFromXPMData(GetHandData())
#----------------------------------------------------------------------
def GetPlusData():
return cPickle.loads(zlib.decompress(
'x\xda\xd3\xc8)0\xe4\nV72T\x00!\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\xe4l0O\
\x01\xc8S\xb6t\x06A(\x1f\x0b RF\x0f\x08\xb0\xc9@D\xe1r\x08\x19\xb8j=l2`\r\
\xe82HF\xe9a\xc8\xe8\xe9A\x9c@\x8a\x0c\x0e\xd3p\xbb\x00\x8f\xab\xe1>\xd5\xd3\
\xc3\x15:P)l!\n\x91\xc2\x1a\xd6`)\xec\xb1\x00\x92\xc2\x11?\xb8e\x88\x8fSt\
\x19=\x00\x82\x16[\xf7' ))
# This file was generated by /usr/local/bin/img2py
#
from wx import ImageFromStream, BitmapFromImage
import cStringIO, zlib
def GetPlusBitmap():
return wx.BitmapFromXPMData(GetPlusData())
#----------------------------------------------------------------------
def GetMinusData():
return cPickle.loads(zlib.decompress(
'x\xda\xd3\xc8)0\xe4\nV72T\x00!\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\xe4l0O\
\x01\xc8S\xb6t\x06A(\x1f\x0b RF\x0f\x08\xb0\xc9@D\xe1r\x08\x19\xb8j=\xa2e\
\x10\x16@\x99\xc82zz\x10\'\x90"\x83\xc34r\xdc\x86\xf0\xa9\x9e\x1e\xae\xd0\
\x81Ja\x0bQ\x88\x14\xd6\xb0\x06Ka\x8f\x05\x90\x14\x8e\xf8\xc1-C|\x9c\xa2\xcb\
\xe8\x01\x00\xed\x0f[\x87' ))
def GetMinusBitmap():
return wx.BitmapFromXPMData(GetMinusData())
## NOTE: this was created using a newer version of img2py than the above
import cStringIO
def GetPointerData():
def getMagPlusData():
return zlib.decompress(
'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\xa2 \xcc\xc1\
\x06$W\x8a/\x9d\x06\xa4X\x8a\x9d<C8\x80\xa0\x86#\xa5\x03\xc8\xcf\xf4tq\x0c\
\xa9\x98s\xf4\x92\xa3\x10\x83 \x0f\x8b\xc3\xea?\xa6\xf9\xb3\xae\xaf\x9b\xbcj\
\xef\x9a3-\x13\xba\x99o\xb1\xf07l\xcfYg5\xdbd\xf3\xdf\x0c\x91\xb2\x8b\x1e\
\x81+fM\xf3[u \xe8\xb7N\xcd{\xbf\xfdG\x97\xf0\xaa~}P\xf0\xdb\xd8\xe2\xa9\xdf\
\xec]\x8c\r\xbb\xdb\xbcN9\x08Y\x1d0\\\xb6\xf7\x9f\xd0\xaam\xbe\x0b\xeb\xdb\
\x97\xfc\xbd\xfc8\xe3\x94\xfd\xdb\x7fs\xa4\xa7\x17\xf0\x9d;\x03\xb4\x94\xc1\
\xd3\xd5\xcfe\x9dSB\x13\x00\xcbEE&' )
'x\xda\x01*\x01\xd5\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\
\x00\x00\x00\x18\x08\x06\x00\x00\x00\xe0w=\xf8\x00\x00\x00\x04sBIT\x08\x08\
\x08\x08|\x08d\x88\x00\x00\x00\xe1IDATx\x9c\xb5U\xd1\x0e\xc4 \x08\xa3n\xff\
\xff\xc5\xdb\xb8\xa7\xee<\x04\x86gFb\xb2\x88\xb6\x14\x90\x01m\x937m\x8f\x1c\
\xd7yh\xe4k\xdb\x8e*\x01<\x05\x04\x07F\x1cU\x9d"\x19\x14\\\xe7\xa1\x1e\xf07"\
\x90H+$?\x04\x16\x9c\xd1z\x04\x00J$m\x06\xdc\xee\x03Hku\x13\xd8C\x16\x84+"O\
\x1b\xa2\x07\xca"\xb7\xc6sY\xbdD\x926\xf5.\xce\x06!\xd2)x\xcb^\'\x08S\xe4\
\xe5x&5\xb4[A\xb5h\xb4j=\x9a\xc8\xf8\xecm\xd4\\\x9e\xdf\xbb?\x10\xf0P\x06\
\x12\xed?=\xb6a\xd8=\xcd\xa2\xc8T\xd5U2t\x11\x95d\xa3"\x9aQ\x9e\x12\xb7M\x19\
I\x9f\xff\x1e\xd8\xa63#q\xff\x07U\x8b\xd2\xd9\xa7k\xe9\xa1U\x94,\xbf\xe4\x88\
\xe4\xf6\xaf\x12x$}\x8a\xc2Q\xf1\'\x89\xf2\x9b\xfbKE\xae\xd8\x07+\xd2\xa7c\
\xdf\x0e\xc3D\x00\x00\x00\x00IEND\xaeB`\x82\xe2ovy' )
def GetPointerBitmap():
return wx.BitmapFromImage(GetPointerImage())
def getMagPlusBitmap():
return BitmapFromImage(getMagPlusImage())
def GetPointerImage():
stream = cStringIO.StringIO(GetPointerData())
return wx.ImageFromStream(stream)
def getMagPlusImage():
stream = cStringIO.StringIO(getMagPlusData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getPointerData():
return zlib.decompress(
"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x12 \xcc\xc1\
\x06$\x1f\x94\xdb\xfe\x00R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4o\xf5tq\x0c\
\xa9\x98\xb3\xf5\xdaE\xa1V\x05\x0e\x96\x0bw\xbf\xfc\xdf\xbfc\xd1\xf4\xd9\x87\
\xa7\xa84Mw_n\xa3\xeb&\xbcS\xf4N\xa9\xdcn\x86\x03aZ\x1bWl{\xcet\x92m\xed\x8a\
[\xd1*\x9c\x82\x91\x93\x9eMuP\xd6\xbe4\xa3\xa1\xcd\xe8\x84\xc0\t%=\x85\xe6\
\x1d\x8d\x1aF\xac.\x132\x13\xc4^\x9ek\x14\xffx\xc6K\xa3\xd1\xcd-3\xa8\xa1M'\
\x85\xf3Ck\xcb\xb9\x07\xd7\x7f\x85\x7f=\xa7Ts\xe2^\xff\x83\xfb\xf1\x97\x15\
\x15\x94\xd2\xbc/5tl\t\xb3\x11\xcc\xe7\x12\xbe0;\xfa\xef7\x85X\x87\xfc{z:S'\
\x86-}\xb6\xe0\xbb\xc2\xfc\x03\x7f\xa7\\\xf3\xb5jM/fX\xf0/\xf7\xe3\xb5\xca7\
\x8f\xe66s\xf3\x99\xe7\xf8\x9e\xb4(\xfd\t\xf4\x00\x83\xa7\xab\x9f\xcb:\xa7\
\x84&\x00\xc7Jh8" )
def getPointerBitmap():
return BitmapFromImage(getPointerImage())
def getPointerImage():
stream = cStringIO.StringIO(getPointerData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMagMinusData():
return zlib.decompress(
'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x12 \xcc\xc1\
\x06$\x1f\x94\xdb\xfe\x00R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xdf\xf6tq\
\x0c\xa9\x98\xb354\x9a\xaf\xc5\x80#e\xd5w\xfb\x8d\xa7\xea.\xa6j\x06\xec\xeaU\
Q[vE\xb2m\xba\x83\xf5\x0b_k\xe5\xe3\xc5\xf12?o\x15.\xf2b\xf0ol`V\xe63\xd6\
\x9f\xc8\xc35\xefw\x12\xff\x0fi\xc1\x96\x0em\x15{\x16\xb1\x98E_9\x18\xa6x\
\xdc\xe2\xdaa\xcb>\xe1\xda*\xe1\x1b\xde\x82\x15O\xfc\xa5\x9d\xdc\x83\x19\xb7\
\xabD\xee\xed\x98dv\xd6n\r\x9b\xe3\x12\x91=\xa9\xeb\x85[4\xa3<\x9d\xd3b\x1d\
\xb7f$]]\x96\xe1\xf2\xf8\xc6y\x8f5\xf6\xd2\xdb\x96\xe9\xdfT\\\xd5p\xbe-7\xa2\
ls\xac\x88\xa4\xf1n\xaf6=!\xd5\x9b\xab:\xca\xa6,?\x92\x1b\xdc\xe9r\xe0\xcb\
\xe2\xe6\x15\x13v\xfco^\xe5\xfa\xf2\xca\xcb[R[\xba&\xbd\xf5\xec\xf3\xd8U?\
\xfd\x80\xf2EM\xae\xf0\xa3\xf3Ut\xde\x17\xed\x0b}\xd2U\xcb0Ugv\x82\xa1Q\xc7S\
\xa07\x19<]\xfd\\\xd69%4\x01\x00+\xecq\xf9' )
def getMagMinusBitmap():
return BitmapFromImage(getMagMinusImage())
def getMagMinusImage():
stream = cStringIO.StringIO(getMagMinusData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMoveButtonData():
return zlib.decompress(
'x\xda\x01,\x01\xd3\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\
\x00\x00\x00\x18\x08\x06\x00\x00\x00\xe0w=\xf8\x00\x00\x00\x04sBIT\x08\x08\
\x08\x08|\x08d\x88\x00\x00\x00\xe3IDATx\x9c\xb5\x96\xd1\x16\x84 \x08D\x19\
\xf5\xff\xbf\xb8\x9a}Y[\xc2P\xe8\xb4<\xaa\xcc\x15\x1c-\xa0T\x89\xc6\xb1o\x14\
\x11)\xb5!\x9aS2\xe2\x00\x04\xc0\tz\r\xd0\xc5{d K\x80\x15\xcfB\xa6\x00O<\x03\
q\x01+\xf1(\xa4\xb9\xe4\xda@\xf2\x92\xd8\x81fx\xea\xaa\x01p\xec\x1b{\x82N\
\xb4\xbb\xb4\xa2\x9e\x85\x8b]\x94\xb5\xa1\x8e\xbb\xdc\x13\xa0{\x9e\xb9H+\x08\
P\xeap\xa0\xb6\xc7:92\xdf\xd7\x94\xda\x00\x92!\xb7<\t\x92\xf1\xa7\xe2i\xb4n\
\xc7\x7f\xb5\xa8\x89\xfc<\xaf\x17x6\x8c\xccwq\x11\xe5\xa2/\xe4\xbe\xceDh\xf1\
\x0b@C\x9e\xd8\xd4\xcb\xc5\xec\x83c\xdb\xf2\xcaS\xa1\xc5=\xfb\xdaq\x92\xf4 \
\xaeM\xa3g\xb2j\xe9\xf4\x1e\xac \x91\r\xb8-2\x90\xa1]Q3\x84n\xb2\xad$\xe3\
\xb4e\x05\x06\x92\xfem\xf9\x00\x8d\xa7\xbb\x936\xe9\xf2\xae\x00\x00\x00\x00I\
END\xaeB`\x82\xed\x9c\x836' )
def getMoveButtonBitmap():
return BitmapFromImage(getMoveButtonImage())
def getMoveButtonImage():
stream = cStringIO.StringIO(getMoveButtonData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMoveCursorData():
return zlib.decompress(
"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\xc2 \xcc\xc1\
\x06$\x8b\x02\xcc\xce\x00)\x96b'\xcf\x10\x0e \xa8\xe1H\xe9\x00\xf2\xd7z\xba8\
\x86T\xccYz\xe5\xa0\xd0a\x05\x0e\x96\x0b\xb1_\xff\xef\xb7\xe0\xb4-)\x98\xb0\
\xe0\xc6\xab\x8b/Ns\xf5\xa5\xac<q\xac8>(+y\xdb\xba7\x0e*\x1f\xefL\x97I\xe4b<\
\xc0gqTg\x892\xb3\xb3NS\xd9\x01\xf1eG\xc5\x04;z\xaaK\xd6]9\xc6!c\x10\xfd&\
\xf2\xbbH\x97P\xd0\xfa6\xdbY\xbe)\xfd\xd2g\xb3/\xf5\xad\xcd\xdab,\xb2\xa4C\
\xc6\x91y\xc5Q\xbb\xb6\xacd\xe6}\xae[9\xff\xaf\x8d|\xbf\xcc\x7f\xc7\xabe\xfe\
W\xf6\xffl]]\xcd\xd2\xf3\xfd\xc2\xff\t\x17WO,5o\x8a;Ys(~\x81\xa6\x19s\xf8\
\x05\xa1\xcf\tlKg\xb0\x96\xc7\xdd\xe2_\xd9\xbe,\xc7\xc4,\xf8=\xd0\xe1\x0c\
\x9e\xae~.\xeb\x9c\x12\x9a\x00\x0b\xb6b\x8e" )
def getMoveCursorBitmap():
return BitmapFromImage(getMoveCursorImage())
def getMoveCursorImage():
stream = cStringIO.StringIO(getMoveCursorData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMoveRLCursorData():
return zlib.decompress(
"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\xc2 \xcc\xc1\
\x06$\x8b\x02\xcc\xce\x00)\x96b'\xcf\x10\x0e \xa8\xe1H\xe9\x00\xf2{<]\x1cC*\
\xe6\x9c\xbd\xe2\xc8\xd7\xa0\xc0\xc3r \xf6\xc1\x7f}\xb6WG\xa5Z\xa75H=\x96\
\x93\xb6Z\xb8\xa4\x91G0_u\x8fZm\xdb\xd5I\xa9K\xdf%mMQ\xbciZU*~\xb9-\xd0\xe6C\
\xd3Y\x07\xe5\t\xbb\xa4\xc4T.\xf9'\xcf\xe54\xfcx ,/\xc5\xd5\xb1\xeb\x84\xf2\
\x0b\xa6\xb6\x19\x19\xbd\xc5\xcf\xd38\x19\xca>|\x9c\xad\xaa[\xb5@\x8e\xe5W\
\xab\xad\xb3\xc3f)m\xe5\xed\x01\xedg\x9b\xc4X\xe6|[\xe3\xab\x1b\xb9\x86m\xbd\
\xdd\x91wO\xf6\xff\xbf\xc9\xf6\xc6#\xdf|\x8be\x98\x16\xd0]\x0c\x9e\xae~.\xeb\
\x9c\x12\x9a\x00\x11\x04M\x96" )
def getMoveRLCursorBitmap():
return BitmapFromImage(getMoveRLCursorImage())
def getMoveRLCursorImage():
stream = cStringIO.StringIO(getMoveRLCursorData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMoveUDCursorData():
return zlib.decompress(
'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\xc2 \xcc\xc1\
\x06$\x8b\x02\xcc\xce\x00)\x96b\'\xcf\x10\x0e \xa8\xe1H\xe9\x00\xf2gx\xba8\
\x86T\xccY{\xc5\x91\xef\x88\x02\x07k@\xc0\xfb\xfaG\xdb\xf6\xcf6\x14t\xb1\x9b\
,\xb9\xedE\xb7\xc2\xaa[\xbb6T\xbc\xe3^\xcb\x9f\xfa:\x8a5(\xb4\xf2\x1d\xb7}\
\xa2\xb0\x90\xe0\xca\x06\xf7\x9c\xd64\x03\x83#J+\x98\xf2"\xd8\x0c/$\x88j0\
\xb7O\xfc\x1d\xc0\xf0av\xda\x8e)?\n\rg\xc4\x0bL\x9btFz\xee\xe6\xfcG\xebo\x84\
\xa9I\x9f1\x9d\xff\xad\xe7\xee\xb2\xf3\x8c\x06\xf9\xd7\xa6\xfc\xdcy\xf6M\x82\
\xf6\x96\xb99\xaf#Y{\x16\x08$?\xe0\xb4JR7h\x0e:\xd3\xcc\xb3\xe8\x06WX\xdd-\
\xf1\xf5<\x05n\xca[\xef\xfd\x01\xba\x91\xc1\xd3\xd5\xcfe\x9dSB\x13\x00/\x9bT\
s' )
def getMoveUDCursorBitmap():
return BitmapFromImage(getMoveUDCursorImage())
def getMoveUDCursorImage():
stream = cStringIO.StringIO(getMoveUDCursorData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getGrabHandData():
return zlib.decompress(
'x\xda\x01Z\x01\xa5\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\
\x00\x00\x00\x18\x08\x06\x00\x00\x00\xe0w=\xf8\x00\x00\x00\x04sBIT\x08\x08\
\x08\x08|\x08d\x88\x00\x00\x01\x11IDATx\x9c\xb5U\xd1\x12\x830\x08Kh\xff\xff\
\x8b7\xb3\x97\xd1C\xa4Zw\x93;\x1fJ1\t\x98VJ\x92\xb5N<\x14\x04 I\x00\x80H\xb4\
\xbd_\x8a9_{\\\x89\xf2z\x02\x18/J\x82\xb5\xce\xed\xfd\x12\xc9\x91\x03\x00_\
\xc7\xda\x8al\x00{\xfdW\xfex\xf2zeO\x92h\xed\x80\x05@\xa45D\xc5\xb3\x98u\x12\
\xf7\xab.\xa9\xd0k\x1eK\x95\xbb\x1a]&0\x92\xf0\'\xc6]gI\xda\tsr\xab\x8aI\x1e\
\\\xe3\xa4\x0e\xb4*`7"\x07\x8f\xaa"x\x05\xe0\xdfo6B\xf3\x17\xe3\x98r\xf1\xaf\
\x07\xd1Z\'%\x95\x0erW\xac\x8c\xe3\xe0\xfd\xd8AN\xae\xb8\xa3R\x9as>\x11\x8bl\
yD\xab\x1f\xf3\xec\x1cY\x06\x89$\xbf\x80\xfb\x14\\dw\x90x\x12\xa3+\xeeD\x16%\
I\xe3\x1c\xb8\xc7c\'\xd5Y8S\x9f\xc3Zg\xcf\x89\xe8\xaao\'\xbbk{U\xfd\xc0\xacX\
\xab\xbb\xe8\xae\xfa)AEr\x15g\x86(\t\xfe\x19\xa4\xb5\xe9f\xfem\xde\xdd\xbf$\
\xf8G<>\xa2\xc7\t>\tE\xfc\x8a\xf6\x8dqc\x00\x00\x00\x00IEND\xaeB`\x82\xdb\
\xd0\x8f\n' )
def getGrabHandBitmap():
return BitmapFromImage(getGrabHandImage())
def getGrabHandImage():
stream = cStringIO.StringIO(getGrabHandData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getHandData():
return zlib.decompress(
'x\xda\x01Y\x01\xa6\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\
\x00\x00\x00\x18\x08\x06\x00\x00\x00\xe0w=\xf8\x00\x00\x00\x04sBIT\x08\x08\
\x08\x08|\x08d\x88\x00\x00\x01\x10IDATx\x9c\xad\x96\xe1\x02\xc2 \x08\x849\
\xf5\xfd\x9fx\xdb\xf5\'\x8c!\xa8\xab\xee\x975\xe5\x83\x0b\\@\xa9\xb2\xab\xeb\
<\xa8\xebR\x1bv\xce\xb4\'\xc1\x81OL\x92\xdc\x81\x0c\x00\x1b\x88\xa4\x94\xda\
\xe0\x83\x8b\x88\x00\x10\x92\xcb\x8a\xca,K\x1fT\xa1\x1e\x04\xe0f_\n\x88\x02\
\xf1:\xc3\x83>\x81\x0c\x92\x02v\xe5+\xba\xce\x83\xb7f\xb8\xd1\x9c\x8fz8\xb2*\
\x93\xb7l\xa8\xe0\x9b\xa06\xb8]_\xe7\xc1\x01\x10U\xe1m\x98\xc9\xefm"ck\xea\
\x1a\x80\xa0Th\xb9\xfd\x877{V*Qk\xda,\xb4\x8b\xf4;[\xa1\xcf6\xaa4\x9cd\x85X\
\xb0\r\\j\x83\x9dd\x92\xc3 \xf6\xbd\xab\x0c2\x05\xc0p\x9a\xa7]\xf4\x14\x18]3\
7\x80}h?\xff\xa2\xa2\xe5e\x90\xact\xaf\xe8B\x14y[4\x83|\x13\xdc\x9e\xeb\x16e\
\x90\xa7\xf2I\rw\x91\x87d\xd7p\x96\xbd\xd70\x07\xda\xe3v\x9a\xf5\xc5\xb2\xb2\
+\xb24\xbc\xaew\xedZe\x9f\x02"\xc8J\xdb\x83\xf6oa\xf5\xb7\xa5\xbf8\x12\xffW\
\xcf_\xbd;\xe4\x8c\x03\x10\xdb^\x00\x00\x00\x00IEND\xaeB`\x82\xd1>\x97B' )
def getHandBitmap():
return BitmapFromImage(getHandImage())
def getHandImage():
stream = cStringIO.StringIO(getHandData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getGrabHand16Data():
return zlib.decompress(
'x\xda\x01\x0f\x01\xf0\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\
\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\
\x08\x08\x08\x08|\x08d\x88\x00\x00\x00\xc6IDATx\x9c\x9d\x92Qn\x031\x08D\x07\
\xd6\xc7\xc0\xf7?\x98}\x8c$\xaf\x1f[,\xaf\xb5n\x9a !\r\x08\x0f\x0c\xd8\x00\
\xfc(\xa6o-"\x000?\xc4\xaf\xedp\xc6\xe9\x00\xa5\xf7\xaeZ\xab^\xcf\x07\xb5VI\
\xda\xe2\x8c\x13\x9b\x99\x06{N\xf2\x0e\xa7KB\x12\xe5\x13\xb9\xbdw\x0123\xc1\
\x18\xe4dZw1\xeb\x9c1\xe7\xcb\xe1\x0e(".\x9d\xe6\xab\xec0 @%\x17\xd4Z\xd3\'\
\xe74;K\xbd\xb5&I\xe3\x12\x7f=\xca\x8bD\x84\xc6\xe4\xa9-\xb7\xbb\xdez\xd6\
\xbf\xd6\x00xj\xfb\xef$\xb3T?\x8a\xf9\xbc\xa0\x1d\xc9\xfa\x99f\xf3K0\x91\xbc\
\xeb~K\xf0\x8d\x99\xf9qI\xbc\x9e\x0f\xf2\xa7e\xb7\xbb\xdc\x96 \x1f\xac\x85w9\
I\xfa\x01\xd6\xd0\xefe\x16\x16\xb7\x9b\x00\x00\x00\x00IEND\xaeB`\x82\x0bmo\
\xbf' )
def getGrabHand16Bitmap():
return BitmapFromImage(getGrabHand16Image())
def getGrabHand16Image():
stream = cStringIO.StringIO(getGrabHand16Data())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMondrianData():
return zlib.decompress(
'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\n \xcc\xc1\x04\
$\xffH\xbc]\x0c\xa4\x98\x8b\x9d<C888n?\xf4\x7f\x00\xe4\xa6{\xba8\x86T\xccy;\
\xd5\x93\xaf\xc1\x80\x87\xd9\xb6\xa3\xffc\xd1<\xb1u"^G\xc5\x18\x0f\xd9\xed\
\x9a\xf8\xfc\xc2\x8e\xa9\x93Z\x97\xac\xd8)\x98\xfd\xbb\xc2\xaa\xe4z\xf0-\xa3\
\x07\xec\r%\x0bo\x9db~^\xc50eo\x11\x7f\x1c\xc3\x0ba\xa3\x93\xacg\xae\x9f_\
\xbf\x92\x91\xcd#K\x84\xf7\x86\xd5.\xf6\r\xcf\xad\x192u\xd6&Z~\xfekm\xf0\xa0\
\xd27c\x9e\xa0kv\xf2\x83\x17@+\x19<]\xfd\\\xd69%4\x01\x00}A@\xa3' )
def getMondrianBitmap():
return BitmapFromImage(getMondrianImage())
def getMondrianImage():
stream = cStringIO.StringIO(getMondrianData())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getHand16Data():
return zlib.decompress(
'x\xda\x01\x02\x01\xfd\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\
\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\
\x08\x08\x08\x08|\x08d\x88\x00\x00\x00\xb9IDATx\x9c\x8dS\xd1\x0e\x84 \x0ck\
\x87\x9f\x81\xff\xff\x93j\xef\xe12\xd8\xcd\xe1\xb9\xc4H\xc6,m\xa9\xa45\xac\
\xea:\x0f\xf9\xda\xda\xc6r\x88\xd6\xc6\xa3T\xbdw\x01\x100\xb7\xe2<\xad\x81\
\xce\xe0:\x0f\x91\xf3\x10I 9\xde\xb1\x1f\x19Yf\xe4\x03\xab>I\x90\x1c\xf2\xb6\
\x95\xfex\xea\nH\x92n\x0c\x9c\xf6\xdb2`\xba\x9d\xd0!\t\xd66>\x02\xea\xbb\xfb\
\xe3\xb4\xaf\xb3\xe3\xde\x8b3\x16\x80\xb0\xef;\x00\xa0\xf7^\xd3\xad\xb2\x10\
\xd1\xfc\xee\xcb\xfbNL\x06KZ\x1b\x19p\xcdO\xa6\xe5Ysj\x1e\x98\x18\xdf\x7f\
\x1f\x03!HoAn\xfe<\xeaK\xfd\xd2\x9f\xeao\xac\xa8\xae|\xba%1\xca\xc9U\xf5>\
\x98\xdc\xd9g\xb0\x13Hr\x00\x00\x00\x00IEND\xaeB`\x82\xde\xa5p@' )
def getHand16Bitmap():
return BitmapFromImage(getHand16Image())
def getHand16Image():
stream = cStringIO.StringIO(getHand16Data())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMagPlus16Data():
return zlib.decompress(
"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\
\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4o\xf3tq\x0c\xa9\x98\
358\x9a\xef\xb0\x01\xc7\xe3\x89\xc9S~\xc7oZ\xfb}c\x93\x86\xe2\xc5g\xeb\xb9\
\x12\x93}N\xe9xI~/m\xe2ra\xbf>+9\xc4\xe8\xf3\x1dn\x06\xed\x89\x02\x05F\x06\
\x92\x0b\x96\xdf\xeb\xea\xf1\xfa\xb6\xec\xb7U3\x03\x83\xb7`\x8d;\x13C\xc4\
\x94\x88/\xcf\xa5\xba'\x85x\x9b\x1e\xd1\xbbb\xd6\xbc\xc7\xeb\x9e\xed\xce\x9c\
\x8fE\nV\x12\x0e,/\xef\xef6\xf6\xd3\xbe\xf2Lvf\x87G\x8d\x96\xf1\xf1}q\xa7\
\xc5\r7\xdf\xf3\x9d^t\xb4PFa\xd17.\xc1G\xc6\xa5_\x85\x94\x03\x8c\xab\xf7\n\
\x9e\xcaz\xb7\xe4\xd0\xeb\xb5\x93\x7f\x19\xbf\r8\xcf\x93\xb0\xef\x10\x9f\\\
\xde\x84\xd2\x0f\xf1L\x91G\x8c\x7f0t=<{\xccE9L\x01\xe8\x03\x06OW?\x97uN\tM\
\x00\xe1\xf8b\xe3" )
def getMagPlus16Bitmap():
return BitmapFromImage(getMagPlus16Image())
def getMagPlus16Image():
stream = cStringIO.StringIO(getMagPlus16Data())
return ImageFromStream(stream)
#----------------------------------------------------------------------
def getMagMinus16Data():
return zlib.decompress(
"x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\x02 \xcc\xc1\
\x06$\xe5?\xffO\x04R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xaf\xf4tq\x0c\xa9\
\x98\xb36\xd8Q\xa8\xc5\x80C\xf9\x80\xf1\x9b\xff\xf6+\xd3\xf8\xb5\xb75\x87\
\xdc\x9dy\xd6P5\xd3I4`\xb2\xe0\xefmABWdfrW\x881_\x8f\x9c4g\xe6\x1c6E5}\xc6'\
\x0f\xbc\x85\xcf?\xca\xeaPIW\x93\xe0\xcb\xdf}N\xefc\x96Aq}\xe4#mfSw\xd35\xcf\
VL\x8a\xe5\x99\xf7(\xec\xc2\xe30\xc6\x80o\xe2?\xc3\xb2\xd7^\xedn\x9b\xe5\xa0\
[\xb5\xe9\xd0&\x1d\x91\x89\x9fmL\x02^\x8b.\xfa\x9f\xd2)T\x93\xed\xfb-\xf7\
\xed\xfd\xc3/\xc4<\x8d\x9a\xf4'?\x99\xff\x92\xef\xe7L\xcf\xae}a\xdfg\xc5\xe6\
\xf4\xcd\xe7q\x9b|\xe3 \xfb\xa7#\x1bw\xe4\x1f\xcdj\x01:\x9a\xc1\xd3\xd5\xcfe\
\x9dSB\x13\x00<\xbf^\xf7" )
def getMagMinus16Bitmap():
return BitmapFromImage(getMagMinus16Image())
def getMagMinus16Image():
stream = cStringIO.StringIO(getMagMinus16Data())
return ImageFromStream(stream)

View File

@ -68,13 +68,13 @@ checks the BBs.
Mouse Events:
At this point, there are a full set of custom mouse events. They are
just like the regular mouse events, but include an extra attribute:
Event.GetCoords(), that returns the (x,y) position in world coordinates,
as a length-2 NumPy vector of Floats.
There are a full set of custom mouse events. They are just like the
regular mouse events, but include an extra attribute: Event.GetCoords(),
that returns the (x,y) position in world coordinates, as a length-2
NumPy vector of Floats.
There are also a full set of bindings to mouse events on objects, so
that you can specify a given function be called when an objects is
that you can specify a given function be called when an object is
clicked, mouse-over'd, etc.
See the Demo for what it can do, and how to use it.
@ -83,8 +83,7 @@ Copyright: Christopher Barker
License: Same as the version of wxPython you are using it with.
Check for updates at:
http://home.comcast.net/~chrishbarker/FloatCanvas/
Check for updates or answers to questions, send me an email.
Please let me know if you're using this!!!
@ -94,6 +93,6 @@ Chris.Barker@noaa.gov
"""
__version__ = "0.8.7"
__version__ = "0.9.9"

View File

@ -29,7 +29,7 @@ class MultiSplitterWindow(wx.PyPanel):
allows for more than two windows and more than one sash. Many of
the same styles, constants, and methods behave the same as in
wx.SplitterWindow. The key differences are seen in the methods
that deal with the child windows manage by the splitter, and also
that deal with the child windows managed by the splitter, and also
those that deal with the sash positions. In most cases you will
need to pass an index value to tell the class which window or sash
you are refering to.
@ -38,7 +38,7 @@ class MultiSplitterWindow(wx.PyPanel):
wx.SplitterWindow. Since the wx.Splitterwindow has only one sash
you can think of it's position as either relative to the whole
splitter window, or as relative to the first window pane managed
by the splitter. Once there are more than one sash then the
by the splitter. Once there is more than one sash then the
distinciton between the two concepts needs to be clairified. I've
chosen to use the second definition, and sash positions are the
distance (either horizontally or vertically) from the origin of
@ -130,13 +130,17 @@ class MultiSplitterWindow(wx.PyPanel):
def AppendWindow(self, window, sashPos=-1):
"""
Add a new window to the splitter. If sashPos is given then it is the
Add a new window to the splitter at the right side or bottom
of the window stack. If sashPos is given then it is used to
size the new window.
"""
self.InsertWindow(sys.maxint, window, sashPos)
def InsertWindow(self, idx, window, sashPos=-1):
"""
Insert a new window into the splitter at the position given in
``idx``.
"""
assert window not in self._windows, "A window can only be in the splitter once!"
self._windows.insert(idx, window)

View File

@ -244,10 +244,6 @@ class EditWindow(stc.StyledTextCtrl):
def GetSelection(self):
return self.GetAnchor(), self.GetCurrentPos()
def SetSelection(self, start, end):
self.SetSelectionStart(start)
self.SetSelectionEnd(end)
def ShowPosition(self, pos):
line = self.LineFromPosition(pos)
#self.EnsureVisible(line)

View File

@ -544,6 +544,7 @@ class Frame(wx.Frame):
event.Check(win.lineNumbers)
elif id == ID_AUTO_SAVESETTINGS:
event.Check(self.autoSaveSettings)
event.Enable(self.config is not None)
elif id == ID_SAVESETTINGS:
event.Enable(self.config is not None and
hasattr(self, 'DoSaveSettings'))
@ -552,12 +553,15 @@ class Frame(wx.Frame):
elif id == ID_EXECSTARTUPSCRIPT:
event.Check(self.execStartupScript)
event.Enable(self.config is not None)
elif id == ID_SAVEHISTORY:
event.Check(self.saveHistory and self.dataDir is not None)
event.Check(self.saveHistory)
event.Enable(self.dataDir is not None)
elif id == ID_EDITSTARTUPSCRIPT:
event.Enable(hasattr(self, 'EditStartupScript'))
event.Enable(self.dataDir is not None)
elif id == ID_FIND:
event.Enable(hasattr(win, 'DoFindNext'))
elif id == ID_FINDNEXT:

View File

@ -1087,8 +1087,8 @@ Platform: %s""" % \
ctindex = ctips.find ('(')
if ctindex != -1 and not self.CallTipActive():
#insert calltip, if current pos is '(', otherwise show it only
self.autoCallTipShow(ctips[:ctindex + 1], \
self.GetCharAt(currpos - 1) == ord('(') and self.GetCurrentPos() == self.GetTextLength(),\
self.autoCallTipShow(ctips[:ctindex + 1],
self.GetCharAt(currpos - 1) == ord('(') and self.GetCurrentPos() == self.GetTextLength(),
True)
@ -1213,52 +1213,64 @@ Platform: %s""" % \
self.write(command)
wx.TheClipboard.Close()
def PasteAndRun(self):
"""Replace selection with clipboard contents, run commands."""
text = ''
if wx.TheClipboard.Open():
ps1 = str(sys.ps1)
ps2 = str(sys.ps2)
if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)):
data = wx.TextDataObject()
if wx.TheClipboard.GetData(data):
endpos = self.GetTextLength()
self.SetCurrentPos(endpos)
startpos = self.promptPosEnd
self.SetSelection(startpos, endpos)
self.ReplaceSelection('')
text = data.GetText()
text = text.lstrip()
text = self.fixLineEndings(text)
text = self.lstripPrompt(text)
text = text.replace(os.linesep + ps1, '\n')
text = text.replace(os.linesep + ps2, '\n')
text = text.replace(os.linesep, '\n')
lines = text.split('\n')
commands = []
command = ''
for line in lines:
if line.strip() == ps2.strip():
# If we are pasting from something like a
# web page that drops the trailing space
# from the ps2 prompt of a blank line.
line = ''
if line.strip() != '' and line.lstrip() == line:
# New command.
if command:
# Add the previous command to the list.
commands.append(command)
# Start a new command, which may be multiline.
command = line
else:
# Multiline command. Add to the command.
command += '\n'
command += line
commands.append(command)
for command in commands:
command = command.replace('\n', os.linesep + ps2)
self.write(command)
self.processLine()
wx.TheClipboard.Close()
if text:
self.Execute(text)
def Execute(self, text):
"""Replace selection with text and run commands."""
ps1 = str(sys.ps1)
ps2 = str(sys.ps2)
endpos = self.GetTextLength()
self.SetCurrentPos(endpos)
startpos = self.promptPosEnd
self.SetSelection(startpos, endpos)
self.ReplaceSelection('')
text = text.lstrip()
text = self.fixLineEndings(text)
text = self.lstripPrompt(text)
text = text.replace(os.linesep + ps1, '\n')
text = text.replace(os.linesep + ps2, '\n')
text = text.replace(os.linesep, '\n')
lines = text.split('\n')
commands = []
command = ''
for line in lines:
if line.strip() == ps2.strip():
# If we are pasting from something like a
# web page that drops the trailing space
# from the ps2 prompt of a blank line.
line = ''
lstrip = line.lstrip()
if line.strip() != '' and lstrip == line and \
lstrip[:4] not in ['else','elif'] and \
lstrip[:6] != 'except':
# New command.
if command:
# Add the previous command to the list.
commands.append(command)
# Start a new command, which may be multiline.
command = line
else:
# Multiline command. Add to the command.
command += '\n'
command += line
commands.append(command)
for command in commands:
command = command.replace('\n', os.linesep + ps2)
self.write(command)
self.processLine()
def wrap(self, wrap=True):
"""Sets whether text is word wrapped."""

View File

@ -139,7 +139,6 @@ wxGetStockLabel = wx._misc.GetStockLabel
wxBell = wx._misc.Bell
wxEndBusyCursor = wx._misc.EndBusyCursor
wxGetElapsedTime = wx._misc.GetElapsedTime
wxGetMousePosition = wx._misc.GetMousePosition
wxIsBusy = wx._misc.IsBusy
wxNow = wx._misc.Now
wxShell = wx._misc.Shell
@ -185,12 +184,17 @@ wxGetClientDisplayRect = wx._misc.GetClientDisplayRect
wxSetCursor = wx._misc.SetCursor
wxGetXDisplay = wx._misc.GetXDisplay
wxBeginBusyCursor = wx._misc.BeginBusyCursor
wxGetMousePosition = wx._misc.GetMousePosition
FindWindowAtPointer = wx._misc.FindWindowAtPointer
wxGetActiveWindow = wx._misc.GetActiveWindow
wxGenericFindWindowAtPoint = wx._misc.GenericFindWindowAtPoint
wxFindWindowAtPoint = wx._misc.FindWindowAtPoint
wxGetTopLevelParent = wx._misc.GetTopLevelParent
wxLaunchDefaultBrowser = wx._misc.LaunchDefaultBrowser
wxGetKeyState = wx._misc.GetKeyState
wxMouseState = wx._misc.MouseState
wxMouseStatePtr = wx._misc.MouseStatePtr
wxGetMouseState = wx._misc.GetMouseState
wxWakeUpMainThread = wx._misc.WakeUpMainThread
wxMutexGuiEnter = wx._misc.MutexGuiEnter
wxMutexGuiLeave = wx._misc.MutexGuiLeave

View File

@ -30,5 +30,6 @@ wxMediaCtrlPtr = wx.media.MediaCtrlPtr
wxPreMediaCtrl = wx.media.PreMediaCtrl
wxEVT_MEDIA_FINISHED = wx.media.wxEVT_MEDIA_FINISHED
wxEVT_MEDIA_STOP = wx.media.wxEVT_MEDIA_STOP
wxEVT_MEDIA_LOADED = wx.media.wxEVT_MEDIA_LOADED