Skip to content

Commit

Permalink
Revert "Merge branch 'master' into wx3"
Browse files Browse the repository at this point in the history
This reverts commit 33a0c10, reversing
changes made to 2077655.

Reverting merges fucks up git, but oh well - we probably better merge stuff manually rather than fucking up master with wx3 which is apparently buggy
  • Loading branch information
DarkFenX committed Apr 30, 2015
1 parent c809a61 commit cca7f11
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 50 deletions.
7 changes: 4 additions & 3 deletions gui/builtinStatsViews/resistancesViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ def populatePanel(self, contentPanel, headerPanel):
# Display table
col = 0
row = 0
sizerResistances = wx.GridBagSizer()
sizerResistances = wx.GridBagSizer(0, 0)
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 @@ -92,8 +95,6 @@ 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(5, 2)
gridTargeting = wx.FlexGridSizer(4, 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(5, 2)
gridMisc = wx.FlexGridSizer(4, 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 = 24
self.size = 16
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 = 24
self.size = 16
self.maxsize = self.size
self.mask = wx.LIST_MASK_IMAGE
self.columnText = ""
Expand Down
3 changes: 0 additions & 3 deletions gui/chromeTabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
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 @@ -672,8 +671,6 @@ 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: 26 additions & 20 deletions gui/pyfatogglepanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ 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 @@ -166,45 +168,49 @@ 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.Hide()
self.headerBmp.SetBitmap(self.bmpCollapsed)
self.contentPanel.SetMinSize(wx.Size(self.contentMinSize[0],0))
self.headerBmp.SetBitmap( self.bmpCollapsed)


else:
self.contentPanel.Show()
self.headerBmp.SetBitmap(self.bmpExpanded)
self.contentPanel.SetMinSize(self.contentMinSize)

self._toggle *= -1
self.Layout()
self.Thaw()
self.headerBmp.SetBitmap( self.bmpExpanded)


self._toggle *=-1

self.Thaw()
if self.forceLayout == -1:
if wx.VERSION >= (3, 0):
x, y = self.GetBestSize()
y -= self.contentPanel.GetSize()[1]
else:
x, y = self.GetBestSize()
self.OnStateChange((x, y))
self.OnStateChange(self.GetBestSize())
else:
self.parent.Layout()
self.parent.Layout()
1 change: 0 additions & 1 deletion gui/shipBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

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: 0 additions & 5 deletions gui/utils/fonts.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
'''
Font file to handle the differences in font calculations between
different wxPython versions
'''

import wx

if 'wxMac' in wx.PlatformInfo:
Expand Down
19 changes: 5 additions & 14 deletions pyfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import sys
import re
import config

if not hasattr(sys, 'frozen'):

Expand All @@ -31,27 +30,18 @@
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
try:
if getattr(config.configforced, "force28", False):
wxversion.select('2.8')
else:
# try 3.0, then 2.8. If any exceptions, go to ensureMinimal path
try:
wxversion.select('3.0')
except:
wxversion.select('2.9')
wxversion.select('2.8')
except wxversion.VersionError:
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 Expand Up @@ -82,6 +72,7 @@
parser.add_option("-r", "--root", action="store_true", dest="rootsavedata", help="if you want pyfa to store its data in root folder, use this option", default=False)
(options, args) = parser.parse_args()

import config
# Configure paths
if options.rootsavedata is True:
config.saveInRoot = True
Expand Down

0 comments on commit cca7f11

Please sign in to comment.