diff --git a/build.py b/build.py index 7269d959..ad5bc4a3 100755 --- a/build.py +++ b/build.py @@ -104,7 +104,7 @@ toolsURL = 'https://wxpython.org/Phoenix/tools' # MS Edge code and DLLs needed for the wxWEBVIEW_BACKEND_EDGE backend -MS_edge_version = '1.0.622.22' +MS_edge_version = '1.0.1185.39' MS_edge_url = 'https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/{}'.format(MS_edge_version) #--------------------------------------------------------------------------- diff --git a/buildtools/version.py b/buildtools/version.py index be7c0368..050966d7 100644 --- a/buildtools/version.py +++ b/buildtools/version.py @@ -62,5 +62,5 @@ VER_FLAGS = "a1" # wxPython release flags # The version numbers of wxWidgets to be used in the build wxVER_MAJOR = 3 wxVER_MINOR = 1 -wxVER_RELEASE = 5 # only used when wxVER_MINOR is an odd value +wxVER_RELEASE = 6 # only used when wxVER_MINOR is an odd value diff --git a/demo/AUI_DockingWindowMgr.py b/demo/AUI_DockingWindowMgr.py index db2201c0..f5c8226d 100644 --- a/demo/AUI_DockingWindowMgr.py +++ b/demo/AUI_DockingWindowMgr.py @@ -157,18 +157,18 @@ class PyAUIFrame(wx.Frame): tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb1.SetToolBitmapSize(wx.Size(48,48)) - tb1.AddTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) + tb1.AddTool(101, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_ERROR)) tb1.AddSeparator() - tb1.AddTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) - tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) - tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) - tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) + tb1.AddTool(102, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_QUESTION)) + tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_INFORMATION)) + tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_WARNING)) + tb1.AddTool(103, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_MISSING_IMAGE)) tb1.Realize() tb2 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb2.SetToolBitmapSize(wx.Size(16,16)) - tb2_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_QUESTION, wx.ART_OTHER, wx.Size(16, 16)) + tb2_bmp1 = wx.ArtProvider.GetBitmapBundle(wx.ART_QUESTION, wx.ART_OTHER, wx.Size(16, 16)) tb2.AddTool(101, "Test", tb2_bmp1) tb2.AddTool(101, "Test", tb2_bmp1) tb2.AddTool(101, "Test", tb2_bmp1) @@ -186,7 +186,7 @@ class PyAUIFrame(wx.Frame): tb3 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb3.SetToolBitmapSize(wx.Size(16,16)) - tb3_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16)) + tb3_bmp1 = wx.ArtProvider.GetBitmapBundle(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16, 16)) tb3.AddTool(101, "Test", tb3_bmp1) tb3.AddTool(101, "Test", tb3_bmp1) tb3.AddTool(101, "Test", tb3_bmp1) @@ -199,7 +199,7 @@ class PyAUIFrame(wx.Frame): tb4 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) tb4.SetToolBitmapSize(wx.Size(16,16)) - tb4_bmp1 = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16)) + tb4_bmp1 = wx.ArtProvider.GetBitmapBundle(wx.ART_NORMAL_FILE, wx.ART_OTHER, wx.Size(16, 16)) tb4.AddTool(101, "Item 1", tb4_bmp1) tb4.AddTool(101, "Item 2", tb4_bmp1) tb4.AddTool(101, "Item 3", tb4_bmp1) @@ -214,12 +214,12 @@ class PyAUIFrame(wx.Frame): tb5 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_VERTICAL) tb5.SetToolBitmapSize(wx.Size(48, 48)) - tb5.AddTool(101, "Test", wx.ArtProvider.GetBitmap(wx.ART_ERROR)) + tb5.AddTool(101, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_ERROR)) tb5.AddSeparator() - tb5.AddTool(102, "Test", wx.ArtProvider.GetBitmap(wx.ART_QUESTION)) - tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_INFORMATION)) - tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_WARNING)) - tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmap(wx.ART_MISSING_IMAGE)) + tb5.AddTool(102, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_QUESTION)) + tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_INFORMATION)) + tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_WARNING)) + tb5.AddTool(103, "Test", wx.ArtProvider.GetBitmapBundle(wx.ART_MISSING_IMAGE)) tb5.Realize() # add a bunch of panes @@ -767,7 +767,7 @@ class SizeReportCtrl(wx.Control): dc.SetPen(wx.LIGHT_GREY_PEN) dc.DrawLine(0, 0, size.x, size.y) dc.DrawLine(0, size.y, size.x, 0) - dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)) + dc.DrawText(s, int((size.x-w)/2), int((size.y-(height*5))/2)) if self._mgr: @@ -775,19 +775,19 @@ class SizeReportCtrl(wx.Control): s = ("Layer: %d")%pi.dock_layer w, h = dc.GetTextExtent(s) - dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*1)) + dc.DrawText(s, int((size.x-w)/2), int(((size.y-(height*5))/2)+(height*1))) s = ("Dock: %d Row: %d")%(pi.dock_direction, pi.dock_row) w, h = dc.GetTextExtent(s) - dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*2)) + dc.DrawText(s, int((size.x-w)/2), int(((size.y-(height*5))/2)+(height*2))) s = ("Position: %d")%pi.dock_pos w, h = dc.GetTextExtent(s) - dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*3)) + dc.DrawText(s, int((size.x-w)/2), int(((size.y-(height*5))/2)+(height*3))) s = ("Proportion: %d")%pi.dock_proportion w, h = dc.GetTextExtent(s) - dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*4)) + dc.DrawText(s, int((size.x-w)/2), int(((size.y-(height*5))/2)+(height*4))) def OnEraseBackground(self, event): @@ -1002,37 +1002,41 @@ class SettingsPanel(wx.Panel): return image.ConvertToBitmap() + def CreateColorBitmapBundle(self, c): + return wx.BitmapBundle(self.CreateColorBitmap(c)) + + def UpdateColors(self): bk = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_BACKGROUND_COLOUR) - self._background_color.SetBitmapLabel(self.CreateColorBitmap(bk)) + self._background_color.SetBitmapLabel(self.CreateColorBitmapBundle(bk)) cap = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR) - self._inactive_caption_color.SetBitmapLabel(self.CreateColorBitmap(cap)) + self._inactive_caption_color.SetBitmapLabel(self.CreateColorBitmapBundle(cap)) capgrad = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR) - self._inactive_caption_gradient_color.SetBitmapLabel(self.CreateColorBitmap(capgrad)) + self._inactive_caption_gradient_color.SetBitmapLabel(self.CreateColorBitmapBundle(capgrad)) captxt = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR) - self._inactive_caption_text_color.SetBitmapLabel(self.CreateColorBitmap(captxt)) + self._inactive_caption_text_color.SetBitmapLabel(self.CreateColorBitmapBundle(captxt)) acap = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_ACTIVE_CAPTION_COLOUR) - self._active_caption_color.SetBitmapLabel(self.CreateColorBitmap(acap)) + self._active_caption_color.SetBitmapLabel(self.CreateColorBitmapBundle(acap)) acapgrad = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR) - self._active_caption_gradient_color.SetBitmapLabel(self.CreateColorBitmap(acapgrad)) + self._active_caption_gradient_color.SetBitmapLabel(self.CreateColorBitmapBundle(acapgrad)) acaptxt = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR) - self._active_caption_text_color.SetBitmapLabel(self.CreateColorBitmap(acaptxt)) + self._active_caption_text_color.SetBitmapLabel(self.CreateColorBitmapBundle(acaptxt)) sash = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_SASH_COLOUR) - self._sash_color.SetBitmapLabel(self.CreateColorBitmap(sash)) + self._sash_color.SetBitmapLabel(self.CreateColorBitmapBundle(sash)) border = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_BORDER_COLOUR) - self._border_color.SetBitmapLabel(self.CreateColorBitmap(border)) + self._border_color.SetBitmapLabel(self.CreateColorBitmapBundle(border)) gripper = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_GRIPPER_COLOUR) - self._gripper_color.SetBitmapLabel(self.CreateColorBitmap(gripper)) + self._gripper_color.SetBitmapLabel(self.CreateColorBitmapBundle(gripper)) def OnPaneBorderSize(self, event): diff --git a/demo/BitmapButton.py b/demo/BitmapButton.py index d50dd63a..64e78206 100644 --- a/demo/BitmapButton.py +++ b/demo/BitmapButton.py @@ -46,7 +46,7 @@ class TestPanel(wx.Panel): # we need to make it be the same size as the primary image, so # grab a subsection of this new image cropped = img.GetSubImage((20, 20, bmp.GetWidth(), bmp.GetHeight())) - b.SetBitmapPressed(cropped.ConvertToBitmap()) + b.SetBitmapPressed(wx.BitmapBundle(cropped.ConvertToBitmap())) b.SetToolTip("This is a bitmap button with \nwx.NO_BORDER style.") self.Bind(wx.EVT_BUTTON, self.OnClick, b) diff --git a/demo/Button.py b/demo/Button.py index 268670da..5dfc5c21 100644 --- a/demo/Button.py +++ b/demo/Button.py @@ -30,7 +30,7 @@ class TestPanel(wx.Panel): "above or below the label.") self.Bind(wx.EVT_BUTTON, self.OnClick, b) - b.SetBitmap(images.Mondrian.Bitmap, + b.SetBitmap(wx.BitmapBundle(images.Mondrian.Bitmap), wx.LEFT # Left is the default, the image can be on the other sides too #wx.RIGHT #wx.TOP diff --git a/demo/ToggleButton.py b/demo/ToggleButton.py index 22d30151..0fffc22b 100644 --- a/demo/ToggleButton.py +++ b/demo/ToggleButton.py @@ -23,7 +23,7 @@ class TestPanel(wx.Panel): panel.Move((50,50)) b = wx.ToggleButton(self, -1, "can have bitmaps too", pos=(50,125)) - b.SetBitmap(images.Mondrian.Bitmap) + b.SetBitmap(wx.BitmapBundle(images.Mondrian.Bitmap)) b.SetInitialSize() # adjust default size for the bitmap self.Bind(wx.EVT_TOGGLEBUTTON, self.OnToggle, b) diff --git a/demo/ToolBar.py b/demo/ToolBar.py index be62549f..3146b0a3 100644 --- a/demo/ToolBar.py +++ b/demo/ToolBar.py @@ -86,36 +86,38 @@ class TestToolBar(wx.Frame): self.CreateStatusBar() tsize = (24,24) - new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, tsize) - 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) + new_bmp = wx.ArtProvider.GetBitmapBundle(wx.ART_NEW, wx.ART_TOOLBAR, tsize) + open_bmp = wx.ArtProvider.GetBitmapBundle(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, tsize) + copy_bmp = wx.ArtProvider.GetBitmapBundle(wx.ART_COPY, wx.ART_TOOLBAR, tsize) + paste_bmp= wx.ArtProvider.GetBitmapBundle(wx.ART_PASTE, wx.ART_TOOLBAR, tsize) + null_bmp = wx.BitmapBundle(wx.NullBitmap) tb.SetToolBitmapSize(tsize) #tb.AddTool(10, new_bmp, "New", "Long help for 'New'") - tb.AddTool(10, "New", new_bmp, wx.NullBitmap, wx.ITEM_NORMAL, "New", "Long help for 'New'", None) + tb.AddTool(10, "New", new_bmp, null_bmp, wx.ITEM_NORMAL, "New", "Long help for 'New'", None) self.Bind(wx.EVT_TOOL, self.OnToolClick, id=10) self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick, id=10) #tb.AddTool(20, open_bmp, "Open", "Long help for 'Open'") - tb.AddTool(20, "Open", open_bmp, wx.NullBitmap, wx.ITEM_NORMAL, "Open", "Long help for 'Open'", None) + tb.AddTool(20, "Open", open_bmp, null_bmp, wx.ITEM_NORMAL, "Open", "Long help for 'Open'", None) self.Bind(wx.EVT_TOOL, self.OnToolClick, id=20) self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick, id=20) tb.AddSeparator() - tb.AddTool(30, "Copy", copy_bmp, wx.NullBitmap, wx.ITEM_NORMAL, "Copy", "Long help for 'Copy'", None) + tb.AddTool(30, "Copy", copy_bmp, null_bmp, wx.ITEM_NORMAL, "Copy", "Long help for 'Copy'", None) self.Bind(wx.EVT_TOOL, self.OnToolClick, id=30) self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick, id=30) - tb.AddTool(40, "Paste", paste_bmp, wx.NullBitmap, wx.ITEM_NORMAL, "Paste", "Long help for 'Paste'", None) + tb.AddTool(40, "Paste", paste_bmp, null_bmp, wx.ITEM_NORMAL, "Paste", "Long help for 'Paste'", None) self.Bind(wx.EVT_TOOL, self.OnToolClick, id=40) self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick, id=40) tb.AddSeparator() #tool = tb.AddCheckTool(50, images.Tog1.GetBitmap(), shortHelp="Toggle this") - tool = tb.AddTool(50, "Checkable", images.Tog1.GetBitmap(), + tool = tb.AddTool(50, "Checkable", + wx.BitmapBundle(images.Tog1.GetBitmap()), shortHelp="Toggle this", kind=wx.ITEM_CHECK) self.Bind(wx.EVT_TOOL, self.OnToolClick, id=50) diff --git a/demo/Wizard.py b/demo/Wizard.py index b4279947..4a239fe0 100644 --- a/demo/Wizard.py +++ b/demo/Wizard.py @@ -148,7 +148,7 @@ class TestPanel(wx.Panel): def OnRunSimpleWizard(self, evt): # Create the wizard and the pages - wizard = wiz(self, -1, "Simple Wizard", images.WizTest1.GetBitmap()) + wizard = wiz(self, -1, "Simple Wizard", wx.BitmapBundle(images.WizTest1.GetBitmap())) page1 = TitledPage(wizard, "Page 1") page2 = TitledPage(wizard, "Page 2") page3 = TitledPage(wizard, "Page 3") @@ -181,7 +181,7 @@ wxWizardPageSimple class can easily be used for the pages.""")) #wizard.SetExtraStyle(wx.WIZARD_EX_HELPBUTTON) #wizard.Create(self, self.ID_wiz, "Simple Wizard", # images.WizTest1.GetBitmap()) - wizard = wiz(self, -1, "Dynamic Wizard", images.WizTest1.GetBitmap()) + wizard = wiz(self, -1, "Dynamic Wizard", wx.BitmapBundle(images.WizTest1.GetBitmap())) page1 = TitledPage(wizard, "Page 1") page2 = SkipNextPage(wizard, "Page 2") diff --git a/demo/agw/AUI.py b/demo/agw/AUI.py index b38313c8..a71c2b4e 100644 --- a/demo/agw/AUI.py +++ b/demo/agw/AUI.py @@ -621,40 +621,44 @@ class SettingsPanel(wx.Panel): return image.ConvertToBitmap() + def CreateColourBitmapBundle(self, c): + return wx.BitmapBundle(self.CreateColourBitmap(c)) + + def UpdateColours(self): bk = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_BACKGROUND_COLOUR) - self._background_colour.SetBitmapLabel(self.CreateColourBitmap(bk)) + self._background_colour.SetBitmapLabel(self.CreateColourBitmapBundle(bk)) cap = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR) - self._inactive_caption_colour.SetBitmapLabel(self.CreateColourBitmap(cap)) + self._inactive_caption_colour.SetBitmapLabel(self.CreateColourBitmapBundle(cap)) capgrad = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR) - self._inactive_caption_gradient_colour.SetBitmapLabel(self.CreateColourBitmap(capgrad)) + self._inactive_caption_gradient_colour.SetBitmapLabel(self.CreateColourBitmapBundle(capgrad)) captxt = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR) - self._inactive_caption_text_colour.SetBitmapLabel(self.CreateColourBitmap(captxt)) + self._inactive_caption_text_colour.SetBitmapLabel(self.CreateColourBitmapBundle(captxt)) acap = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_ACTIVE_CAPTION_COLOUR) - self._active_caption_colour.SetBitmapLabel(self.CreateColourBitmap(acap)) + self._active_caption_colour.SetBitmapLabel(self.CreateColourBitmapBundle(acap)) acapgrad = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR) - self._active_caption_gradient_colour.SetBitmapLabel(self.CreateColourBitmap(acapgrad)) + self._active_caption_gradient_colour.SetBitmapLabel(self.CreateColourBitmapBundle(acapgrad)) acaptxt = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR) - self._active_caption_text_colour.SetBitmapLabel(self.CreateColourBitmap(acaptxt)) + self._active_caption_text_colour.SetBitmapLabel(self.CreateColourBitmapBundle(acaptxt)) sash = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_SASH_COLOUR) - self._sash_colour.SetBitmapLabel(self.CreateColourBitmap(sash)) + self._sash_colour.SetBitmapLabel(self.CreateColourBitmapBundle(sash)) border = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_BORDER_COLOUR) - self._border_colour.SetBitmapLabel(self.CreateColourBitmap(border)) + self._border_colour.SetBitmapLabel(self.CreateColourBitmapBundle(border)) gripper = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_GRIPPER_COLOUR) - self._gripper_colour.SetBitmapLabel(self.CreateColourBitmap(gripper)) + self._gripper_colour.SetBitmapLabel(self.CreateColourBitmapBundle(gripper)) hint = self._frame.GetDockArt().GetColour(aui.AUI_DOCKART_HINT_WINDOW_COLOUR) - self._hint_colour.SetBitmapLabel(self.CreateColourBitmap(hint)) + self._hint_colour.SetBitmapLabel(self.CreateColourBitmapBundle(hint)) def OnPaneBorderSize(self, event): diff --git a/demo/agw/BalloonTip.py b/demo/agw/BalloonTip.py index 0e51ed85..3fa3e513 100644 --- a/demo/agw/BalloonTip.py +++ b/demo/agw/BalloonTip.py @@ -119,7 +119,7 @@ class BalloonTipDemo(wx.Frame): button2 = wx.Button(panel, -1, "Disable BalloonTip") tbicon = TaskBarIcon() - tbicon.SetIcon(images.Mondrian.GetIcon()) + tbicon.SetIcon(wx.BitmapBundle(images.Mondrian.GetIcon())) controls = list(panel.GetChildren()) controls.append(tbicon) diff --git a/docs/sphinx/itemToModuleMap.json b/docs/sphinx/itemToModuleMap.json index 7cbd105e..80caca1c 100644 --- a/docs/sphinx/itemToModuleMap.json +++ b/docs/sphinx/itemToModuleMap.json @@ -2630,7 +2630,7 @@ "ObjectRefData":"wx.", "OperatingSystemId":"wx.", "Orientation":"wx.", -"Origin":"wx.grid.GridActivationSource.", +"Origin":"wx.HelpEvent.", "OutBottom":"wx.", "OutCode":"wx.", "OutLeft":"wx.", @@ -3582,6 +3582,7 @@ "RichTextImageBlock":"wx.richtext.", "RichTextLine":"wx.richtext.", "RichTextLineBreakChar":"wx.richtext.", +"RichTextLineVector":"wx.richtext.", "RichTextListStyleDefinition":"wx.richtext.", "RichTextModuleInit":"wx.richtext.", "RichTextObject":"wx.richtext.", diff --git a/etg/_core.py b/etg/_core.py index 9bf82d21..220c1371 100644 --- a/etg/_core.py +++ b/etg/_core.py @@ -49,6 +49,7 @@ INCLUDES = [ # base and core stuff 'userdata', 'wxpybuffer', 'msgdlg_btnlabel', + 'wxvector', 'stockgdi', 'longlong', @@ -76,6 +77,7 @@ INCLUDES = [ # base and core stuff 'image', 'gdiobj', 'bitmap', + 'bmpbndl', 'icon', 'iconloc', 'iconbndl', 'font', 'fontutil', diff --git a/etg/_stc.py b/etg/_stc.py index 50d38433..bcf8b55f 100644 --- a/etg/_stc.py +++ b/etg/_stc.py @@ -152,6 +152,7 @@ def run(): tc_excludes = ['OSXEnableAutomaticQuoteSubstitution', 'OSXEnableAutomaticDashSubstitution', 'OSXDisableAllSmartSubstitutions', + 'OSXEnableNewLineReplacement', ] import textctrl mod = textctrl.parseAndTweakModule() diff --git a/etg/app.py b/etg/app.py index ccb4cb6c..bd2ef2ae 100644 --- a/etg/app.py +++ b/etg/app.py @@ -10,6 +10,7 @@ import etgtools import etgtools.tweaker_tools as tools from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef +import sys PACKAGE = "wx" MODULE = "_core" @@ -206,6 +207,8 @@ def run(): c.addProperty('UseBestVisual GetUseBestVisual SetUseBestVisual') c.addProperty('TopWindow GetTopWindow SetTopWindow') + if sys.platform != 'linux': + c.find('GTKSuppressDiagnostics').ignore() #------------------------------------------------------- diff --git a/etg/bmpbndl.py b/etg/bmpbndl.py new file mode 100644 index 00000000..a166b576 --- /dev/null +++ b/etg/bmpbndl.py @@ -0,0 +1,58 @@ +#--------------------------------------------------------------------------- +# Name: etg/bmpbndl.py +# Author: Scott Talbert +# +# Created: 13-Apr-2022 +# Copyright: (c) 2022 by Scott Talbert +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools +from etgtools import MethodDef + +PACKAGE = "wx" +MODULE = "_core" +NAME = "bmpbndl" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ 'wxBitmapBundle', + 'wxBitmapBundleImpl', + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + #module.addHeaderCode('#include ') + + c = module.find('wxBitmapBundle') + assert isinstance(c, etgtools.ClassDef) + + c.find('FromSVG').findOverload('char *data, const wxSize &sizeDef').ignore() + + + c = module.find('wxBitmapBundleImpl') + assert isinstance(c, etgtools.ClassDef) + + m = MethodDef(name='~wxBitmapBundleImpl', isDtor=True, isVirtual=True, protection='protected') + c.addItem(m) + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/etg/cursor.py b/etg/cursor.py index 5e221fe9..f957358b 100644 --- a/etg/cursor.py +++ b/etg/cursor.py @@ -45,6 +45,7 @@ def run(): c.find('wxCursor').findOverload('cursorName').find('type').default='wxBITMAP_TYPE_ANY' # TODO: This ctor ^^ in Classic has a custom implementation for wxGTK that # sets the hotspot. Is that still needed? + c.find('wxCursor').findOverload('(const char *const *xpmData)').ignore() c.addCppMethod('int', '__nonzero__', '()', "return self->IsOk();") c.addCppMethod('int', '__bool__', '()', "return self->IsOk();") diff --git a/etg/dataview.py b/etg/dataview.py index 80eade26..fdfb4e1a 100644 --- a/etg/dataview.py +++ b/etg/dataview.py @@ -344,7 +344,7 @@ def run(): c.addItem(etgtools.WigCode("""\ virtual void SetTitle(const wxString& title); virtual wxString GetTitle() const; - virtual void SetBitmap(const wxBitmap& bitmap); + virtual void SetBitmap(const wxBitmapBundle& bitmap); virtual wxBitmap GetBitmap() const; virtual void SetWidth(int width); virtual int GetWidth() const; diff --git a/etg/defs.py b/etg/defs.py index 167e0726..4445cf93 100644 --- a/etg/defs.py +++ b/etg/defs.py @@ -110,6 +110,9 @@ def run(): module.addPyCode("ADJUST_MINSIZE = 0") module.addPyCode("WS_EX_VALIDATE_RECURSIVELY = 0") + # This is only supported with C++14, so ignore it for now + module.find('wxDEPRECATED_ATTR').ignore() + #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/event.py b/etg/event.py index 4a5c30e1..5f79d888 100644 --- a/etg/event.py +++ b/etg/event.py @@ -100,6 +100,11 @@ def run(): #endif """) + # Missing in 3.1.6 + module.addItem(etgtools.WigCode("""\ + wxEventType wxEVT_FULLSCREEN /PyName=wxEVT_FULLSCREEN/; + """)) + module.addPyClass('PyEventBinder', ['object'], doc="""\ diff --git a/etg/gdicmn.py b/etg/gdicmn.py index 04ca3693..f182266a 100644 --- a/etg/gdicmn.py +++ b/etg/gdicmn.py @@ -155,6 +155,9 @@ def run(): c.find('operator*=').all() + \ c.find('operator/=').all(): f.ignore(False) + # Ignore these because they conflict with __imul__() and __itruediv__() + c.find('operator*=').findOverload('double').ignore() + c.find('operator/=').findOverload('double').ignore() c.addCppMethod('bool', '__eq__', '(const wxSize& other)', body="return *self == *other;") diff --git a/etg/htmlwin.py b/etg/htmlwin.py index 1023e751..fd902921 100644 --- a/etg/htmlwin.py +++ b/etg/htmlwin.py @@ -73,7 +73,7 @@ def run(): virtual wxWindow* GetHTMLWindow(); virtual wxColour GetHTMLBackgroundColour() const; virtual void SetHTMLBackgroundColour(const wxColour& clr); - virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg); + virtual void SetHTMLBackgroundImage(const wxBitmapBundle& bmpBg); virtual void SetHTMLStatusText(const wxString& text); virtual wxCursor GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor type) const; """)) diff --git a/etg/icon.py b/etg/icon.py index 2733ddd6..6b1faf23 100644 --- a/etg/icon.py +++ b/etg/icon.py @@ -79,6 +79,9 @@ def run(): #endif """) + # Documented wrongly in 3.1.6 + c.find('GetLogicalSize').type = 'wxSize' + # For compatibility: module.addPyFunction('EmptyIcon', '()', diff --git a/etg/listctrl.py b/etg/listctrl.py index d25171da..6362b866 100644 --- a/etg/listctrl.py +++ b/etg/listctrl.py @@ -333,6 +333,10 @@ def run(): #endif """) + # Documented wrongly in 3.1.6 + c.find('RemoveSortIndicator').type = 'void' + c.find('RemoveSortIndicator').isConst = False + #------------------------------------------------------- c = module.find('wxListView') diff --git a/etg/menuitem.py b/etg/menuitem.py index b2f620b4..ac6cdb38 100644 --- a/etg/menuitem.py +++ b/etg/menuitem.py @@ -109,11 +109,12 @@ def run(): c.find('GetBitmap').type = 'const wxBitmap*' + c.find('GetBitmap').transferBack = True c.find('GetBitmap').setCppCode("""\ #ifdef __WXMSW__ - return &self->GetBitmap(checked); + return new wxBitmap(self->GetBitmap(checked)); #else - return &self->GetBitmap(); + return new wxBitmap(self->GetBitmap()); #endif """) @@ -157,6 +158,10 @@ def run(): module.addItem(tools.wxListWrapperTemplate('wxMenuItemList', 'wxMenuItem', module)) + # Documented wrongly in 3.1.6 + c.find('AddExtraAccel.accel').isConst = True + c.find('AddExtraAccel.accel').type = 'wxAcceleratorEntry&' + #----------------------------------------------------------------- diff --git a/etg/pickers.py b/etg/pickers.py index 293602e6..3ff77fdc 100644 --- a/etg/pickers.py +++ b/etg/pickers.py @@ -219,7 +219,7 @@ def run(): # force a copy, in case the _colorData is shared self.colour = wx.Colour(colour) bmp = self._makeBitmap() - self.SetBitmapLabel(bmp) + self.SetBitmapLabel(wx.BitmapBundle(bmp)) def GetColour(self): return self.colour diff --git a/etg/richtextbuffer.py b/etg/richtextbuffer.py index aaaba858..dad166b1 100644 --- a/etg/richtextbuffer.py +++ b/etg/richtextbuffer.py @@ -79,8 +79,6 @@ def run(): tools.wxArrayWrapperTemplate('wxRichTextVariantArray', 'wxVariant', module)) module.addItem( tools.wxListWrapperTemplate('wxRichTextObjectList', 'wxRichTextObject', module)) - module.addItem( - tools.wxListWrapperTemplate('wxRichTextLineList', 'wxRichTextLine', module)) # Can this even work? Apparently it does. module.addItem( @@ -319,6 +317,21 @@ def run(): fakeListClassName='wxRichTextObjectList_')) c.find('MoveToList.list').type = 'wxRichTextObjectList_&' c.find('MoveFromList.list').type = 'wxRichTextObjectList_&' + # TODO: figure out why wxvector.sip doesn't work for this + c.find('GetLines').type = 'PyObject*' + c.find('GetLines').setCppCode("""\ + wxPyThreadBlocker blocker; + PyObject* result = PyList_New(0); + const wxRichTextLineVector& vector = self->GetLines(); + for (size_t idx=0; idx < vector.size(); idx++) {{ + PyObject* obj; + wxRichTextLine* item = new wxRichTextLine(*vector.at(idx)); + obj = wxPyConstructObject((void*)item, "wxRichTextLine", true); + PyList_Append(result, obj); + Py_DECREF(obj); + }} + return result; + """) #------------------------------------------------------- diff --git a/etg/textctrl.py b/etg/textctrl.py index 7f1c1fba..a590512e 100644 --- a/etg/textctrl.py +++ b/etg/textctrl.py @@ -9,6 +9,8 @@ # License: wxWindows License #--------------------------------------------------------------------------- +import sys + import etgtools import etgtools.tweaker_tools as tools @@ -144,6 +146,15 @@ def parseAndTweakModule(): #endif """) + # TODO: add support for wxTextProofOptions (only supported on MSW/GTK3) + # so will need stubs on other platforms. + c.find('EnableProofCheck').ignore() + c.find('GetProofCheckOptions').ignore() + + # This function only exists on OSX + if sys.platform != 'darwin': + c.find('OSXEnableNewLineReplacement').ignore() + c = module.find('wxTextUrlEvent') diff --git a/etg/treectrl.py b/etg/treectrl.py index 4b1d0a22..23945b60 100644 --- a/etg/treectrl.py +++ b/etg/treectrl.py @@ -150,7 +150,6 @@ def run(): # transfer imagelist ownership - c.find('AssignImageList.imageList').transfer = True c.find('AssignStateImageList.imageList').transfer = True c.find('AssignButtonsImageList.imageList').transfer = True diff --git a/etg/webview.py b/etg/webview.py index b4abb35c..6fec5045 100644 --- a/etg/webview.py +++ b/etg/webview.py @@ -91,6 +91,11 @@ def run(): # This tweak is needed only for the stub code module.find('wxWebViewHandler.wxWebViewHandler').argsString = '(const wxString& scheme="")' + # Documented wrongly in 3.1.6 (needs to be fixed in stubs too) + c = module.find('wxWebViewFactory') + c.find('GetVersionInfo').argsString = '()' + c.find('GetVersionInfo').items = [] + tools.generateStubs('wxUSE_WEBVIEW', module, typeValMap={ 'wxWebViewNavigationActionFlags': 'wxWEBVIEW_NAV_ACTION_NONE', @@ -98,6 +103,13 @@ def run(): 'wxVersionInfo': 'wxVersionInfo()', }) + # Missing in 3.1.6 + module.addItem(etgtools.WigCode("""\ + wxEventType wxEVT_WEBVIEW_FULLSCREEN_CHANGED /PyName=wxEVT_WEBVIEW_FULLSCREEN_CHANGED/; + wxEventType wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED /PyName=wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED/; + wxEventType wxEVT_WEBVIEW_SCRIPT_RESULT /PyName=wxEVT_WEBVIEW_SCRIPT_RESULT/; + """)) + c = module.find('wxWebView') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index e67975db..5b76888e 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -497,7 +497,6 @@ def addWindowVirtuals(klass): ('DoSetSize', 'void DoSetSize(int x, int y, int width, int height, int sizeFlags)'), ('DoSetClientSize', 'void DoSetClientSize(int width, int height)'), ('DoSetSizeHints', 'void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH )'), - ('DoGetBorderSize', 'wxSize DoGetBorderSize() const'), ('DoMoveWindow', 'void DoMoveWindow(int x, int y, int width, int height)'), ('DoSetWindowVariant', 'void DoSetWindowVariant( wxWindowVariant variant)'), ('GetDefaultBorder', 'wxBorder GetDefaultBorder() const'), diff --git a/ext/wxWidgets b/ext/wxWidgets index 204db7e7..19907924 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 204db7e76a8359ad76366de273e146d8566ac3e2 +Subproject commit 19907924842a9152b8ee5f03f117aed65193b964 diff --git a/src/wxvector.sip b/src/wxvector.sip new file mode 100644 index 00000000..16c0a943 --- /dev/null +++ b/src/wxvector.sip @@ -0,0 +1,106 @@ +//-------------------------------------------------------------------------- +// Name: wxvector.sip +// Purpose: MappedType for wxVector +// +// Author: Scott Talbert +// +// Created: 14-Apr-2022 +// Copyright: (c) 2022 by Scott Talbert +// Licence: wxWindows license +//-------------------------------------------------------------------------- + +template<_TYPE_> +%MappedType wxVector<_TYPE_> +{ + %ConvertFromTypeCode + PyObject *l = PyList_New(sipCpp->size()); + + if (!l) + return 0; + + for (int i = 0; i < sipCpp->size(); ++i) { + _TYPE_ *t = new _TYPE_(sipCpp->at(i)); + PyObject *tobj = sipConvertFromNewType(t, sipType__TYPE_, + sipTransferObj); + + if (!tobj) { + delete t; + Py_DECREF(l); + + return 0; + } + + PyList_SetItem(l, i, tobj); + } + + return l; + %End + + %ConvertToTypeCode + PyObject *iter = PyObject_GetIter(sipPy); + + if (!sipIsErr) { + PyErr_Clear(); + Py_XDECREF(iter); + + return (iter +#if PY_MAJOR_VERSION < 3 + && !PyString_Check(sipPy) +#endif + && !PyUnicode_Check(sipPy)); + } + + if (!iter) { + *sipIsErr = 1; + + return 0; + } + + wxVector<_TYPE_> *wv = new wxVector<_TYPE_>; + + for (Py_ssize_t i = 0; ; ++i) { + PyErr_Clear(); + PyObject *itm = PyIter_Next(iter); + + if (!itm) { + if (PyErr_Occurred()) { + delete wv; + Py_DECREF(iter); + *sipIsErr = 1; + + return 0; + } + + break; + } + + int state; + _TYPE_ *t = reinterpret_cast<_TYPE_ *>( + sipForceConvertToType(itm, sipType__TYPE_, sipTransferObj, + SIP_NOT_NONE, &state, sipIsErr)); + + if (*sipIsErr) { + PyErr_Format(PyExc_TypeError, + "index %zd has type '%s' but '_TYPE_' is expected", i, + sipPyTypeName(Py_TYPE(itm))); + + Py_DECREF(itm); + delete wv; + Py_DECREF(iter); + + return 0; + } + + wv->push_back(*t); + + sipReleaseType(t, sipType__TYPE_, state); + Py_DECREF(itm); + } + + Py_DECREF(iter); + + *sipCppPtr = wv; + + return sipGetState(sipTransferObj); + %End +}; \ No newline at end of file diff --git a/unittests/test_bannerwindow.py b/unittests/test_bannerwindow.py index 399f5825..924f9beb 100644 --- a/unittests/test_bannerwindow.py +++ b/unittests/test_bannerwindow.py @@ -12,7 +12,7 @@ class bannerwindow_Tests(wtc.WidgetTestCase): def test_bannerwindow1(self): banner = wx.adv.BannerWindow(self.frame, dir=wx.LEFT) - banner.SetBitmap(wx.Bitmap(pngFile)) + banner.SetBitmap(wx.BitmapBundle(wx.Bitmap(pngFile))) def test_bannerwindow2(self): banner = wx.adv.BannerWindow(self.frame, dir=wx.LEFT) diff --git a/unittests/test_bmpbndl.py b/unittests/test_bmpbndl.py new file mode 100644 index 00000000..db5a436c --- /dev/null +++ b/unittests/test_bmpbndl.py @@ -0,0 +1,32 @@ +import unittest +from unittests import wtc +import wx +import os + +icoFile = os.path.join(os.path.dirname(__file__), 'mondrian.ico') +pngFile = os.path.join(os.path.dirname(__file__), 'pointy.png') + +#--------------------------------------------------------------------------- + +class bmpbndl_Tests(wtc.WidgetTestCase): + + def test_BitmapBundleCtor1(self): + b1 = wx.BitmapBundle() + self.assertTrue( not b1.IsOk() ) + + def test_BitmapBundleCtor2(self): + b2 = wx.BitmapBundle(wx.Bitmap(5, 10, 32)) + self.assertTrue( b2.IsOk() ) + + def test_BitmapBundleCtor3(self): + b3 = wx.BitmapBundle(wx.Icon(icoFile)) + self.assertTrue( b3.IsOk() ) + + def test_BitmapBundleCtor4(self): + b4 = wx.BitmapBundle(wx.Image(pngFile)) + self.assertTrue( b4.IsOk() ) + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main() diff --git a/unittests/test_button.py b/unittests/test_button.py index 77e7b5e9..4ffc52c2 100644 --- a/unittests/test_button.py +++ b/unittests/test_button.py @@ -12,7 +12,7 @@ class ButtonTests(wtc.WidgetTestCase): def test_ButtonCtors(self): btn = wx.Button(self.frame, label='label') btn = wx.Button(self.frame, -1, 'label', (10,10), (100,-1), wx.BU_LEFT) - bmp = wx.Bitmap(pngFile) + bmp = wx.BitmapBundle(wx.Bitmap(pngFile)) btn.SetBitmap(bmp) def test_ButtonProperties(self): diff --git a/unittests/test_dataview.py b/unittests/test_dataview.py index 2a96ea45..2f7c07e3 100644 --- a/unittests/test_dataview.py +++ b/unittests/test_dataview.py @@ -87,7 +87,7 @@ class dataview_Tests(wtc.WidgetTestCase): def test_dataviewIconText2(self): icon = wx.Icon(pngFile) - dit = dv.DataViewIconText('Smile!', icon) + dit = dv.DataViewIconText('Smile!', wx.BitmapBundle(icon)) dit.Icon dit.Text diff --git a/unittests/test_headercol.py b/unittests/test_headercol.py index 98a03480..61ab1f23 100644 --- a/unittests/test_headercol.py +++ b/unittests/test_headercol.py @@ -14,9 +14,9 @@ class headercol_Tests(wtc.WidgetTestCase): def test_headercolCtor2(self): - bmp = wx.Bitmap(pngFile) + bmp = wx.BitmapBundle(wx.Bitmap(pngFile)) hc = wx.HeaderColumnSimple(bmp, flags=wx.COL_RESIZABLE) - hc.Bitmap + hc.BitmapBundle def test_headercolProperties(self): diff --git a/unittests/test_lib_agw_speedmeter.py b/unittests/test_lib_agw_speedmeter.py index cbc99276..13a06043 100644 --- a/unittests/test_lib_agw_speedmeter.py +++ b/unittests/test_lib_agw_speedmeter.py @@ -99,7 +99,7 @@ class lib_agw_speedmeter_Tests(wtc.WidgetTestCase): fgSizer.Add(panel1, 1, wx.EXPAND) boxSizer = wx.BoxSizer() - panel.SetSizer(boxSizer) + panel1.SetSizer(boxSizer) spW = SM.SpeedMeter(panel1, agwStyle=SM.SM_DRAW_HAND | SM.SM_DRAW_SECTORS | diff --git a/unittests/test_preferences.py b/unittests/test_preferences.py index 95ddc23c..a3c9c352 100644 --- a/unittests/test_preferences.py +++ b/unittests/test_preferences.py @@ -22,8 +22,8 @@ class preferences_Tests(wtc.WidgetTestCase): class MyPrefsPage(wx.PreferencesPage): def GetName(self): return 'MyPrefsPage' - def GetLargeIcon(self): - return wx.ArtProvider.GetBitmap(wx.ART_HELP, wx.ART_TOOLBAR, (32,32)) + def GetIcon(self): + return wx.ArtProvider.GetBitmapBundle(wx.ART_HELP, wx.ART_TOOLBAR) def CreateWindow(self, parent): return MyPrefsPanel(parent) diff --git a/unittests/test_richtextbuffer.py b/unittests/test_richtextbuffer.py index fb7e2b05..ef834171 100644 --- a/unittests/test_richtextbuffer.py +++ b/unittests/test_richtextbuffer.py @@ -238,7 +238,13 @@ class richtextbuffer_Tests(wtc.WidgetTestCase): o1 = wx.richtext.RichTextLine(None) def test_richtextbuffer26(self): - o1 = wx.richtext.RichTextLineList() + para = wx.richtext.RichTextParagraph() + para.AllocateLine(0) + para.AllocateLine(1) + lines = para.GetLines() + self.assertEqual(len(lines), 2) + for l in lines: + self.assertTrue(isinstance(l, wx.richtext.RichTextLine)) def test_richtextbuffer27(self): o1 = wx.richtext.RichTextParagraph() diff --git a/unittests/test_taskbar.py b/unittests/test_taskbar.py index 02c51e8a..f18284cd 100644 --- a/unittests/test_taskbar.py +++ b/unittests/test_taskbar.py @@ -12,7 +12,7 @@ class taskbar_Tests(wtc.WidgetTestCase): def test_taskbar1(self): icon = wx.adv.TaskBarIcon(wx.adv.TBI_DOCK) - icon.SetIcon(wx.Icon(icoFile), "The tip string") + icon.SetIcon(wx.BitmapBundle(wx.Icon(icoFile)), "The tip string") self.assertTrue(icon.IsOk()) icon.Destroy() self.myYield() diff --git a/unittests/test_tglbtn.py b/unittests/test_tglbtn.py index cef0a53b..2f717420 100644 --- a/unittests/test_tglbtn.py +++ b/unittests/test_tglbtn.py @@ -12,7 +12,7 @@ class tglbtn_Tests(wtc.WidgetTestCase): def test_tglbtnCtors(self): btn = wx.ToggleButton(self.frame, label='label') btn = wx.ToggleButton(self.frame, -1, 'label', (10,10), (100,-1), wx.BU_LEFT) - bmp = wx.Bitmap(pngFile) + bmp = wx.BitmapBundle(wx.Bitmap(pngFile)) btn.SetBitmap(bmp) diff --git a/unittests/test_toolbar.py b/unittests/test_toolbar.py index 4ba1089e..3a5f1eae 100644 --- a/unittests/test_toolbar.py +++ b/unittests/test_toolbar.py @@ -43,7 +43,7 @@ class toolbar_Tests(wtc.WidgetTestCase): tools = [] for bmp in bmps: - tool = tb.AddTool(-1, 'label', bmp) + tool = tb.AddTool(-1, 'label', wx.BitmapBundle(bmp)) self.assertTrue(isinstance(tool, wx.ToolBarToolBase)) tools.append(tool) tb.Realize() diff --git a/unittests/test_wizard.py b/unittests/test_wizard.py index eecceac4..2bf5248b 100644 --- a/unittests/test_wizard.py +++ b/unittests/test_wizard.py @@ -34,7 +34,7 @@ class wizard_Tests(wtc.WidgetTestCase): def test_wizard2(self): # Create the wizard - bmp = wx.Bitmap(pngFile) + bmp = wx.BitmapBundle(wx.Bitmap(pngFile)) wiz = wx.adv.Wizard(self.frame, title="Test Wizard 2", bitmap=bmp) # create the pages @@ -54,7 +54,7 @@ class wizard_Tests(wtc.WidgetTestCase): def test_wizard3(self): # Same as above but use the Chain function to connect the pages - bmp = wx.Bitmap(pngFile) + bmp = wx.BitmapBundle(wx.Bitmap(pngFile)) wiz = wx.adv.Wizard(self.frame, title="Test Wizard 2", bitmap=bmp) pages = [] @@ -74,7 +74,7 @@ class wizard_Tests(wtc.WidgetTestCase): def test_wizard4(self): # Create the wizard - bmp = wx.Bitmap(pngFile) + bmp = wx.BitmapBundle(wx.Bitmap(pngFile)) wiz = wx.adv.Wizard(self.frame, title="Test Wizard 2", bitmap=bmp) # create the pages diff --git a/unittests/test_wxdatetime.py b/unittests/test_wxdatetime.py index 6b4f5e3a..62e7d141 100644 --- a/unittests/test_wxdatetime.py +++ b/unittests/test_wxdatetime.py @@ -158,7 +158,7 @@ class datetime_Tests(wtc.WidgetTestCase): def test_datetimeParseDate3(self): d = wx.DateTime() val = d.ParseDate('10/25/2015 non-date text') - self.assertEqual(val, 13) + self.assertEqual(val, 10) def test_datetimeParseDateTime1(self): diff --git a/wx/lib/agw/infobar.py b/wx/lib/agw/infobar.py index 7e528a39..1b8ee9ef 100644 --- a/wx/lib/agw/infobar.py +++ b/wx/lib/agw/infobar.py @@ -381,8 +381,8 @@ class InfoBar(wx.Control): self._button = wx.BitmapButton(self, wx.ID_ANY, bmp, style=wx.BORDER_NONE) if wx.Platform != '__WXGTK__': - self._button.SetBitmapPressed(GetCloseButtonBitmap(self, sizeBmp, colBg, wx.CONTROL_PRESSED)) - self._button.SetBitmapCurrent(GetCloseButtonBitmap(self, sizeBmp, colBg, wx.CONTROL_CURRENT)) + self._button.SetBitmapPressed(wx.BitmapBundle(GetCloseButtonBitmap(self, sizeBmp, colBg, wx.CONTROL_PRESSED))) + self._button.SetBitmapCurrent(wx.BitmapBundle(GetCloseButtonBitmap(self, sizeBmp, colBg, wx.CONTROL_CURRENT))) self._button.SetBackgroundColour(colBg) self._button.SetToolTip(_("Hide this notification message.")) diff --git a/wx/lib/floatcanvas/NavCanvas.py b/wx/lib/floatcanvas/NavCanvas.py index fdd06427..4e24d150 100644 --- a/wx/lib/floatcanvas/NavCanvas.py +++ b/wx/lib/floatcanvas/NavCanvas.py @@ -119,7 +119,8 @@ class NavCanvas(wx.Panel): self.ModesDict = {} for Mode in Modes: tool = tb.AddTool(wx.ID_ANY, label=Mode[0], - shortHelp=Mode[0], bitmap=Mode[2], + shortHelp=Mode[0], + bitmap=wx.BitmapBundle(Mode[2]), kind=wx.ITEM_RADIO) self.Bind(wx.EVT_TOOL, self.SetMode, tool) self.ModesDict[tool.GetId()]=Mode[1] diff --git a/wx/lib/inspection.py b/wx/lib/inspection.py index 820c0cfa..eddf576c 100644 --- a/wx/lib/inspection.py +++ b/wx/lib/inspection.py @@ -208,15 +208,15 @@ class InspectionFrame(wx.Frame): tbar = self.CreateToolBar(wx.TB_HORIZONTAL | wx.TB_FLAT | wx.TB_TEXT | wx.NO_BORDER ) tbar.SetToolBitmapSize((24,24)) - refreshBmp = Refresh.GetBitmap() - findWidgetBmp = Find.GetBitmap() - showSizersBmp = ShowSizers.GetBitmap() - expandTreeBmp = ExpandTree.GetBitmap() - collapseTreeBmp = CollapseTree.GetBitmap() - highlightItemBmp = HighlightItem.GetBitmap() - evtWatcherBmp = EvtWatcher.GetBitmap() + refreshBmp = wx.BitmapBundle(Refresh.GetBitmap()) + findWidgetBmp = wx.BitmapBundle(Find.GetBitmap()) + showSizersBmp = wx.BitmapBundle(ShowSizers.GetBitmap()) + expandTreeBmp = wx.BitmapBundle(ExpandTree.GetBitmap()) + collapseTreeBmp = wx.BitmapBundle(CollapseTree.GetBitmap()) + highlightItemBmp = wx.BitmapBundle(HighlightItem.GetBitmap()) + evtWatcherBmp = wx.BitmapBundle(EvtWatcher.GetBitmap()) - toggleFillingBmp = ShowFilling.GetBitmap() + toggleFillingBmp = wx.BitmapBundle(ShowFilling.GetBitmap()) refreshTool = tbar.AddTool(-1, 'Refresh', refreshBmp, shortHelp = 'Refresh widget tree (F1)')