From: Robin Dunn Date: Mon, 9 Jan 2006 21:09:57 +0000 (+0000) Subject: Merge #3 from the 2.6 branch, containing last set of changes before X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/486afba9a43f8389a6d5715c1f98739b998a3d0a Merge #3 from the 2.6 branch, containing last set of changes before the 2.6.2 release. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36806 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/GetMouseState.py b/wxPython/demo/GetMouseState.py index 0408e6f96b..c010c073dc 100644 --- a/wxPython/demo/GetMouseState.py +++ b/wxPython/demo/GetMouseState.py @@ -3,6 +3,18 @@ import wx #---------------------------------------------------------------------- +class StaticText(wx.StaticText): + """ + A StaticText that only updates the label if it has changed, to + help reduce potential flicker since these controls would be + updated very frequently otherwise. + """ + def SetLabel(self, label): + if label <> self.GetLabel(): + wx.StaticText.SetLabel(self, label) + +#---------------------------------------------------------------------- + class TestPanel(wx.Panel): def __init__(self, parent, log): self.log = log @@ -23,57 +35,57 @@ class TestPanel(wx.Panel): 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") + lbl = StaticText(self, -1, "X pos:") + self.x = 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") + lbl = StaticText(self, -1, "Y pos:") + self.y = 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") + lbl = StaticText(self, -1, "Left down:") + self.lft = 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") + lbl = StaticText(self, -1, "Middle Down:") + self.mid = 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") + lbl = StaticText(self, -1, "Right down:") + self.rgt = 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") + lbl = StaticText(self, -1, "Control down:") + self.ctrl = 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") + lbl = StaticText(self, -1, "Shift down:") + self.shft = 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") + lbl = StaticText(self, -1, "Alt down:") + self.alt = 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") + lbl = StaticText(self, -1, "Meta down:") + self.meta = 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") + lbl = StaticText(self, -1, "Cmd down:") + self.cmd = StaticText(self, -1, "False") fgs.Add(lbl) fgs.Add(self.cmd) @@ -114,7 +126,7 @@ overview = """ 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 +coordinates, as well as boolean values indicating the up/down status of the mouse buttons and the modifier keys. diff --git a/wxPython/demo/MDIWindows.py b/wxPython/demo/MDIWindows.py index 2f75d8e3dd..4fa3ad01df 100644 --- a/wxPython/demo/MDIWindows.py +++ b/wxPython/demo/MDIWindows.py @@ -35,12 +35,19 @@ class TestPanel(wx.Panel): exe, spawn = self.GetPyExecutable() spawn(os.P_NOWAIT, exe, exe, "MDISashDemo.py") - + # TODO: This hack can be removed once we fix the way the Python + # app bundles are generated so that they are not bundling and + # pointing to an otherwise unused and non-GUI-friendly version of + # Python on OS X. def GetPyExecutable(self): 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 + # an app bundle. But the bundle is always using a system + # framework so just hardcode the path to it. + if sys.version[:3] == "2.4": + return '/usr/local/bin/pythonw', os.spawnl + else: + return '/usr/bin/pythonw', os.spawnl else: return sys.executable, os.spawnl diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 0318a73e40..d0711e384f 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -53,6 +53,7 @@ _treeList = [ 'MultiSplitterWindow', 'Throbber', 'GetMouseState', + 'FloatCanvas', ]), # managed windows == things with a (optional) caption you can close @@ -161,12 +162,11 @@ _treeList = [ 'HtmlWindow', 'HyperLinkCtrl', 'IntCtrl', - 'MediaCtrl', - 'MultiSplitterWindow', 'MVCTree', 'MaskedEditControls', 'MaskedNumCtrl', - 'MimeTypesManager', + 'MediaCtrl', + 'MultiSplitterWindow', 'PyCrust', 'PyPlot', 'PyShell', @@ -233,7 +233,9 @@ _treeList = [ 'DrawXXXList', 'FileHistory', 'FontEnumerator', + 'GLCanvas', 'Joystick', + 'MimeTypesManager', 'MouseGestures', 'OGL', 'PrintFramework', @@ -243,11 +245,6 @@ _treeList = [ 'Unicode', ]), - # need libs not coming with the demo - ('Samples using an external library', [ - 'GLCanvas', - ]), - ('Check out the samples dir too', [ ]), diff --git a/wxPython/demo/MimeTypesManager.py b/wxPython/demo/MimeTypesManager.py index 30e852d5aa..7d3f1e9520 100644 --- a/wxPython/demo/MimeTypesManager.py +++ b/wxPython/demo/MimeTypesManager.py @@ -17,6 +17,13 @@ import pprint import wx import images + +# helper function to make sure we don't convert unicode objects to strings +# or vice versa when converting lists and None values to text. +convert = str +if 'unicode' in wx.PlatformInfo: + convert = unicode + #---------------------------------------------------------------------------- class MimeTypesDemoPanel(wx.Panel): @@ -199,8 +206,16 @@ class MimeTypesDemoPanel(wx.Panel): mtypes = wx.TheMimeTypesManager.EnumAllFileTypes() except wx.PyAssertionError: mtypes = [] + + # TODO: On wxMac, EnumAllFileTypes produces tons of dupes, which + # causes quirky behavior because the list control doesn't expect + # dupes, and simply wastes space. So remove the dupes for now, + # then remove this hack when we fix EnumAllFileTypes on Mac. + mimes = [] for mt in mtypes: - self.mimelist.Append(mt) + if mt not in mimes: + self.mimelist.Append(mt) + mimes.append(mt) # Do a lookup of *.wav for a starting position self.OnLookup() @@ -234,10 +249,10 @@ class MimeTypesDemoPanel(wx.Panel): # Select the entered value in the list if fileType: - if self.mimelist.FindString(str(fileType.GetMimeType())) != -1: + if self.mimelist.FindString(convert(fileType.GetMimeType())) != -1: # Using CallAfter to ensure that GUI is ready before trying to # select it (otherwise, it's selected but not visible) - wx.CallAfter(self.mimelist.SetSelection, self.mimelist.FindString(str(fileType.GetMimeType()))) + wx.CallAfter(self.mimelist.SetSelection, self.mimelist.FindString(convert(fileType.GetMimeType()))) if fileType is None: @@ -264,23 +279,23 @@ class MimeTypesDemoPanel(wx.Panel): bmp = images.getNoIconBitmap() self.icon.SetBitmap(bmp) self.iconsource.SetValue(file) - self.iconoffset.SetValue(str(idx)) + self.iconoffset.SetValue(convert(idx)) #------- MIME type - self.mimetype.SetValue(str(ft.GetMimeType())) + self.mimetype.SetValue(convert(ft.GetMimeType())) #------- MIME types - self.mimetypes.SetValue(str(ft.GetMimeTypes())) + self.mimetypes.SetValue(convert(ft.GetMimeTypes())) #------- Associated extensions - self.extensions.SetValue(str(ft.GetExtensions())) + self.extensions.SetValue(convert(ft.GetExtensions())) #------- Description of file type - self.description.SetValue(str(ft.GetDescription())) + self.description.SetValue(convert(ft.GetDescription())) #------- Prep a fake command line command extList = ft.GetExtensions() if extList: ext = extList[0] - if ext[0] == ".": ext = ext[1:] + if len(ext) > 0 and ext[0] == ".": ext = ext[1:] else: ext = "" @@ -289,11 +304,11 @@ class MimeTypesDemoPanel(wx.Panel): #------- OPEN command cmd = ft.GetOpenCommand(filename, mime) - self.opencommand.SetValue(str(cmd)) + self.opencommand.SetValue(convert(cmd)) #------- PRINT command cmd = ft.GetPrintCommand(filename, mime) - self.printcommand.SetValue(str(cmd)) + self.printcommand.SetValue(convert(cmd)) #------- All commands all = ft.GetAllCommands(filename, mime) diff --git a/wxPython/distrib/README.win32.txt b/wxPython/distrib/README.win32.txt index db7e8a33ef..69f7b239c5 100644 --- a/wxPython/distrib/README.win32.txt +++ b/wxPython/distrib/README.win32.txt @@ -12,15 +12,15 @@ page for more information about managing multiple installs: In addition to the wxPython modules, several tools scripts (such as XRCed and PyShell) and batch file launchers have been installed to -Python's Scripts directory. (For example, c:\Python23\Scripts.) IF +Python's Scripts directory. (For example, c:\Python23\Scripts.) If you have multiple versions of wxPython installed these tool scripts will use whichever is the default install. If you would like to control which version is used then follow the directions at the wiki page for using wxversion. This installer does *not* include the wxPython documentation, the -wxPython demo and other sample applications are provided as part of -wxPython. Those are available in a separate installer named +wxPython demo and other sample applications that are provided as part +of wxPython. Those are available in a separate installer named wxPython2.6-win32-docs-demos-*.exe which should also be located from wherever you downloaded this package from. The Docs and Demos installer will also create Start Menu shortcuts for the tool scripts diff --git a/wxPython/distrib/all/build-finalize b/wxPython/distrib/all/build-finalize index 601a221725..84d705527c 100755 --- a/wxPython/distrib/all/build-finalize +++ b/wxPython/distrib/all/build-finalize @@ -29,7 +29,7 @@ if [ $KIND = daily ]; then destdir=$UPLOAD_DAILY_ROOT/$DAILY echo "Copying to the starship at $destdir..." ssh $UPLOAD_HOST "mkdir -p $destdir" - scp $STAGING_DIR/* $UPLOAD_HOST:/$destdir + scp -p $STAGING_DIR/* $UPLOAD_HOST:/$destdir ssh $UPLOAD_HOST "cd $destdir && ls -al" @@ -79,7 +79,7 @@ if [ $KIND = release ]; then echo "Copying to the starship..." destdir=$UPLOAD_PREVIEW_ROOT/$VERSION ssh $UPLOAD_HOST "mkdir -p $destdir" - scp $STAGING_DIR/* $UPLOAD_HOST:/$destdir + scp -p $STAGING_DIR/* $UPLOAD_HOST:/$destdir # Send email to wxPython-dev DATE=`date` diff --git a/wxPython/docs/CHANGES.html b/wxPython/docs/CHANGES.html index 42b7ab270f..b2c91c1a7b 100644 --- a/wxPython/docs/CHANGES.html +++ b/wxPython/docs/CHANGES.html @@ -110,7 +110,7 @@ is useful, for example, if you would like to remove some output or errors or etc. from the buffer before doing a copy/paste. The free edit mode is designated by the use of a red, non-flashing caret. -
  • Ctrl-H will fold/unfold (hide/show) the selected lines.
  • +
  • Ctrl-Shift-F will fold/unfold (hide/show) the selected lines.
  • General code cleanup and fixes.
  • Use wx.StandardPaths to determine the location of the config files.
  • diff --git a/wxPython/docs/CHANGES.txt b/wxPython/docs/CHANGES.txt index b02a2de17f..8ccafeeb9b 100644 --- a/wxPython/docs/CHANGES.txt +++ b/wxPython/docs/CHANGES.txt @@ -159,7 +159,7 @@ tweaked and finished up by me. The changes include the following: The free edit mode is designated by the use of a red, non-flashing caret. - * Ctrl-H will fold/unfold (hide/show) the selected lines. + * Ctrl-Shift-F will fold/unfold (hide/show) the selected lines. * General code cleanup and fixes. diff --git a/wxPython/docs/PyManual.html b/wxPython/docs/PyManual.html index 7999362abc..ef13f79413 100644 --- a/wxPython/docs/PyManual.html +++ b/wxPython/docs/PyManual.html @@ -242,7 +242,7 @@ history. Bound to Shift-Return. 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. -
  • Ctrl-H will fold/unfold (hide/show) the selected lines.
  • +
  • Ctrl-Shift-F will fold/unfold (hide/show) the selected lines.
  • On top of these changes I (Robin Dunn) added the following: