diff --git a/CHANGES.rst b/CHANGES.rst index aa15336b..4cbd2ffd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -92,6 +92,8 @@ Changes in this release include the following: * Fix integer division bug in ultimatelistctrl. (#528) +* Fix bug in wx.SearchCtrl.SetCancelBitmap (#532) + diff --git a/build.py b/build.py index 0d061ab6..ad142e2a 100755 --- a/build.py +++ b/build.py @@ -1461,7 +1461,7 @@ def cmd_build_vagrant(options, args): VMs = [ 'centos-7', 'debian-8', 'fedora-23', - 'fedora-24', + 'fedora-26', 'ubuntu-14.04', 'ubuntu-16.04', ] diff --git a/etg/srchctrl.py b/etg/srchctrl.py index 4e9667f5..b4950176 100644 --- a/etg/srchctrl.py +++ b/etg/srchctrl.py @@ -58,7 +58,7 @@ def run(): """\ #ifdef __WXMAC__ #else - self->SetSearchMenuBitmap(*bmp); + self->SetCancelBitmap(*bmp); #endif """) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index a4ef4de6..ba93f0f8 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -229,7 +229,7 @@ def fixWindowClass(klass, hideVirtuals=True, ignoreProtected=True): """ Do common tweaks for a window class. """ - # NOTE: it may be okay to just do this for top-level windows + # NOTE: it may be okay to just do mustHaveApp for top-level windows # TODO: look into that possibility klass.mustHaveApp() @@ -261,6 +261,12 @@ def fixWindowClass(klass, hideVirtuals=True, ignoreProtected=True): removeVirtuals(klass) addWindowVirtuals(klass) + if not klass.findItem('GetClassDefaultAttributes'): + klass.addItem(extractors.WigCode("""\ + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + """)) + if not ignoreProtected: for item in klass.allItems(): if isinstance(item, extractors.MethodDef) and item.protection == 'protected': diff --git a/vagrant/README.rst b/vagrant/README.rst index 0c4d321a..1333584a 100644 --- a/vagrant/README.rst +++ b/vagrant/README.rst @@ -1,18 +1,19 @@ -Phoenix builds on various Linux distros with Vagrant -==================================================== +wxPython 4 builds on various Linux distros with Vagrant +======================================================= Vagrant (https://www.vagrantup.com/) is a tool that enables creating and using automated, relatively lightweight virtual environments. Vagrant and the Vagrant community provide several base images that are essentially simplistic bare-bones installs of various operating systems, that can be thought of as a bare canvas ready for provisioning with the needs of whatever applications -they will be used for. +they will be used for. The hosting platform can be Windows, Mac OSX, or Linux. -For Phoenix, this means that we can automate the creation and provisioning of +For wxPython, this means that we can automate the creation and provisioning of virtual Linux machines with all the packages installed that are needed for -building Phoenix. The subfodlers located in this folder contain the Vagrant -configurations and a bootstrap script for all of the Linux distros that we -currently support. +building wxPython 4. The each of the numbered subfolders located here contains +the Vagrant configuration and a bootstrap script for all of the Linux distros +that we currently support. As long as there is an existing vagrant "box" +available then adding support for new configurations is fairly simple. Setup diff --git a/vagrant/fedora-23/bootstrap.sh b/vagrant/fedora-23/bootstrap.sh index 366c2133..89ca4af8 100644 --- a/vagrant/fedora-23/bootstrap.sh +++ b/vagrant/fedora-23/bootstrap.sh @@ -15,16 +15,16 @@ dnf -y install gtk2 gtk2-devel gtk3 gtk3-devel \ SDL SDL-devel gstreamer gstreamer-devel gstreamer-plugins-base-devel \ freeglut freeglut-devel libnotify libnotify-devel libSM-devel -dnf -y install python35 # Install all available Python packages and their dev packages dnf -y install python python-tools python-devel python-virtualenv dnf -y install python34 python34-tools python34-devel dnf -y install python3 python3-tools python3-devel +dnf -y install python35 # Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. +# done. Set them to the vagrant user so the venv's can be updated by pip later. mkdir venvs virtualenv --python=python2.7 venvs/Py27 -pyvenv-3.4 venvs/Py34 -pyvenv-3.5 venvs/Py35 +python3.4 -m venv venvs/Py34 +python3.5 -m venv venvs/Py35 chown -R vagrant:vagrant venvs diff --git a/vagrant/fedora-24/Vagrantfile b/vagrant/fedora-26/Vagrantfile similarity index 94% rename from vagrant/fedora-24/Vagrantfile rename to vagrant/fedora-26/Vagrantfile index 05e7c702..a7062636 100644 --- a/vagrant/fedora-24/Vagrantfile +++ b/vagrant/fedora-26/Vagrantfile @@ -5,7 +5,7 @@ Vagrant.configure("2") do |config| # Set which Vagrant "box" (base image) to use, and tell it how to set up the # VM, packages to install, etc. - config.vm.box = "fedora/24-cloud-base" + config.vm.box = "fedora/26-cloud-base" config.vm.provision :shell, path: "bootstrap.sh" # Additional parameters for the VM diff --git a/vagrant/fedora-24/bootstrap.sh b/vagrant/fedora-26/bootstrap.sh similarity index 84% rename from vagrant/fedora-24/bootstrap.sh rename to vagrant/fedora-26/bootstrap.sh index 6a5352a6..2ab166cb 100644 --- a/vagrant/fedora-24/bootstrap.sh +++ b/vagrant/fedora-26/bootstrap.sh @@ -18,13 +18,13 @@ dnf -y install gtk2 gtk2-devel gtk3 gtk3-devel \ # Install all available Python packages and their dev packages dnf -y install python python-tools python-devel python2-virtualenv -#dnf -y install python34 python34-tools python34-devel dnf -y install python3 python3-tools python3-devel +dnf -y install python35 # Set up virtual environments for each Python where the Phoenix builds will be -# done. set them to the vagrant user so the venv's can be updated by pip later. +# done. Set them to the vagrant user so the venv's can be updated by pip later. mkdir venvs virtualenv --python=python2.7 venvs/Py27 -#pyvenv-3.4 venvs/Py34 -pyvenv-3.5 venvs/Py35 +python3.5 -m venv venvs/Py35 +python3.6 -m venv venvs/Py36 chown -R vagrant:vagrant venvs diff --git a/vagrant/scripts/build.sh b/vagrant/scripts/build.sh index e77105c0..ea9ae9ff 100755 --- a/vagrant/scripts/build.sh +++ b/vagrant/scripts/build.sh @@ -14,11 +14,15 @@ if [ "$NAME" == "" ]; then exit 1 fi -PYVER=$2 -if [ "$PYVER" == "" ]; then - PYVER=all +# This is the name of the virtual environment to be built. They should all be +# named like Py27, Py35, etc. If "all" is given then all the environments in +# ~/venvs will be used for a build. +PYENV=$2 +if [ "$PYENV" == "" ]; then + PYENV=all fi +# Either "gtk2", "gtk3" or "all" PORT=$3 if [ "$PORT" == "" ]; then PORT=all @@ -84,7 +88,7 @@ function do_build { # Do a build for each Python virtual environment in ~/venvs for VENV in ~/venvs/*; do - if [ $PYVER = all -o $PYVER = $(basename $VENV) ]; then + if [ $PYENV = all -o $PYENV = $(basename $VENV) ]; then # build a package for GTK2? if [ $PORT = all -o $PORT = gtk2 ]; then do_build $VENV gtk2 --gtk2 diff --git a/wx/lib/agw/aui/framemanager.py b/wx/lib/agw/aui/framemanager.py index c47e35dc..874a7fc5 100644 --- a/wx/lib/agw/aui/framemanager.py +++ b/wx/lib/agw/aui/framemanager.py @@ -1283,7 +1283,7 @@ class AuiPaneInfo(object): def Restore(self): """ Is the reverse of :meth:`Maximize` and :meth:`Minimize`.""" - return self.SetFlag(self.optionMaximized or self.optionMinimized, False) + return self.SetFlag(self.optionMaximized | self.optionMinimized, False) def Fixed(self): diff --git a/wx/lib/agw/ultimatelistctrl.py b/wx/lib/agw/ultimatelistctrl.py index 410d071e..fd6391ee 100644 --- a/wx/lib/agw/ultimatelistctrl.py +++ b/wx/lib/agw/ultimatelistctrl.py @@ -10147,7 +10147,7 @@ class UltimateListMainWindow(wx.ScrolledWindow): if self.InReportView(): if not self.HasAGWFlag(ULC_HAS_VARIABLE_ROW_HEIGHT): - current = y/self.GetLineHeight() + current = y // self.GetLineHeight() if current < count: newItem, flags = self.HitTestLine(current, x, y) if flags: diff --git a/wx/lib/plot/plotcanvas.py b/wx/lib/plot/plotcanvas.py index e1b7c20b..12eaa0a0 100644 --- a/wx/lib/plot/plotcanvas.py +++ b/wx/lib/plot/plotcanvas.py @@ -14,7 +14,6 @@ __docformat__ = "restructuredtext en" # Standard Library import sys -import string as _string import time as _time # Third-Party @@ -342,7 +341,7 @@ class PlotCanvas(wx.Panel): "png": wx.BITMAP_TYPE_PNG, # Save a PNG file. } - fType = _string.lower(fileName[-3:]) + fType = fileName[-3:].lower() dlg1 = None while fType not in extensions: @@ -369,12 +368,12 @@ class PlotCanvas(wx.Panel): ".", "", wildcard_str, - wx.SAVE | wx.OVERWRITE_PROMPT, + wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT, ) if dlg1.ShowModal() == wx.ID_OK: fileName = dlg1.GetPath() - fType = _string.lower(fileName[-3:]) + fType = fileName[-3:].lower() else: # exit without saving dlg1.Destroy() return False diff --git a/wx/lib/sized_controls.py b/wx/lib/sized_controls.py index d0d53878..755ccd10 100644 --- a/wx/lib/sized_controls.py +++ b/wx/lib/sized_controls.py @@ -599,29 +599,33 @@ class SizedParent: """ def AddChild(self, child): """ - Add a child to sizer + This extends the default wx.Window behavior to also add the child + to its parent's sizer, if one exists, and set default properties. + When an entire UI layout is managed via Sizers, this helps reduce + the amount of sizer boilerplate code that needs to be written. :param `child`: child (window or another sizer) to be added to sizer. :type `child`: :class:`wx.Window` or :class:`wx.Sizer` """ - # Note: The wx.LogNull is used here to suppress a log message - # on wxMSW that happens because when AddChild is called the - # widget's hwnd hasn't been set yet, so the GetWindowRect that - # happens as a result of sizer.Add (in wxSizerItem::SetWindow) - # fails. A better fix would be to defer this code somehow - # until after the child widget is fully constructed. sizer = self.GetSizer() - nolog = wx.LogNull() - item = sizer.Add(child) - del nolog - item.SetUserData({"HGrow":0, "VGrow":0}) + if sizer: + # Note: The wx.LogNull is used here to suppress a log message + # on wxMSW that happens because when AddChild is called the + # widget's hwnd hasn't been set yet, so the GetWindowRect that + # happens as a result of sizer.Add (in wxSizerItem::SetWindow) + # fails. A better fix would be to defer this code somehow + # until after the child widget is fully constructed. + nolog = wx.LogNull() + item = sizer.Add(child) + del nolog + item.SetUserData({"HGrow": 0, "VGrow": 0}) - # Note: One problem is that the child class given to AddChild - # is the underlying wxWidgets control, not its Python subclass. So if - # you derive your own class, and override that class' GetDefaultBorder(), - # etc. methods, it will have no effect. - child.SetDefaultSizerProps() + # Note: One problem is that the child class given to AddChild + # is the underlying wxWidgets control, not its Python subclass. So if + # you derive your own class, and override that class' GetDefaultBorder(), + # etc. methods, it will have no effect. + child.SetDefaultSizerProps() def GetSizerType(self): """