From d7d20885836669d5d3e6acc2ac113876640505dc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 May 2017 20:51:24 +0200 Subject: [PATCH] Updated to wxPython 4 --- gooey/gui/imageutil.py | 6 +++--- gooey/gui/util/wx_util.py | 8 ++++---- gooey/gui/widgets/calender_dialog.py | 3 ++- gooey/gui/windows/footer.py | 1 - gooey/gui/windows/runtime_display_panel.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gooey/gui/imageutil.py b/gooey/gui/imageutil.py index 293cebd..9e46568 100644 --- a/gooey/gui/imageutil.py +++ b/gooey/gui/imageutil.py @@ -19,13 +19,13 @@ def resize_bitmap(parent, _bitmap, target_height): size of the top panel), while keeping aspect ratio in tact ''' - image = wx.ImageFromBitmap(_bitmap) + image = _bitmap.ConvertToImage() _width, _height = image.GetSize() if _height < target_height: - return wx.StaticBitmap(parent, -1, wx.BitmapFromImage(image)) + return wx.StaticBitmap(parent, -1, wx.Bitmap(image)) ratio = float(_width) / _height image = image.Scale(target_height * ratio, target_height, wx.IMAGE_QUALITY_HIGH) - return wx.StaticBitmap(parent, -1, wx.BitmapFromImage(image)) + return wx.StaticBitmap(parent, -1, wx.Bitmap(image)) diff --git a/gooey/gui/util/wx_util.py b/gooey/gui/util/wx_util.py index ab1189b..327bada 100644 --- a/gooey/gui/util/wx_util.py +++ b/gooey/gui/util/wx_util.py @@ -8,7 +8,7 @@ import wx def make_bold(statictext): pointsize = statictext.GetFont().GetPointSize() font = wx.Font(pointsize, wx.FONTFAMILY_DEFAULT, - wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) + wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False) statictext.SetFont(font) def dark_grey(statictext): @@ -18,15 +18,15 @@ def dark_grey(statictext): def h0(parent, label): text = wx.StaticText(parent, label=label) font_size = text.GetFont().GetPointSize() - font = wx.Font(font_size * 1.4, *(wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)) + font = wx.Font(font_size * 1.4, *(wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetFont(font) return text def h1(parent, label): - return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)) + return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) def h2(parent, label): - return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_NORMAL, False)) + return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)) def _header(parent, label, styles): text = wx.StaticText(parent, label=label) diff --git a/gooey/gui/widgets/calender_dialog.py b/gooey/gui/widgets/calender_dialog.py index 7bea498..40509cc 100644 --- a/gooey/gui/widgets/calender_dialog.py +++ b/gooey/gui/widgets/calender_dialog.py @@ -1,6 +1,7 @@ __author__ = 'Chris' import wx +import wx.adv from gooey.gui.util import wx_util @@ -12,7 +13,7 @@ class CalendarDlg(wx.Dialog): self.SetBackgroundColour('#ffffff') self.ok_button = wx.Button(self, wx.ID_OK, label='Ok') - self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROPDOWN) + self.datepicker = wx.adv.DatePickerCtrl(self, style=wx.adv.DP_DROPDOWN) vertical_container = wx.BoxSizer(wx.VERTICAL) vertical_container.AddSpacer(10) diff --git a/gooey/gui/windows/footer.py b/gooey/gui/windows/footer.py index 9f2d239..c58fe0a 100644 --- a/gooey/gui/windows/footer.py +++ b/gooey/gui/windows/footer.py @@ -5,7 +5,6 @@ Created on Dec 23, 2013 ''' import wx -import wx.animate from gooey.gui.pubsub import pub diff --git a/gooey/gui/windows/runtime_display_panel.py b/gooey/gui/windows/runtime_display_panel.py index 5680665..c3a8292 100644 --- a/gooey/gui/windows/runtime_display_panel.py +++ b/gooey/gui/windows/runtime_display_panel.py @@ -22,7 +22,7 @@ class RuntimeDisplay(wx.Panel): def set_font_style(self, style): pointsize = self.cmd_textbox.GetFont().GetPointSize() font = wx.Font(pointsize, style, - wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False) + wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False) self.cmd_textbox.SetFont(font) def _init_properties(self):