Browse Source

Updated to wxPython 4

wxpy3
unknown 7 years ago
committed by chriskiehl
parent
commit
d7d2088583
5 changed files with 10 additions and 10 deletions
  1. 6
      gooey/gui/imageutil.py
  2. 8
      gooey/gui/util/wx_util.py
  3. 3
      gooey/gui/widgets/calender_dialog.py
  4. 1
      gooey/gui/windows/footer.py
  5. 2
      gooey/gui/windows/runtime_display_panel.py

6
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))

8
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)

3
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)

1
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

2
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):

Loading…
Cancel
Save