diff --git a/CHANGES.rst b/CHANGES.rst index 3548fd2d..081f2978 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -80,6 +80,16 @@ Changes in this release include the following: broken and the saved reference is deleted after the timer expires and the callable has been called. (#457) + +* Although it's more or less just an implementation detail, add wrappers for + wx.aui.AuiTabCtrl so references to it will get the correct type. (#664) + +* List-like wrapper classes generated for accessing wxLists and wxArrays now + support reverse indexing. (#669) For example:: + + child = panel.GetChildren()[-1] + + * Ported some of the classes in Classic's gizmos module from C++ to Python, including LEDNumberCtrl, DynamicSashWindow, and TreeListCtrl. The classes are now located in the wx.lib.gizmos package, with a compatibility module at @@ -94,6 +104,7 @@ Changes in this release include the following: + 4.0.0b2 -- "Hurricanes, Floods, and Forest Fires! Oh My!" --------------------------------------------------------- * 16-Sept-2017 diff --git a/README.rst b/README.rst index 0f6d1f95..e6adcec7 100644 --- a/README.rst +++ b/README.rst @@ -350,15 +350,15 @@ or other unixes. * freeglut3 * freeglut3-dev * libsm-dev -* libgtk2.0-dev -* libwebkitgtk-dev - -If you are building for GTK3 then you'll also need these packages and -their dependencies: - * libgtk-3-dev * libwebkitgtk-3.0-dev +If you are building for GTK2 then you'll also need these packages and +their dependencies: + +* libgtk2.0-dev +* libwebkitgtk-dev + If your Linux distribution has gstreamer 1.0 available then you can install the dev packages for that instead of the 0.10 version. For example: diff --git a/build.py b/build.py index d9797541..411cde8e 100755 --- a/build.py +++ b/build.py @@ -1478,6 +1478,7 @@ def cmd_build_vagrant(options, args): 'debian-8', 'fedora-23', 'fedora-26', + 'fedora-27', 'ubuntu-14.04', 'ubuntu-16.04', ] diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index b8a13439..2ae2aa70 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -256,6 +256,7 @@ "AuiTabArt":"wx.aui.", "AuiTabContainer":"wx.aui.", "AuiTabContainerButton":"wx.aui.", +"AuiTabCtrl":"wx.aui.", "AuiToolBar":"wx.aui.", "AuiToolBarArt":"wx.aui.", "AuiToolBarArtSetting":"wx.aui.", diff --git a/etg/auibook.py b/etg/auibook.py index 26f58ebb..2b92b412 100644 --- a/etg/auibook.py +++ b/etg/auibook.py @@ -79,6 +79,25 @@ def run(): + #----------------------------------------------------------------- + # Add AuiTabCtrl in. + c = etgtools.ClassDef(name = "wxAuiTabCtrl", + bases = ["wxControl", "wxAuiTabContainer"], + mustHaveAppFlag = True, + items = [ + etgtools.MethodDef(name = "wxAuiTabCtrl", + classname="wxAuiTabCtrl", isCtor=True, + items = [ + etgtools.ParamDef(type = "wxWindow*", name = "parent"), + etgtools.ParamDef(type = "wxWindowID", name = "id", default="wxID_ANY"), + etgtools.ParamDef(type = "const wxPoint&", name = "pos", default = "wxDefaultPosition"), + etgtools.ParamDef(type = "const wxSize&", name = "size", default = "wxDefaultSize"), + etgtools.ParamDef(type = "long", name = "style", default = "0") ]), + etgtools.MethodDef(type = "bool", name = "IsDragging", classname = "wxAuiTabCtrl", isConst = True) + ]) + tools.fixWindowClass(c) + module.addItem(c) + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index f1299d61..6659fad3 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -873,9 +873,12 @@ public: sipRes = sipCpp->size(); %End - {ItemClass}* __getitem__(ulong index); + {ItemClass}* __getitem__(long index); %MethodCode - if (index < sipCpp->size()) {{ + if (0 > index) + index += sipCpp->size(); + + if (index < sipCpp->size() && (0 <= index)) {{ {ListClass}::compatibility_iterator node = sipCpp->Item(index); if (node) sipRes = ({ItemClass}*)node->GetData(); @@ -1001,9 +1004,12 @@ def wxArrayWrapperTemplate(ArrayClass, ItemClass, module, itemIsPtr=False, getIt if not getItemCopy: getitemMeth = '''\ - {ItemClass}{itemRef} __getitem__(ulong index); + {ItemClass}{itemRef} __getitem__(long index); %MethodCode - if (index < sipCpp->GetCount()) {{ + if (0 > index) + index += sipCpp->GetCount(); + + if ((index < sipCpp->GetCount()) && (0 <= index)) {{ sipRes = {addrOf}sipCpp->Item(index); }} else {{ @@ -1014,9 +1020,11 @@ def wxArrayWrapperTemplate(ArrayClass, ItemClass, module, itemIsPtr=False, getIt '''.format(**locals()) else: getitemMeth = '''\ - {ItemClass}* __getitem__(ulong index) /Factory/; + {ItemClass}* __getitem__(long index) /Factory/; %MethodCode - if (index < sipCpp->GetCount()) {{ + if (0 > index) + index += sipCpp->GetCount(); + if ((index < sipCpp->GetCount()) && (0 <= index)) {{ sipRes = new {ItemClass}(sipCpp->Item(index)); }} else {{ @@ -1090,9 +1098,12 @@ public: sipRes = sipCpp->GetCount(); %End - {ItemClass}* __getitem__(ulong index); + {ItemClass}* __getitem__(long index); %MethodCode - if (index < sipCpp->GetCount()) {{ + if (0 > index) + index += sipCpp->GetCount(); + + if ((index < sipCpp->GetCount()) && (0 <= index)) {{ sipRes = sipCpp->Item(index); }} else {{ diff --git a/vagrant/fedora-27/Vagrantfile b/vagrant/fedora-27/Vagrantfile new file mode 100644 index 00000000..b36fce0e --- /dev/null +++ b/vagrant/fedora-27/Vagrantfile @@ -0,0 +1,24 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +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/27-cloud-base" + config.vm.provision :shell, path: "bootstrap.sh" + + # Additional parameters for the VM + config.vm.provider "virtualbox" do |vb| + vb.memory = 4096 + vb.cpus = 4 + end + + # Share the Phoenix/dist folder so the VM can get the source tarball and has + # a place to put the build results. + config.vm.synced_folder "../../dist", "/home/vagrant/dist" + + # And share a folder with the build script + config.vm.synced_folder "../scripts", "/home/vagrant/scripts" + +end diff --git a/vagrant/fedora-27/bootstrap.sh b/vagrant/fedora-27/bootstrap.sh new file mode 100644 index 00000000..51ec63ae --- /dev/null +++ b/vagrant/fedora-27/bootstrap.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Set up and update package repos +dnf -y update +dnf -y install yum-utils + + +# Install necessary development tools, libs, etc. +dnf -y group install "Development Tools" +dnf -y install gcc-c++ + +dnf -y install gtk2 gtk2-devel gtk3 gtk3-devel \ + webkitgtk4 webkitgtk4-devel \ + libjpeg-turbo-devel libpng-devel libtiff-devel \ + SDL SDL-devel gstreamer gstreamer-devel gstreamer-plugins-base-devel \ + freeglut freeglut-devel libnotify libnotify-devel libSM-devel + + +# Install all available Python packages and their dev packages +dnf -y install python python-tools python-devel python2-virtualenv +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. +mkdir venvs +virtualenv --python=python2.7 venvs/Py27 +python3.5 -m venv venvs/Py35 +python3.6 -m venv venvs/Py36 +chown -R vagrant:vagrant venvs