Skip to content

Commit

Permalink
Revert "Revert "Merge branch 'master' into wx3"". So many reverts.
Browse files Browse the repository at this point in the history
This reverts commit cca7f11.
  • Loading branch information
blitzmann committed Jun 28, 2015
1 parent 6d01877 commit 5372f31
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 37 deletions.
7 changes: 3 additions & 4 deletions gui/builtinStatsViews/resistancesViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ def populatePanel(self, contentPanel, headerPanel):
# 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
Expand All @@ -95,6 +92,8 @@ def populatePanel(self, contentPanel, headerPanel):

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
Expand Down
4 changes: 2 additions & 2 deletions gui/builtinStatsViews/targetingMiscViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def populatePanel(self, contentPanel, headerPanel):
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)
Expand All @@ -77,7 +77,7 @@ def populatePanel(self, contentPanel, headerPanel):

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

Expand Down
2 changes: 1 addition & 1 deletion gui/builtinViewColumns/ammoIcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
2 changes: 1 addition & 1 deletion gui/builtinViewColumns/baseIcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
3 changes: 3 additions & 0 deletions gui/chromeTabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
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

Expand Down Expand Up @@ -671,6 +672,8 @@ def __init__(self, parent, pos=(0, 0), size=(100, 22), id=wx.ID_ANY, canAdd=True
"""

wx.Panel.__init__(self, parent, id, pos, size)
if wx.VERSION >= (3,0):
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)

self.tabs = []
width, height = size
Expand Down
46 changes: 20 additions & 26 deletions gui/pyfatogglepanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,13 @@ def IsCollapsed(self):
else:
return True


def IsExpanded(self):
""" Returns ``True`` if the pane window is currently shown. """
if self._toggle == 1:
return False
else:
return True


def OnStateChange(self, sz):
"""
Handles the status changes (collapsing/expanding).
Expand All @@ -168,49 +166,45 @@ def OnStateChange(self, sz):

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

# 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()
1 change: 1 addition & 0 deletions gui/shipBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import gui.sfBrowserItem as SFItem
from gui.contextMenu import ContextMenu
import gui.utils.fonts as fonts

import service
import gui.utils.fonts as fonts
Expand Down
5 changes: 5 additions & 0 deletions gui/utils/fonts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
'''
Font file to handle the differences in font calculations between
different wxPython versions
'''

import wx

if 'wxMac' in wx.PlatformInfo:
Expand Down
6 changes: 3 additions & 3 deletions pyfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
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
Expand All @@ -48,10 +48,10 @@
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
Expand Down

0 comments on commit 5372f31

Please sign in to comment.