Revert "Revert "Merge branch 'master' into wx3"". So many reverts.

This reverts commit cca7f1112a.
This commit is contained in:
blitzmann
2015-06-27 19:46:49 -04:00
parent 6d01877d78
commit 5372f31be8
9 changed files with 39 additions and 37 deletions

View File

@@ -74,12 +74,9 @@ class ResistancesViewFull(StatsView):
# Display table
col = 0
row = 0
sizerResistances = wx.GridBagSizer(0, 0)
sizerResistances = wx.GridBagSizer()
contentSizer.Add( sizerResistances, 0, wx.EXPAND , 0)
for i in xrange(6):
sizerResistances.AddGrowableCol(i + 1)
# Add an empty label, then the rest.
sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ))
col+=1
@@ -95,6 +92,8 @@ class ResistancesViewFull(StatsView):
self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP)
for i in xrange(4):
sizerResistances.AddGrowableCol(i+1)
sizerResistances.Add(self.stEHPs, wx.GBPosition( row, col ), wx.GBSpan( 1, 1 ), wx.ALIGN_CENTER)
col=0

View File

@@ -52,7 +52,7 @@ class TargetingMiscViewFull(StatsView):
gridTargetingMisc.AddGrowableCol(2)
# Targeting
gridTargeting = wx.FlexGridSizer(4, 2)
gridTargeting = wx.FlexGridSizer(5, 2)
gridTargeting.AddGrowableCol(1)
gridTargetingMisc.Add(gridTargeting, 0, wx.ALIGN_LEFT | wx.ALL, 5)
@@ -77,7 +77,7 @@ class TargetingMiscViewFull(StatsView):
# Misc
gridTargetingMisc.Add( wx.StaticLine( contentPanel, wx.ID_ANY, style = wx.VERTICAL),0, wx.EXPAND, 3 )
gridMisc = wx.FlexGridSizer(4, 2)
gridMisc = wx.FlexGridSizer(5, 2)
gridMisc.AddGrowableCol(1)
gridTargetingMisc.Add(gridMisc,0 , wx.ALIGN_LEFT | wx.ALL, 5)

View File

@@ -27,7 +27,7 @@ class AmmoIcon(ViewColumn):
name = "Ammo Icon"
def __init__(self, fittingView, params):
ViewColumn.__init__(self, fittingView)
self.size = 16
self.size = 24
self.maxsize = self.size
self.mask = wx.LIST_MASK_IMAGE
self.columnText = ""

View File

@@ -8,7 +8,7 @@ class BaseIcon(ViewColumn):
name = "Base Icon"
def __init__(self, fittingView, params):
ViewColumn.__init__(self, fittingView)
self.size = 16
self.size = 24
self.maxsize = self.size
self.mask = wx.LIST_MASK_IMAGE
self.columnText = ""

View File

@@ -21,6 +21,7 @@ import wx
import wx.lib.newevent
import gui.utils.colorUtils as colorUtils
import gui.utils.drawUtils as drawUtils
import gui.utils.fonts as fonts
from gui import bitmapLoader
import gui.utils.fonts as fonts
@@ -671,6 +672,8 @@ class PFTabsContainer(wx.Panel):
"""
wx.Panel.__init__(self, parent, id, pos, size)
if wx.VERSION >= (3,0):
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
self.tabs = []
width, height = size

View File

@@ -146,7 +146,6 @@ class TogglePanel ( wx.Panel ):
else:
return True
def IsExpanded(self):
""" Returns ``True`` if the pane window is currently shown. """
if self._toggle == 1:
@@ -154,7 +153,6 @@ class TogglePanel ( wx.Panel ):
else:
return True
def OnStateChange(self, sz):
"""
Handles the status changes (collapsing/expanding).
@@ -168,9 +166,8 @@ class TogglePanel ( wx.Panel ):
self.parent.GetSizer().SetSizeHints(self.parent)
if self.IsCollapsed():
# expanded . collapsed transition
# expanded . collapsed transition
if self.parent.GetSizer():
# we have just set the size hints...
sz = self.parent.GetSizer().CalcMin()
@@ -178,39 +175,36 @@ class TogglePanel ( wx.Panel ):
# use SetClientSize() and not SetSize() otherwise the size for
# e.g. a wxFrame with a menubar wouldn't be correctly set
self.parent.SetClientSize(sz)
else:
self.parent.Layout()
else:
# collapsed . expanded transition
# force our parent to "fit", i.e. expand so that it can honour
# our minimal size
# collapsed . expanded transition
# force our parent to "fit", i.e. expand so that it can honour
# our minimal size
self.parent.Fit()
# Toggle the content panel (hide/show)
def toggleContent( self, event ):
def toggleContent(self, event):
self.Freeze()
print self.contentPanel.GetSize()
if self._toggle == 1:
self.contentMinSize = self.contentPanel.GetSize()
self.contentPanel.SetMinSize(wx.Size(self.contentMinSize[0],0))
self.headerBmp.SetBitmap( self.bmpCollapsed)
self.contentPanel.Hide()
self.headerBmp.SetBitmap(self.bmpCollapsed)
else:
self.contentPanel.SetMinSize(self.contentMinSize)
self.headerBmp.SetBitmap( self.bmpExpanded)
self._toggle *=-1
self.contentPanel.Show()
self.headerBmp.SetBitmap(self.bmpExpanded)
self._toggle *= -1
self.Layout()
self.Thaw()
if self.forceLayout == -1:
self.OnStateChange(self.GetBestSize())
if wx.VERSION >= (3, 0):
x, y = self.GetBestSize()
y -= self.contentPanel.GetSize()[1]
else:
x, y = self.GetBestSize()
self.OnStateChange((x, y))
else:
self.parent.Layout()
self.parent.Layout()

View File

@@ -15,6 +15,7 @@ import gui.utils.animEffects as animEffects
import gui.sfBrowserItem as SFItem
from gui.contextMenu import ContextMenu
import gui.utils.fonts as fonts
import service
import gui.utils.fonts as fonts

View File

@@ -1,3 +1,8 @@
'''
Font file to handle the differences in font calculations between
different wxPython versions
'''
import wx
if 'wxMac' in wx.PlatformInfo:

View File

@@ -31,7 +31,7 @@ if not hasattr(sys, 'frozen'):
try:
import wxversion
except ImportError:
print("Cannot find wxPython\nYou can download wxPython (2.8) from http://www.wxpython.org/")
print("Cannot find wxPython\nYou can download wxPython (2.8+) from http://www.wxpython.org/")
sys.exit(1)
# if user wants to force 2.8, try that and go directly to ensureMinimal path if fails
@@ -48,10 +48,10 @@ if not hasattr(sys, 'frozen'):
try:
wxversion.ensureMinimal('2.8')
except wxversion.VersionError:
print("Installed wxPython version doesn't meet requirements.\nYou can download wxPython (2.8) from http://www.wxpython.org/")
print "Installed wxPython version doesn't meet requirements.\nYou can download wxPython (2.8+) from http://www.wxpython.org/"
sys.exit(1)
else:
print("wxPython 2.8 not found; attempting to use newer version, expect errors")
print "wxPython 2.8 not found; attempting to use newer version, expect errors"
try:
import sqlalchemy