mirror of https://github.com/chriskiehl/Gooey.git
6 changed files with 118 additions and 46 deletions
Split View
Diff Options
-
39gooey/gui/imageutil.py
-
47gooey/gui/three_to_four.py
-
65gooey/gui/util/wx_util.py
-
5gooey/gui/widgets/calender_dialog.py
-
4gooey/gui/windows/runtime_display_panel.py
-
4setup.py
@ -0,0 +1,47 @@ |
|||
''' |
|||
Util for supporting WxPython 3 & 4 |
|||
''' |
|||
|
|||
import wx |
|||
try: |
|||
import wx.adv |
|||
except ImportError: |
|||
pass |
|||
|
|||
isLatestVersion = wx.version().startswith('4') |
|||
|
|||
|
|||
class Constants: |
|||
if isLatestVersion: |
|||
WX_FONTSTYLE_NORMAL = wx.FONTSTYLE_NORMAL |
|||
WX_DP_DROPDOWN = wx.adv.DP_DROPDOWN |
|||
else: |
|||
WX_FONTSTYLE_NORMAL = wx.FONTWEIGHT_NORMAL |
|||
WX_DP_DROPDOWN = wx.DP_DROPDOWN |
|||
|
|||
|
|||
class Classes: |
|||
if isLatestVersion: |
|||
DatePickerCtrl = wx.adv.DatePickerCtrl |
|||
else: |
|||
DatePickerCtrl = wx.DatePickerCtrl |
|||
|
|||
|
|||
|
|||
|
|||
def imageFromBitmap(bitmap): |
|||
if isLatestVersion: |
|||
return bitmap.ConvertToImage() |
|||
else: |
|||
return wx.ImageFromBitmap(bitmap) |
|||
|
|||
|
|||
def bitmapFromImage(image): |
|||
if isLatestVersion: |
|||
return wx.Bitmap(image) |
|||
else: |
|||
return wx.BitmapFromImage(image) |
|||
|
|||
|
|||
|
|||
|
Write
Preview
Loading…
Cancel
Save