diff --git a/gui/PFListPane.py b/gui/PFListPane.py
index 2bb4f8357a..072081428b 100644
--- a/gui/PFListPane.py
+++ b/gui/PFListPane.py
@@ -19,6 +19,7 @@
# noinspection PyPackageRequirements
import wx
+from gui.utils.helpers_wxPython import Frame
class PFListPane(wx.ScrolledWindow):
@@ -30,7 +31,7 @@ def __init__(self, parent):
self._wCount = 0
self.itemsHeight = 1
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
self.SetVirtualSize((1, 1))
self.SetScrollRate(0, 1)
diff --git a/gui/PFSearchBox.py b/gui/PFSearchBox.py
index 530ab096ce..029da0d5d6 100644
--- a/gui/PFSearchBox.py
+++ b/gui/PFSearchBox.py
@@ -2,6 +2,7 @@
import wx
import gui.utils.colorUtils as colorUtils
import gui.utils.drawUtils as drawUtils
+from gui.utils.helpers_wxPython import Frame
SearchButton, EVT_SEARCH_BTN = wx.lib.newevent.NewEvent()
CancelButton, EVT_CANCEL_BTN = wx.lib.newevent.NewEvent()
@@ -10,8 +11,8 @@
class PFSearchBox(wx.Window):
- def __init__(self, parent, id=wx.ID_ANY, value="", pos=wx.DefaultPosition, size=wx.Size(-1, 24), style=0):
- wx.Window.__init__(self, parent, id, pos, size, style=style)
+ def __init__(self, parent, init_id=wx.ID_ANY, value="", pos=wx.DefaultPosition, size=wx.Size(-1, 24), style=0):
+ wx.Window.__init__(self, parent, init_id, pos, size, style=style)
self.isSearchButtonVisible = False
self.isCancelButtonVisible = False
@@ -222,11 +223,13 @@ def UpdateElementsPos(self, dc):
self.editY = (cheight - editHeight) / 2
self.EditBox.SetPosition((self.editX, self.editY))
self.EditBox.SetSize((self.cancelButtonX - self.padding - self.editX, -1))
+ self.EditBox.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.EditBox.SetForegroundColour(Frame.getForegroundColor())
def OnPaint(self, event):
dc = wx.BufferedPaintDC(self)
- bkColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ bkColor = Frame.getBackgroundColor()
sepColor = colorUtils.GetSuitableColor(bkColor, 0.2)
rect = self.GetRect()
diff --git a/gui/additionsPane.py b/gui/additionsPane.py
index 503fc4135f..761ada9439 100644
--- a/gui/additionsPane.py
+++ b/gui/additionsPane.py
@@ -32,12 +32,15 @@
from gui.bitmapLoader import BitmapLoader
from gui.chromeTabs import PFNotebook
+from gui.utils.helpers_wxPython import Frame
class AdditionsPane(TogglePanel):
def __init__(self, parent):
TogglePanel.__init__(self, parent, forceLayout=1)
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
self.SetLabel("Additions")
pane = self.GetContentPane()
diff --git a/gui/boosterView.py b/gui/boosterView.py
index 535a1409ee..2f47b978fe 100644
--- a/gui/boosterView.py
+++ b/gui/boosterView.py
@@ -25,7 +25,7 @@
import gui.marketBrowser as marketBrowser
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
-from gui.utils.staticHelpers import DragDropHelper
+from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
diff --git a/gui/builtinPreferenceViews/__init__.py b/gui/builtinPreferenceViews/__init__.py
index 8b61beb13c..e10517ee6e 100644
--- a/gui/builtinPreferenceViews/__init__.py
+++ b/gui/builtinPreferenceViews/__init__.py
@@ -3,6 +3,7 @@
__all__ = [
"pyfaGeneralPreferences",
+ "pyfaGeneral2Preferences",
"pyfaHTMLExportPreferences",
"pyfaUpdatePreferences",
"pyfaNetworkPreferences",
diff --git a/gui/builtinPreferenceViews/dummyView.py b/gui/builtinPreferenceViews/dummyView.py
index 657ce441b3..7f4f7c71ab 100644
--- a/gui/builtinPreferenceViews/dummyView.py
+++ b/gui/builtinPreferenceViews/dummyView.py
@@ -20,7 +20,7 @@
# noinspection PyPackageRequirements
import wx
from gui.preferenceView import PreferenceView
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class DummyView(PreferenceView):
diff --git a/gui/builtinPreferenceViews/pyfaContextMenuPreferences.py b/gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
index ef1f4eb59c..6b14edb221 100644
--- a/gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
@@ -4,11 +4,11 @@
from gui.bitmapLoader import BitmapLoader
import gui.mainFrame
from service.settings import ContextMenuSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class PFContextMenuPref(PreferenceView):
- title = "Context Menu Panel"
+ title = "Context Menu"
def populatePrefPanel(self, panel):
self.settings = ContextMenuSettings.getInstance()
diff --git a/gui/builtinPreferenceViews/pyfaCrestPreferences.py b/gui/builtinPreferenceViews/pyfaCrestPreferences.py
index 2b986fec03..c11fcf8a61 100644
--- a/gui/builtinPreferenceViews/pyfaCrestPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaCrestPreferences.py
@@ -7,7 +7,7 @@
import gui.mainFrame
from service.settings import CRESTSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
# noinspection PyPackageRequirements
from wx.lib.intctrl import IntCtrl
diff --git a/gui/builtinPreferenceViews/pyfaDatabasePreferences.py b/gui/builtinPreferenceViews/pyfaDatabasePreferences.py
index 768bb5aa7e..e2437f1078 100644
--- a/gui/builtinPreferenceViews/pyfaDatabasePreferences.py
+++ b/gui/builtinPreferenceViews/pyfaDatabasePreferences.py
@@ -10,7 +10,7 @@
from service.settings import DatabaseSettings
from service.esi import esiItems, esiDogma
import sys
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
import logging
@@ -18,6 +18,9 @@
class PFDatabasePref(PreferenceView):
+ def refreshPanel(self, fit):
+ pass
+
title = "Database"
def __init__(self):
@@ -33,7 +36,7 @@ def populatePrefPanel(self, panel):
self.stTitle.SetFont(Fonts.getFont("font_title_plus_one"))
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
- self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"(Cannot be changed while pyfa is running. Set via command line switches.)",
+ self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"Cannot be changed while pyfa is running. Set via command line switches.",
wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitle.Wrap(-1)
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
@@ -85,18 +88,17 @@ def populatePrefPanel(self, panel):
mainSizer.Add(self.m_staticline2, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
self.stSubTitleTwo = wx.StaticText(panel, wx.ID_ANY, u"DANGER ZONE!\nUsing these options will permanantly delete data out of the database.",
- wx.DefaultPosition, wx.DefaultSize, 0)
+ wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitleTwo.Wrap(-1)
mainSizer.Add(self.stSubTitleTwo, 0, wx.ALL, 3)
self.m_staticline3 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline3, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
- btnSizer = wx.BoxSizer(wx.VERTICAL)
- btnSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
+ btnSizer = wx.BoxSizer(wx.HORIZONTAL | wx.ALIGN_LEFT)
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, u"Delete All Damage Pattern Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
- btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL, 5)
+ btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL | wx.ALIGN_LEFT, 5)
self.btnDeleteTargetResists = wx.Button(panel, wx.ID_ANY, u"Delete All Target Resist Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnDeleteTargetResists, 0, wx.ALL, 5)
@@ -104,7 +106,7 @@ def populatePrefPanel(self, panel):
self.btnPrices = wx.Button(panel, wx.ID_ANY, u"Delete All Prices", wx.DefaultPosition, wx.DefaultSize, 0)
btnSizer.Add(self.btnPrices, 0, wx.ALL, 5)
- mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
+ mainSizer.Add(btnSizer, 0, wx.EXPAND | wx.ALIGN_LEFT, 5)
self.btnDeleteDamagePatterns.Bind(wx.EVT_BUTTON, self.DeleteDamagePatterns)
self.btnDeleteTargetResists.Bind(wx.EVT_BUTTON, self.DeleteTargetResists)
@@ -115,7 +117,7 @@ def populatePrefPanel(self, panel):
self.stSubTitleTwo = wx.StaticText(panel, wx.ID_ANY, u"Update Game Data Database\n"
u"Enabling these options will increase the length of time it takes to update.",
- wx.DefaultPosition, wx.DefaultSize, 0)
+ wx.DefaultPosition, wx.DefaultSize, 0)
self.stSubTitleTwo.Wrap(-1)
mainSizer.Add(self.stSubTitleTwo, 0, wx.ALL, 3)
@@ -126,11 +128,11 @@ def populatePrefPanel(self, panel):
mainSizer.Add(self.btnUpdateDatabase, 0, wx.ALL, 5)
self.cbImportItemsNotInMarketGroups = wx.CheckBox(panel, wx.ID_ANY, u"Import items not in market groups.",
- wx.DefaultPosition, wx.DefaultSize, 0)
+ wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbImportItemsNotInMarketGroups, 0, wx.ALL | wx.EXPAND, 5)
self.cbImportItemsNotPublished = wx.CheckBox(panel, wx.ID_ANY, u"Import items that are not published.",
- wx.DefaultPosition, wx.DefaultSize, 0)
+ wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbImportItemsNotPublished, 0, wx.ALL | wx.EXPAND, 5)
delayTimer = wx.BoxSizer(wx.HORIZONTAL)
@@ -138,7 +140,7 @@ def populatePrefPanel(self, panel):
self.stUpdateThreads = wx.StaticText(panel, wx.ID_ANY, u"Threads to use when updating the database:", wx.DefaultPosition, wx.DefaultSize, 0)
self.stUpdateThreads.Wrap(-1)
self.stUpdateThreads.SetToolTip(
- wx.ToolTip('More threads may speed up updating the database, but typically little gain is seen above 25.'))
+ wx.ToolTip('More threads may speed up updating the database, but typically little gain is seen above 25.'))
delayTimer.Add(self.stUpdateThreads, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
diff --git a/gui/builtinPreferenceViews/pyfaEnginePreferences.py b/gui/builtinPreferenceViews/pyfaEnginePreferences.py
index 271e79d269..bffc8165b2 100644
--- a/gui/builtinPreferenceViews/pyfaEnginePreferences.py
+++ b/gui/builtinPreferenceViews/pyfaEnginePreferences.py
@@ -7,7 +7,7 @@
from gui.bitmapLoader import BitmapLoader
from gui.preferenceView import PreferenceView
from service.settings import EOSSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
logger = logging.getLogger(__name__)
@@ -46,9 +46,9 @@ def populatePrefPanel(self, panel):
wx.DefaultPosition, wx.DefaultSize, 0)
self.cbStrictSkillLevels.SetCursor(helpCursor)
self.cbStrictSkillLevels.SetToolTip(wx.ToolTip(
- u'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
- u'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
- u'Drone Operation skill, as that requires Drones V'))
+ u'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
+ u'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
+ u'Drone Operation skill, as that requires Drones V'))
mainSizer.Add(self.cbStrictSkillLevels, 0, wx.ALL | wx.EXPAND, 5)
@@ -58,8 +58,7 @@ def populatePrefPanel(self, panel):
mainSizer.Add(self.cbUniversalAdaptiveArmorHardener, 0, wx.ALL | wx.EXPAND, 5)
self.cbStrictFitting = wx.CheckBox(panel, wx.ID_ANY,
- u"Only allow fits that strictly match fitting rules. If this is disabled, fits allowed may not work in EVE." +
- u"\n(Only recommended for expert players)",
+ u"Only allow fits that strictly match fitting rules.",
wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbStrictFitting, 0, wx.ALL | wx.EXPAND, 5)
diff --git a/gui/builtinPreferenceViews/pyfaGaugePreferences.py b/gui/builtinPreferenceViews/pyfaGaugePreferences.py
index 682f6c6394..d5b9a9b82c 100644
--- a/gui/builtinPreferenceViews/pyfaGaugePreferences.py
+++ b/gui/builtinPreferenceViews/pyfaGaugePreferences.py
@@ -2,14 +2,16 @@
# -*- coding: utf-8 -*-
+import copy
+
# noinspection PyPackageRequirements
import wx
-import copy
-from gui.preferenceView import PreferenceView
+import gui.utils.drawUtils as drawUtils
from gui.bitmapLoader import BitmapLoader
+from gui.preferenceView import PreferenceView
from gui.utils import colorUtils
-import gui.utils.drawUtils as drawUtils
+from gui.utils.helpers_wxPython import Fonts
###########################################################################
@@ -38,8 +40,6 @@ def __init__(self, parent, id=wx.ID_ANY, value=0, pos=wx.DefaultPosition, size=w
self.bkColor = wx.Colour(0, 0, 0, 255)
self.SetMinSize((100, -1))
- self.font = wx.FontFromPixelSize((0, 13), wx.SWISS, wx.NORMAL, wx.NORMAL, False)
-
self.timerID = wx.NewId()
self.timer = wx.Timer(self, self.timerID)
self.timerInterval = 20
@@ -132,7 +132,7 @@ def OnPaint(self, event):
gBmp = drawUtils.DrawGradientBar(r.width, r.height, gMid, color, gcolor)
dc.DrawBitmap(gBmp, 0, 0)
- dc.SetFont(self.font)
+ self.SetFont(Fonts.getFont("font_standard"))
r = copy.copy(rect)
r.left += 1
diff --git a/gui/builtinPreferenceViews/pyfaGeneral2Preferences.py b/gui/builtinPreferenceViews/pyfaGeneral2Preferences.py
new file mode 100644
index 0000000000..b87e193d69
--- /dev/null
+++ b/gui/builtinPreferenceViews/pyfaGeneral2Preferences.py
@@ -0,0 +1,192 @@
+# noinspection PyPackageRequirements
+import wx
+
+import gui.globalEvents as GE
+import gui.mainFrame
+from gui.bitmapLoader import BitmapLoader
+from gui.preferenceView import PreferenceView
+from gui.utils.helpers_wxPython import Fonts
+from service.fit import Fit
+from service.settings import GeneralSettings, SettingsProvider
+
+
+class PFGeneral2Pref(PreferenceView):
+ def refreshPanel(self, fit):
+ pass
+
+ title = "General (2)"
+
+ def populatePrefPanel(self, panel):
+ self.mainFrame = gui.mainFrame.MainFrame.getInstance()
+ self.dirtySettings = False
+ self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
+ {"enabled": False, "pyfaOpenFits": []})
+ self.sFit = Fit.getInstance()
+ self.generalSettings = GeneralSettings.getInstance()
+
+ mainSizer = wx.BoxSizer(wx.VERTICAL)
+
+ self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
+ self.stTitle.Wrap(-1)
+ self.stTitle.SetFont(Fonts.getFont("font_title_plus_one"))
+
+ mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
+
+ self.stSubTitle = wx.StaticText(panel, wx.ID_ANY,
+ u"Changes require restart of pyfa to take effect.",
+ wx.DefaultPosition, wx.DefaultSize, 0)
+ self.stSubTitle.Wrap(-1)
+ mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
+
+ self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
+ mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
+
+ self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition,
+ wx.DefaultSize, 0)
+ mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)
+
+ self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, u"Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
+ mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)
+
+ # Font size
+ fontSizeSizer = wx.BoxSizer(wx.HORIZONTAL)
+
+ self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Font Size:", wx.DefaultPosition, wx.DefaultSize, 0)
+ self.stFontText.Wrap(-1)
+ fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.chFontSize = wx.Choice(panel, choices=['6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16'])
+ fontSizeSizer.Add(self.chFontSize, 1, wx.ALL | wx.EXPAND, 5)
+
+ self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Type:", wx.DefaultPosition, wx.DefaultSize, 0)
+ self.stFontText.Wrap(-1)
+ fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.chFontType = wx.Choice(panel, choices=['DEFAULT', 'DECORATIVE', 'MODERN', 'ROMAN', 'SCRIPT', 'SWISS', 'TELETYPE'])
+ fontSizeSizer.Add(self.chFontType, 1, wx.ALL | wx.EXPAND, 5)
+
+ self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Style:", wx.DefaultPosition, wx.DefaultSize, 0)
+ self.stFontText.Wrap(-1)
+ fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.chFontStyle = wx.Choice(panel, choices=['NORMAL', 'ITALIC', 'SLANT'])
+ fontSizeSizer.Add(self.chFontStyle, 1, wx.ALL | wx.EXPAND, 5)
+
+ self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Weight:", wx.DefaultPosition, wx.DefaultSize, 0)
+ self.stFontText.Wrap(-1)
+ fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.chFontWeight = wx.Choice(panel, choices=['NORMAL', 'BOLD', 'LIGHT'])
+ fontSizeSizer.Add(self.chFontWeight, 1, wx.ALL | wx.EXPAND, 5)
+
+ mainSizer.Add(fontSizeSizer, 0, wx.ALL | wx.EXPAND, 0)
+
+ # Background/ Colors
+ bgColorSizer = wx.BoxSizer(wx.HORIZONTAL)
+
+ textString = wx.StaticText(panel, wx.ID_ANY, u"Background Color:", wx.DefaultPosition, wx.DefaultSize, 0)
+ textString.Wrap(-1)
+ bgColorSizer.Add(textString, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.colorChoices = [
+ 'BLACK', 'BLUE', 'CYAN', 'GREEN', 'YELLOW', 'LIGHT_GREY', 'RED', 'WHITE', 'SYS_COLOUR_SCROLLBAR', 'SYS_COLOUR_BACKGROUND', 'SYS_COLOUR_ACTIVECAPTION',
+ 'SYS_COLOUR_INACTIVECAPTION', 'SYS_COLOUR_MENU', 'SYS_COLOUR_WINDOW', 'SYS_COLOUR_WINDOWFRAME', 'SYS_COLOUR_MENUTEXT', 'SYS_COLOUR_WINDOWTEXT',
+ 'SYS_COLOUR_CAPTIONTEXT', 'SYS_COLOUR_ACTIVEBORDER', 'SYS_COLOUR_INACTIVEBORDER', 'SYS_COLOUR_APPWORKSPACE', 'SYS_COLOUR_HIGHLIGHT',
+ 'SYS_COLOUR_HIGHLIGHTTEXT', 'SYS_COLOUR_BTNFACE', 'SYS_COLOUR_BTNSHADOW', 'SYS_COLOUR_GRAYTEXT', 'SYS_COLOUR_BTNTEXT', 'SYS_COLOUR_INACTIVECAPTIONTEXT',
+ 'SYS_COLOUR_BTNHIGHLIGHT', 'SYS_COLOUR_3DDKSHADOW', 'SYS_COLOUR_3DLIGHT', 'SYS_COLOUR_INFOTEXT', 'SYS_COLOUR_INFOBK', 'SYS_COLOUR_LISTBOX',
+ 'SYS_COLOUR_HOTLIGHT', 'SYS_COLOUR_GRADIENTACTIVECAPTION', 'SYS_COLOUR_GRADIENTINACTIVECAPTION', 'SYS_COLOUR_MENUHILIGHT', 'SYS_COLOUR_MENUBAR',
+ 'SYS_COLOUR_LISTBOXTEXT', 'SYS_COLOUR_LISTBOXHIGHLIGHTTEXT', 'SYS_COLOUR_MAX', 'SYS_COLOUR_DESKTOP', 'SYS_COLOUR_3DFACE', 'SYS_COLOUR_3DSHADOW',
+ 'SYS_COLOUR_BTNHILIGHT', 'SYS_COLOUR_3DHIGHLIGHT', 'SYS_COLOUR_3DHILIGHT', 'SYS_COLOUR_FRAMEBK'
+ ]
+ self.chBackgroundColor = wx.Choice(panel, choices=self.colorChoices)
+ bgColorSizer.Add(self.chBackgroundColor, 1, wx.ALL | wx.EXPAND, 5)
+
+ mainSizer.Add(bgColorSizer, 0, wx.ALL | wx.EXPAND, 0)
+
+ # Text Color
+ txtColorSizer = wx.BoxSizer(wx.HORIZONTAL)
+
+ textString = wx.StaticText(panel, wx.ID_ANY, u"Text Color:", wx.DefaultPosition, wx.DefaultSize, 0)
+ textString.Wrap(-1)
+ txtColorSizer.Add(textString, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.chForegroundColor = wx.Choice(panel, choices=self.colorChoices)
+ txtColorSizer.Add(self.chForegroundColor, 1, wx.ALL | wx.EXPAND, 5)
+
+ mainSizer.Add(txtColorSizer, 0, wx.ALL | wx.EXPAND, 0)
+
+ # Warning Text Color
+ warnTextColorSizer = wx.BoxSizer(wx.HORIZONTAL)
+
+ textString = wx.StaticText(panel, wx.ID_ANY, u"Warning Text Color:", wx.DefaultPosition, wx.DefaultSize, 0)
+ textString.Wrap(-1)
+ warnTextColorSizer.Add(textString, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
+
+ self.chWarningTextColor = wx.Choice(panel, choices=self.colorChoices)
+ warnTextColorSizer.Add(self.chWarningTextColor, 1, wx.ALL | wx.EXPAND, 5)
+
+ mainSizer.Add(warnTextColorSizer, 0, wx.ALL | wx.EXPAND, 0)
+
+ self.m_staticline = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
+ mainSizer.Add(self.m_staticline, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
+
+ btnSizer = wx.BoxSizer(wx.HORIZONTAL)
+ btnSizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
+
+ self.btnApply = wx.Button(panel, wx.ID_ANY, u"Apply Settings", wx.DefaultPosition, wx.DefaultSize, 0)
+
+ btnSizer.Add(self.btnApply, 0, wx.ALL, 5)
+
+ mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
+
+ self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
+ self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
+ self.chFontSize.SetStringSelection(unicode(self.generalSettings.get("fontSize")))
+ self.chFontType.SetStringSelection(self.generalSettings.get("fontType"))
+ self.chFontStyle.SetStringSelection(self.generalSettings.get("fontStyle"))
+ self.chFontWeight.SetStringSelection(self.generalSettings.get("fontWeight"))
+ self.chBackgroundColor.SetStringSelection(self.generalSettings.get("colorBackground"))
+ self.chForegroundColor.SetStringSelection(self.generalSettings.get("colorForeground"))
+ self.chWarningTextColor.SetStringSelection(self.generalSettings.get("colorWarning"))
+
+ self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
+ self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
+ self.chFontSize.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.chFontType.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.chFontStyle.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.chFontWeight.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.chBackgroundColor.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.chForegroundColor.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.chWarningTextColor.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
+ self.btnApply.Bind(wx.EVT_BUTTON, self.OnWindowLeave)
+
+ panel.SetSizer(mainSizer)
+ panel.Layout()
+
+ def getImage(self):
+ return BitmapLoader.getBitmap("prefs_settings", "gui")
+
+ def OnWindowLeave(self, event):
+ self.sFit.serviceFittingOptions["colorFitBySlot"] = self.cbFitColorSlots.GetValue()
+ self.sFit.serviceFittingOptions["enableGaugeAnimation"] = self.cbGaugeAnimation.GetValue()
+
+ # Font settings
+ self.generalSettings.set('fontSize', int(self.chFontSize.GetString(self.chFontSize.GetSelection())))
+ self.generalSettings.set('fontType', self.chFontType.GetString(self.chFontType.GetSelection()))
+ self.generalSettings.set('fontStyle', self.chFontStyle.GetString(self.chFontStyle.GetSelection()))
+ self.generalSettings.set('fontWeight', self.chFontWeight.GetString(self.chFontWeight.GetSelection()))
+
+ # Color settings
+ self.generalSettings.set('colorBackground', self.chBackgroundColor.GetString(self.chBackgroundColor.GetSelection()))
+ self.generalSettings.set('colorForeground', self.chForegroundColor.GetString(self.chForegroundColor.GetSelection()))
+ self.generalSettings.set('colorWarning', self.chWarningTextColor.GetString(self.chWarningTextColor.GetSelection()))
+
+ fitID = self.mainFrame.getActiveFit()
+ if fitID:
+ fit = self.sFit.getFit(fitID)
+ self.sFit.recalc(fit)
+ wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
+ event.Skip()
+
+
+PFGeneral2Pref.register()
diff --git a/gui/builtinPreferenceViews/pyfaGeneralPreferences.py b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py
index be86126525..2bf474cd22 100644
--- a/gui/builtinPreferenceViews/pyfaGeneralPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py
@@ -10,10 +10,13 @@
from service.settings import SettingsProvider, GeneralSettings
from service.fit import Fit
from service.price import Price
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class PFGeneralPref(PreferenceView):
+ def refreshPanel(self, fit):
+ pass
+
title = "General"
def populatePrefPanel(self, panel):
@@ -49,10 +52,6 @@ def populatePrefPanel(self, panel):
wx.DefaultSize, 0)
mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)
- self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition,
- wx.DefaultSize, 0)
- mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)
-
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, u"Reopen previous fits on startup", wx.DefaultPosition,
wx.DefaultSize, 0)
mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)
@@ -72,9 +71,6 @@ def populatePrefPanel(self, panel):
wx.DefaultSize, 0)
mainSizer.Add(self.cbMarketShortcuts, 0, wx.ALL | wx.EXPAND, 5)
- self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, u"Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
- mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)
-
self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY, u"Export loaded charges", wx.DefaultPosition,
wx.DefaultSize, 0)
mainSizer.Add(self.cbExportCharges, 0, wx.ALL | wx.EXPAND, 5)
@@ -99,7 +95,7 @@ def populatePrefPanel(self, panel):
mainSizer.Add(priceSizer, 0, wx.ALL | wx.EXPAND, 0)
self.cbShowAllMarketGroups = wx.CheckBox(panel, wx.ID_ANY, u"Show all market groups (requires restart)",
- wx.DefaultPosition, wx.DefaultSize, 0)
+ wx.DefaultPosition, wx.DefaultSize, 0)
mainSizer.Add(self.cbShowAllMarketGroups, 0, wx.ALL | wx.EXPAND, 5)
delayTimer = wx.BoxSizer(wx.HORIZONTAL)
@@ -108,7 +104,7 @@ def populatePrefPanel(self, panel):
self.stMarketDelay.Wrap(-1)
self.stMarketDelay.SetCursor(helpCursor)
self.stMarketDelay.SetToolTip(
- wx.ToolTip('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.'))
+ wx.ToolTip('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.'))
delayTimer.Add(self.stMarketDelay, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -131,43 +127,6 @@ def populatePrefPanel(self, panel):
self.m_staticline = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
- self.stDefaultFont = wx.StaticText(panel, wx.ID_ANY, u"Font (requires restart)", wx.DefaultPosition, wx.DefaultSize, 0)
- self.stDefaultFont.Wrap(-1)
- mainSizer.Add(self.stDefaultFont, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
-
- # Font size
- fontSizeSizer = wx.BoxSizer(wx.HORIZONTAL)
-
- self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Size:", wx.DefaultPosition, wx.DefaultSize, 0)
- self.stFontText.Wrap(-1)
- fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
-
- self.chFontSize = wx.Choice(panel, choices=['6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16'])
- fontSizeSizer.Add(self.chFontSize, 1, wx.ALL | wx.EXPAND, 5)
-
- self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Type:", wx.DefaultPosition, wx.DefaultSize, 0)
- self.stFontText.Wrap(-1)
- fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
-
- self.chFontType = wx.Choice(panel, choices=['DEFAULT', 'DECORATIVE', 'MODERN', 'ROMAN', 'SCRIPT', 'SWISS', 'TELETYPE'])
- fontSizeSizer.Add(self.chFontType, 1, wx.ALL | wx.EXPAND, 5)
-
- self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Style:", wx.DefaultPosition, wx.DefaultSize, 0)
- self.stFontText.Wrap(-1)
- fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
-
- self.chFontStyle = wx.Choice(panel, choices=['NORMAL', 'ITALIC', 'SLANT'])
- fontSizeSizer.Add(self.chFontStyle, 1, wx.ALL | wx.EXPAND, 5)
-
- self.stFontText = wx.StaticText(panel, wx.ID_ANY, u"Weight:", wx.DefaultPosition, wx.DefaultSize, 0)
- self.stFontText.Wrap(-1)
- fontSizeSizer.Add(self.stFontText, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
-
- self.chFontWeight = wx.Choice(panel, choices=['NORMAL', 'BOLD', 'LIGHT'])
- fontSizeSizer.Add(self.chFontWeight, 1, wx.ALL | wx.EXPAND, 5)
-
- mainSizer.Add(fontSizeSizer, 0, wx.ALL | wx.EXPAND, 0)
-
self.m_staticline = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
mainSizer.Add(self.m_staticline, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
@@ -182,14 +141,12 @@ def populatePrefPanel(self, panel):
self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
- self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
self.cbMarketShortcuts.SetValue(self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
- self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
self.cbExportCharges.SetValue(self.sFit.serviceFittingOptions["exportCharges"])
self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])
self.chPriceSystem.SetStringSelection(self.sFit.serviceFittingOptions["priceSystem"])
@@ -197,21 +154,15 @@ def populatePrefPanel(self, panel):
self.intDelay.SetValue(self.generalSettings.get("marketSearchDelay"))
self.editSearchLimit.SetValue(int(self.generalSettings.get("itemSearchLimit")))
self.cbShowAllMarketGroups.SetValue(self.generalSettings.get("showAllMarketGroups"))
- self.chFontSize.SetStringSelection(unicode(self.generalSettings.get("fontSize")))
- self.chFontType.SetStringSelection(self.generalSettings.get("fontType"))
- self.chFontStyle.SetStringSelection(self.generalSettings.get("fontStyle"))
- self.chFontWeight.SetStringSelection(self.generalSettings.get("fontWeight"))
self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
- self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
- self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbExportCharges.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
self.chPriceSystem.Bind(wx.EVT_CHOICE, self.OnWindowLeave)
@@ -220,10 +171,6 @@ def populatePrefPanel(self, panel):
self.intDelay.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
self.editSearchLimit.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
self.cbShowAllMarketGroups.Bind(wx.EVT_CHECKBOX, self.OnWindowLeave)
- self.chFontSize.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
- self.chFontType.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
- self.chFontStyle.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
- self.chFontWeight.Bind(wx.lib.intctrl.EVT_INT, self.OnWindowLeave)
self.btnApply.Bind(wx.EVT_BUTTON, self.OnWindowLeave)
self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)
@@ -239,7 +186,6 @@ def OnWindowLeave(self, event):
self.cbRackLabels.Enable(self.cbRackSlots.GetValue())
self.sFit.serviceFittingOptions["priceSystem"] = self.chPriceSystem.GetString(self.chPriceSystem.GetSelection())
- self.sFit.serviceFittingOptions["colorFitBySlot"] = self.cbFitColorSlots.GetValue()
self.sFit.serviceFittingOptions["rackLabels"] = self.cbRackLabels.GetValue()
self.sFit.serviceFittingOptions["compactSkills"] = self.cbCompactSkills.GetValue()
self.sFit.serviceFittingOptions["useGlobalCharacter"] = self.cbGlobalChar.GetValue()
@@ -247,7 +193,6 @@ def OnWindowLeave(self, event):
self.openFitsSettings["enabled"] = self.cbReopenFits.GetValue()
self.sFit.serviceFittingOptions["showTooltip"] = self.cbShowTooltip.GetValue()
self.sFit.serviceFittingOptions["showMarketShortcuts"] = self.cbMarketShortcuts.GetValue()
- self.sFit.serviceFittingOptions["enableGaugeAnimation"] = self.cbGaugeAnimation.GetValue()
self.sFit.serviceFittingOptions["exportCharges"] = self.cbExportCharges.GetValue()
self.sFit.serviceFittingOptions["openFitInNew"] = self.cbOpenFitInNew.GetValue()
self.sFit.serviceFittingOptions["showShipBrowserTooltip"] = self.cbShowAllMarketGroups.GetValue()
@@ -256,12 +201,6 @@ def OnWindowLeave(self, event):
self.generalSettings.set('marketSearchDelay', int(self.intDelay.GetValue()))
self.generalSettings.set("showAllMarketGroups", self.cbShowShipBrowserTooltip.GetValue())
- # Font settings
- self.generalSettings.set('fontSize', int(self.chFontSize.GetString(self.chFontSize.GetSelection())))
- self.generalSettings.set('fontType', self.chFontType.GetString(self.chFontType.GetSelection()))
- self.generalSettings.set('fontStyle', self.chFontStyle.GetString(self.chFontStyle.GetSelection()))
- self.generalSettings.set('fontWeight', self.chFontWeight.GetString(self.chFontWeight.GetSelection()))
-
fitID = self.mainFrame.getActiveFit()
if fitID:
fit = self.sFit.getFit(fitID)
diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py
index 453647e2cc..d19bf735c9 100644
--- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py
@@ -8,7 +8,7 @@
import gui.mainFrame
from service.settings import HTMLExportSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class PFHTMLExportPref(PreferenceView):
diff --git a/gui/builtinPreferenceViews/pyfaLoggingPreferences.py b/gui/builtinPreferenceViews/pyfaLoggingPreferences.py
index 445c0e7523..9069bb64f5 100644
--- a/gui/builtinPreferenceViews/pyfaLoggingPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaLoggingPreferences.py
@@ -4,7 +4,7 @@
from gui.bitmapLoader import BitmapLoader
import config
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
pyfalog = Logger(__name__)
diff --git a/gui/builtinPreferenceViews/pyfaNetworkPreferences.py b/gui/builtinPreferenceViews/pyfaNetworkPreferences.py
index 88c2153f9e..43112979b7 100644
--- a/gui/builtinPreferenceViews/pyfaNetworkPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaNetworkPreferences.py
@@ -7,7 +7,7 @@
import gui.mainFrame
from service.settings import NetworkSettings
from service.network import Network
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class PFNetworkPref(PreferenceView):
diff --git a/gui/builtinPreferenceViews/pyfaStatViewPreferences.py b/gui/builtinPreferenceViews/pyfaStatViewPreferences.py
index b71a733482..f1a6ddcbcc 100644
--- a/gui/builtinPreferenceViews/pyfaStatViewPreferences.py
+++ b/gui/builtinPreferenceViews/pyfaStatViewPreferences.py
@@ -4,7 +4,7 @@
from gui.preferenceView import PreferenceView
from gui.bitmapLoader import BitmapLoader
from service.settings import StatViewSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class PFStatViewPref(PreferenceView):
diff --git a/gui/builtinPreferenceViews/pyfaUpdatePreferences.py b/gui/builtinPreferenceViews/pyfaUpdatePreferences.py
index 5bb3bf9500..14effa53fc 100644
--- a/gui/builtinPreferenceViews/pyfaUpdatePreferences.py
+++ b/gui/builtinPreferenceViews/pyfaUpdatePreferences.py
@@ -4,7 +4,7 @@
from gui.preferenceView import PreferenceView
from gui.bitmapLoader import BitmapLoader
from service.settings import UpdateSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
class PFUpdatePref(PreferenceView):
diff --git a/gui/builtinStatsViews/firepowerViewFull.py b/gui/builtinStatsViews/firepowerViewFull.py
index 175591bf74..153396f62b 100644
--- a/gui/builtinStatsViews/firepowerViewFull.py
+++ b/gui/builtinStatsViews/firepowerViewFull.py
@@ -24,6 +24,7 @@
from gui.bitmapLoader import BitmapLoader
from gui.utils.numberFormatter import formatAmount
from service.fit import Fit
+from gui.utils.helpers_wxPython import Fonts
class FirepowerViewFull(StatsView):
@@ -74,7 +75,7 @@ def populatePanel(self, contentPanel, headerPanel):
hbox = wx.BoxSizer(wx.HORIZONTAL)
box.Add(hbox, 1, wx.ALIGN_CENTER)
- lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS")
+ lbl = wx.StaticText(parent, wx.ID_ANY, "0 DPS")
setattr(self, "label%sDps%s" % (panel.capitalize(), damageType.capitalize()), lbl)
hbox.Add(lbl, 0, wx.ALIGN_CENTER)
@@ -91,14 +92,14 @@ def populatePanel(self, contentPanel, headerPanel):
baseBox.Add(gridS, 0)
- lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
+ lbl = wx.StaticText(parent, wx.ID_ANY, "0")
setattr(self, "label%sVolleyTotal" % panel.capitalize(), lbl)
gridS.Add(wx.StaticText(parent, wx.ID_ANY, " Volley: "), 0, wx.ALL | wx.ALIGN_RIGHT)
gridS.Add(lbl, 0, wx.ALIGN_LEFT)
self._cachedValues.append(0)
- lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
+ lbl = wx.StaticText(parent, wx.ID_ANY, "0")
setattr(self, "label%sDpsTotal" % panel.capitalize(), lbl)
gridS.Add(wx.StaticText(parent, wx.ID_ANY, " DPS: "), 0, wx.ALL | wx.ALIGN_RIGHT)
@@ -164,7 +165,11 @@ def refreshPanel(self, fit):
value = value() if fit is not None else 0
value = value if value is not None else 0
if self._cachedValues[counter] != value:
- valueStr = formatAmount(value, prec, lowest, highest)
+ if 10 < Fonts.getFont("font_standard"):
+ valueStr = formatAmount(value, 1, lowest, highest)
+ else:
+ valueStr = formatAmount(value, prec, lowest, highest)
+
label.SetLabel(valueFormat % valueStr)
tipStr = valueFormat % valueStr if altFormat is None else altFormat % value
label.SetToolTip(wx.ToolTip(tipStr))
diff --git a/gui/builtinStatsViews/rechargeViewFull.py b/gui/builtinStatsViews/rechargeViewFull.py
index e6baeff668..866774de4b 100644
--- a/gui/builtinStatsViews/rechargeViewFull.py
+++ b/gui/builtinStatsViews/rechargeViewFull.py
@@ -26,6 +26,7 @@
from gui.builtinStatsViews.resistancesViewFull import EFFECTIVE_HP_TOGGLED as EHP_TOGGLE_FULL
from gui.builtinStatsViews.resistancesViewMinimal import EFFECTIVE_HP_TOGGLED as EHP_TOGGLE_MINIMAL
from service.fit import Fit
+from gui.utils.helpers_wxPython import Fonts
class RechargeViewFull(StatsView):
@@ -127,14 +128,24 @@ def refreshPanel(self, fit):
unitlbl = getattr(self, "unitLabelTank%s%sActive" % (stability.capitalize(), name.capitalize()))
unitlbl.SetLabel(unit)
if tank is not None:
- lbl.SetLabel("%.1f" % tank["%sRepair" % name])
+ # Too large of a font will cause issuses with size and fit, so don't display extra info
+ if 10 < Fonts.getFont("font_standard"):
+ lbl.SetLabel("%i" % tank["%sRepair" % name])
+ else:
+ lbl.SetLabel("%.1f" % tank["%sRepair" % name])
else:
- lbl.SetLabel("0.0")
+ lbl.SetLabel("0")
if fit is not None:
label = getattr(self, "labelTankReinforcedShieldPassive")
value = fit.effectiveTank["passiveShield"] if self.effective else fit.tank["passiveShield"]
- label.SetLabel(formatAmount(value, 3, 0, 9))
+
+ # Too large of a font will cause issuses with size and fit, so don't display extra info
+ if 10 < Fonts.getFont("font_standard"):
+ label.SetLabel(formatAmount(value, 1, 0, 9))
+ else:
+ label.SetLabel(formatAmount(value, 3, 0, 9))
+
unitlbl = getattr(self, "unitLabelTankReinforcedShieldPassive")
unitlbl.SetLabel(unit)
diff --git a/gui/builtinStatsViews/rechargeViewMinimal.py b/gui/builtinStatsViews/rechargeViewMinimal.py
index d5bb290203..7db21cc4fd 100644
--- a/gui/builtinStatsViews/rechargeViewMinimal.py
+++ b/gui/builtinStatsViews/rechargeViewMinimal.py
@@ -120,14 +120,14 @@ def refreshPanel(self, fit):
unitlbl = getattr(self, "unitLabelTank%s%sActive" % (stability.capitalize(), name.capitalize()))
unitlbl.SetLabel(unit)
if tank is not None:
- lbl.SetLabel("%.1f" % tank["%sRepair" % name])
+ lbl.SetLabel("%i" % tank["%sRepair" % name])
else:
- lbl.SetLabel("0.0")
+ lbl.SetLabel("0")
if fit is not None:
label = getattr(self, "labelTankReinforcedShieldPassive")
value = fit.effectiveTank["passiveShield"] if self.effective else fit.tank["passiveShield"]
- label.SetLabel(formatAmount(value, 3, 0, 9))
+ label.SetLabel(formatAmount(value, 1, 0, 9))
else:
value = 0
diff --git a/gui/builtinStatsViews/resistancesViewFull.py b/gui/builtinStatsViews/resistancesViewFull.py
index 276b5dede4..0831a6fafa 100644
--- a/gui/builtinStatsViews/resistancesViewFull.py
+++ b/gui/builtinStatsViews/resistancesViewFull.py
@@ -25,6 +25,7 @@
from gui.utils.numberFormatter import formatAmount
import gui.mainFrame
import gui.globalEvents as GE
+from gui.utils.helpers_wxPython import Fonts
EffectiveHpToggled, EFFECTIVE_HP_TOGGLED = wx.lib.newevent.NewEvent()
@@ -44,9 +45,9 @@ def __init__(self, parent):
def getHeaderText(self, fit):
return "Resistances"
- def getTextExtentW(self, text):
- width, __ = self.parent.GetTextExtent(text)
- return width
+ def getTextExtentSize(self, text):
+ width, height = self.parent.GetTextExtent(text)
+ return width, height
def populatePanel(self, contentPanel, headerPanel):
contentSizer = contentPanel.GetSizer()
@@ -138,18 +139,28 @@ def populatePanel(self, contentPanel, headerPanel):
currGColour += 1
lbl = PyGauge(contentPanel, wx.ID_ANY, 100)
- lbl.SetMinSize((48, 16))
+
+ bar_size = self.getTextExtentSize("000%")
+ bar_size = (bar_size[0] + 10, bar_size[1] + 2)
+
+ lbl.SetMinSize(bar_size)
+
lbl.SetBackgroundColour(wx.Colour(bc[0], bc[1], bc[2]))
lbl.SetBarColour(wx.Colour(fc[0], fc[1], fc[2]))
lbl.SetBarGradient()
- lbl.SetFractionDigits(1)
+
+ # Too large of a font will cause issuses with size and fit, so don't display extra info
+ if 10 < Fonts.getFont("font_standard"):
+ lbl.SetFractionDigits(0)
+ else:
+ lbl.SetFractionDigits(1)
setattr(self, "gaugeResistance%s%s" % (tankType.capitalize(), damageType.capitalize()), lbl)
box.Add(lbl, 0, wx.ALIGN_CENTER)
col += 1
box = wx.BoxSizer(wx.VERTICAL)
- box.SetMinSize(wx.Size(self.getTextExtentW("WWWWk"), -1))
+ box.SetMinSize(wx.Size(self.getTextExtentSize("WWWWk")[0], -1))
lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0" if tankType != "damagePattern" else "")
box.Add(lbl, 0, wx.ALIGN_CENTER)
diff --git a/gui/builtinStatsViews/resistancesViewMinimal.py b/gui/builtinStatsViews/resistancesViewMinimal.py
index fd311d25b8..053b8d4232 100644
--- a/gui/builtinStatsViews/resistancesViewMinimal.py
+++ b/gui/builtinStatsViews/resistancesViewMinimal.py
@@ -44,9 +44,9 @@ def __init__(self, parent):
def getHeaderText(self, fit):
return "Resistances"
- def getTextExtentW(self, text):
- width, __ = self.parent.GetTextExtent(text)
- return width
+ def getTextExtentSize(self, text):
+ width, height = self.parent.GetTextExtent(text)
+ return width, height
def populatePanel(self, contentPanel, headerPanel):
contentSizer = contentPanel.GetSizer()
@@ -119,18 +119,24 @@ def populatePanel(self, contentPanel, headerPanel):
currGColour += 1
lbl = PyGauge(contentPanel, wx.ID_ANY, 100)
- lbl.SetMinSize((48, 16))
+
+ bar_size = self.getTextExtentSize("000%")
+ bar_size = (bar_size[0] + 10, bar_size[1] + 2)
+
+ lbl.SetMinSize(bar_size)
+
lbl.SetBackgroundColour(wx.Colour(bc[0], bc[1], bc[2]))
lbl.SetBarColour(wx.Colour(fc[0], fc[1], fc[2]))
lbl.SetBarGradient()
- lbl.SetFractionDigits(1)
+
+ lbl.SetFractionDigits(0)
setattr(self, "gaugeResistance%s%s" % (tankType.capitalize(), damageType.capitalize()), lbl)
box.Add(lbl, 0, wx.ALIGN_CENTER)
col += 1
box = wx.BoxSizer(wx.VERTICAL)
- box.SetMinSize(wx.Size(self.getTextExtentW("WWWWk"), -1))
+ box.SetMinSize(wx.Size(self.getTextExtentSize("WWWWk")[0], -1))
if tankType != "damagePattern":
lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0" if tankType != "damagePattern" else "")
diff --git a/gui/builtinStatsViews/resourcesViewFull.py b/gui/builtinStatsViews/resourcesViewFull.py
index f83316b1cf..2122b263c9 100644
--- a/gui/builtinStatsViews/resourcesViewFull.py
+++ b/gui/builtinStatsViews/resourcesViewFull.py
@@ -28,6 +28,7 @@
from eos.saveddata.module import Hardpoint
from gui.utils.numberFormatter import formatAmount
+from gui.utils.helpers_wxPython import Frame, Fonts
class ResourcesViewFull(StatsView):
@@ -79,9 +80,9 @@ def toggleContext(self, context):
def getHeaderText(self, fit):
return "Resources"
- def getTextExtentW(self, text):
- width, __ = self.parent.GetTextExtent(text)
- return width
+ def getTextExtentSize(self, text):
+ width, height = self.parent.GetTextExtent(text)
+ return width, height
def populatePanel(self, contentPanel, headerPanel):
@@ -104,7 +105,9 @@ def populatePanel(self, contentPanel, headerPanel):
sizer.AddSpacer((0, 0), 1, wx.EXPAND, 5)
# Turrets & launcher hardslots display
tooltipText = {
- "turret" : "Turret hardpoints", "launcher": "Launcher hardpoints", "drones": "Drones active",
+ "turret" : "Turret hardpoints",
+ "launcher": "Launcher hardpoints",
+ "drones": "Drones active",
"fighter": "Fighter squadrons active", "calibration": "Calibration"
}
for type_ in ("turret", "launcher", "drones", "fighter", "calibration"):
@@ -186,8 +189,16 @@ def populatePanel(self, contentPanel, headerPanel):
gauge = PyGauge(parent, wx.ID_ANY, 1)
gauge.SetValueRange(0, 0)
- gauge.SetMinSize((self.getTextExtentW("1.999M/1.99M MW"), 23))
- gauge.SetFractionDigits(2)
+ bar_size = self.getTextExtentSize("0000000 LEFT")
+ bar_size = (bar_size[0] + 10, bar_size[1] + 2)
+
+ gauge.SetMinSize(bar_size)
+
+ # Too large of a font will cause issuses with size and fit, so don't display extra info
+ if 10 < Fonts.getFont("font_standard"):
+ gauge.SetFractionDigits(0)
+ else:
+ gauge.SetFractionDigits(1)
setattr(self, "gauge%s%s" % (panel.capitalize(), capitalizedType), gauge)
stats.Add(gauge, 0, wx.ALIGN_CENTER)
@@ -290,8 +301,8 @@ def refreshPanel(self, fit):
label.SetLabel(formatAmount(value, prec, lowest, highest))
label.SetToolTip(wx.ToolTip("%.1f" % value))
- colorWarn = wx.Colour(204, 51, 51)
- colorNormal = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ colorWarn = Frame.getWarningColor()
+ colorNormal = Frame.getForegroundColor()
if usedTurretHardpoints > totalTurretHardpoints:
colorT = colorWarn
diff --git a/gui/builtinViews/emptyView.py b/gui/builtinViews/emptyView.py
index 1cfa7edf8c..3d75091bd8 100644
--- a/gui/builtinViews/emptyView.py
+++ b/gui/builtinViews/emptyView.py
@@ -1,8 +1,10 @@
# noinspection PyPackageRequirements
import wx
+
import gui.globalEvents as GE
-from gui.chromeTabs import EVT_NOTEBOOK_PAGE_CHANGED
import gui.mainFrame
+from gui.chromeTabs import EVT_NOTEBOOK_PAGE_CHANGED
+from gui.utils.helpers_wxPython import Frame
class BlankPage(wx.Panel):
@@ -13,7 +15,7 @@ def __init__(self, parent):
self.parent = parent
self.parent.Bind(EVT_NOTEBOOK_PAGE_CHANGED, self.pageChanged)
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=None))
@@ -24,8 +26,6 @@ def Destroy(self, **kwargs):
def pageChanged(self, event):
if self.parent.IsActive(self):
fitID = None
- # sFit = Fit.getInstance()
- # sFit.switchFit(fitID)
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
event.Skip()
diff --git a/gui/builtinViews/entityEditor.py b/gui/builtinViews/entityEditor.py
index ca51e15f9c..3d7b4106f5 100644
--- a/gui/builtinViews/entityEditor.py
+++ b/gui/builtinViews/entityEditor.py
@@ -1,6 +1,7 @@
# noinspection PyPackageRequirements
import wx
from gui.bitmapLoader import BitmapLoader
+from gui.utils.helpers_wxPython import Frame, Fonts
# TODO: Add font sizing to this
# from gui.utils.fonts import Fonts
@@ -103,6 +104,9 @@ def OnNew(self, event):
u"Enter a name for your new {}:".format(self.entityName),
u"New {}".format(self.entityName))
dlg.CenterOnParent()
+ dlg.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+ dlg.SetFont(Fonts.getFont("font_standard"))
if dlg.ShowModal() == wx.ID_OK:
# using dlg.textctrl.GetValue instead of simply dlg.GetValue because the proper way does not work in wxPython 2.8
@@ -120,6 +124,9 @@ def OnCopy(self, event):
dlg.SetValue(u"{} Copy".format(active.name))
dlg.txtctrl.SetInsertionPointEnd()
dlg.CenterOnParent()
+ dlg.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+ dlg.SetFont(Fonts.getFont("font_standard"))
if dlg.ShowModal() == wx.ID_OK:
copy = self.DoCopy(active, dlg.txtctrl.GetValue().strip())
@@ -134,6 +141,9 @@ def OnRename(self, event):
dlg.SetValue(active.name)
dlg.txtctrl.SetInsertionPointEnd()
dlg.CenterOnParent()
+ dlg.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+ dlg.SetFont(Fonts.getFont("font_standard"))
if dlg.ShowModal() == wx.ID_OK:
self.DoRename(active, dlg.txtctrl.GetValue().strip())
@@ -146,6 +156,9 @@ def OnDelete(self, event):
self.entityName),
u"Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)
dlg.CenterOnParent()
+ dlg.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+ dlg.SetFont(Fonts.getFont("font_standard"))
if dlg.ShowModal() == wx.ID_YES:
self.DoDelete(self.getActiveEntity())
diff --git a/gui/builtinViews/fittingView.py b/gui/builtinViews/fittingView.py
index d49aa12713..dcc71fecfb 100644
--- a/gui/builtinViews/fittingView.py
+++ b/gui/builtinViews/fittingView.py
@@ -35,13 +35,11 @@
import gui.builtinViews.emptyView
from logbook import Logger
from gui.chromeTabs import EVT_NOTEBOOK_PAGE_CHANGED
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, DragDropHelper, Frame
from service.fit import Fit
from service.market import Market
-from gui.utils.staticHelpers import DragDropHelper
-
import gui.globalEvents as GE
pyfalog = Logger(__name__)
@@ -645,7 +643,7 @@ def click(self, event):
}
def slotColour(self, slot):
- return self.slotColourMap.get(slot) or self.GetBackgroundColour()
+ return self.slotColourMap.get(slot) or Frame.getBackgroundColor()
def refresh(self, stuff):
"""
@@ -667,12 +665,13 @@ def refresh(self, stuff):
slotMap[slot] = fit.getSlotsFree(slot) < 0
for i, mod in enumerate(self.mods):
- self.SetItemBackgroundColour(i, self.GetBackgroundColour())
+ # self.SetItemBackgroundColour(i, self.GetBackgroundColour())
+ self.SetItemBackgroundColour(i, Frame.getBackgroundColor())
# only consider changing color if we're dealing with a Module
if isinstance(mod, Module):
if slotMap[mod.slot]: # Color too many modules as red
- self.SetItemBackgroundColour(i, wx.Colour(204, 51, 51))
+ self.SetItemBackgroundColour(i, Frame.getWarningColor())
elif sFit.serviceFittingOptions["colorFitBySlot"]: # Color by slot it enabled
self.SetItemBackgroundColour(i, self.slotColour(mod.slot))
@@ -811,11 +810,11 @@ def MakeSnapshot(self, maxColumns=1337):
mdc.SelectObject(mbmp)
- mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)))
+ mdc.SetBackground(wx.Brush(Frame.getBackgroundColor()))
mdc.Clear()
mdc.SetFont(Fonts.getFont("font_standard"))
- mdc.SetTextForeground(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT))
+ mdc.SetTextForeground(Frame.getForegroundColor())
cx = padding
for i, col in enumerate(self.activeColumns):
@@ -841,8 +840,8 @@ def MakeSnapshot(self, maxColumns=1337):
cx += columnsWidths[i]
- brush = wx.Brush(wx.Colour(224, 51, 51))
- pen = wx.Pen(wx.Colour(224, 51, 51))
+ brush = wx.Brush(Frame.getWarningColor())
+ pen = wx.Pen(Frame.getWarningColor())
mdc.SetPen(pen)
mdc.SetBrush(brush)
diff --git a/gui/builtinViews/implantEditor.py b/gui/builtinViews/implantEditor.py
index 1993382386..1c35454e13 100644
--- a/gui/builtinViews/implantEditor.py
+++ b/gui/builtinViews/implantEditor.py
@@ -8,6 +8,7 @@
import gui.PFSearchBox as SBox
from gui.bitmapLoader import BitmapLoader
from gui.marketBrowser import SearchBox
+from gui.utils.helpers_wxPython import Frame
class BaseImplantEditorView(wx.Panel):
@@ -23,15 +24,13 @@ def addMarketViewImage(self, iconFile):
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.TAB_TRAVERSAL)
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
-
pmainSizer = wx.BoxSizer(wx.HORIZONTAL)
availableSizer = wx.BoxSizer(wx.VERTICAL)
self.searchBox = SearchBox(self)
- self.itemView = ItemView(self)
+ self.itemView = ItemView(self)
self.itemView.Hide()
availableSizer.Add(self.searchBox, 0, wx.EXPAND)
@@ -42,6 +41,9 @@ def __init__(self, parent):
self.availableImplantsImageList = wx.ImageList(16, 16)
self.availableImplantsTree.SetImageList(self.availableImplantsImageList)
+ self.availableImplantsTree.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.availableImplantsTree.SetForegroundColour(Frame.getForegroundColor())
+
availableSizer.Add(self.availableImplantsTree, 1, wx.EXPAND)
pmainSizer.Add(availableSizer, 1, wx.ALL | wx.EXPAND, 5)
@@ -62,6 +64,7 @@ def __init__(self, parent):
characterImplantSizer = wx.BoxSizer(wx.VERTICAL)
self.pluggedImplantsTree = AvailableImplantsView(self)
+ self.pluggedImplantsTree.SetBackgroundColour(Frame.getBackgroundColorOffset())
characterImplantSizer.Add(self.pluggedImplantsTree, 1, wx.ALL | wx.EXPAND, 5)
pmainSizer.Add(characterImplantSizer, 1, wx.EXPAND, 5)
diff --git a/gui/cargoView.py b/gui/cargoView.py
index ceea96c161..6646e03813 100644
--- a/gui/cargoView.py
+++ b/gui/cargoView.py
@@ -23,7 +23,7 @@
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
import globalEvents as GE
-from gui.utils.staticHelpers import DragDropHelper
+from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
from service.market import Market
diff --git a/gui/characterEditor.py b/gui/characterEditor.py
index f2b682bbfc..41f19168d3 100644
--- a/gui/characterEditor.py
+++ b/gui/characterEditor.py
@@ -35,7 +35,7 @@
from service.network import AuthenticationError, TimeoutError
from service.market import Market
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -138,7 +138,7 @@ def __init__(self, parent):
# self.disableWin = wx.WindowDisabler(self)
sFit = Fit.getInstance()
- self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -149,6 +149,8 @@ def __init__(self, parent):
self.viewsNBContainer = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0)
+ self.viewsNBContainer.SetBackgroundColour(Frame.getBackgroundColor())
+
self.sview = SkillTreeView(self.viewsNBContainer)
self.iview = ImplantEditorView(self.viewsNBContainer)
self.aview = APIView(self.viewsNBContainer)
@@ -271,7 +273,8 @@ def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.TAB_TRAVERSAL)
self.charEditor = self.Parent.Parent # first parent is Notebook, second is Character Editor
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
self.SetFont(Fonts.getFont("font_standard"))
pmainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -281,11 +284,14 @@ def __init__(self, parent):
self.clonesChoice = wx.Choice(self, wx.ID_ANY, style=0)
i = self.clonesChoice.Append("Omega Clone", None)
self.clonesChoice.SetSelection(i)
+ self.clonesChoice.SetForegroundColour(Frame.getForegroundColor())
hSizer.Add(self.clonesChoice, 5, wx.ALL | wx.EXPAND, 5)
self.searchInput = PlaceholderTextCtrl(self, wx.ID_ANY, placeholder="Search...")
hSizer.Add(self.searchInput, 1, wx.ALL | wx.EXPAND, 5)
self.searchInput.Bind(wx.EVT_TEXT, self.delaySearch)
+ self.searchInput.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.searchInput.SetForegroundColour(Frame.getForegroundColor())
sChar = Character.getInstance()
self.alphaClones = sChar.getAlphaCloneList()
@@ -306,6 +312,8 @@ def __init__(self, parent):
tree = self.skillTreeListCtrl = wx.gizmos.TreeListCtrl(self, wx.ID_ANY, style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT)
tree.SetFont(Fonts.getFont("font_standard"))
+ tree.SetBackgroundColour(Frame.getBackgroundColor())
+ tree.SetForegroundColour(Frame.getForegroundColor())
pmainSizer.Add(tree, 1, wx.EXPAND | wx.ALL, 5)
self.imageList = wx.ImageList(16, 16)
@@ -608,7 +616,7 @@ def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(500, 300),
style=wx.TAB_TRAVERSAL)
self.charEditor = self.Parent.Parent # first parent is Notebook, second is Character Editor
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
self.apiUrlCreatePredefined = u"https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=8"
self.apiUrlKeyList = u"https://community.eveonline.com/support/api-key/"
@@ -636,6 +644,7 @@ def __init__(self, parent):
fgSizerInput.Add(self.m_staticIDText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
self.inputID = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
+ self.inputID.SetBackgroundColour(Frame.getBackgroundColorOffset())
fgSizerInput.Add(self.inputID, 1, wx.ALL | wx.EXPAND, 5)
self.m_staticKeyText = wx.StaticText(self, wx.ID_ANY, u"vCode:", wx.DefaultPosition, wx.DefaultSize, 0)
@@ -643,6 +652,7 @@ def __init__(self, parent):
fgSizerInput.Add(self.m_staticKeyText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
self.inputKey = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
+ self.inputKey.SetBackgroundColour(Frame.getBackgroundColorOffset())
fgSizerInput.Add(self.inputKey, 0, wx.ALL | wx.EXPAND, 5)
self.m_staticCharText = wx.StaticText(self, wx.ID_ANY, u"Character:", wx.DefaultPosition, wx.DefaultSize, 0)
@@ -824,6 +834,10 @@ def __init__(self, parent, sec):
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
+ self.SetFont(Fonts.getFont("font_standard"))
+
bSizer1 = wx.BoxSizer(wx.VERTICAL)
self.m_staticText1 = wx.StaticText(self, wx.ID_ANY,
@@ -833,6 +847,7 @@ def __init__(self, parent, sec):
bSizer1.Add(self.m_staticText1, 1, wx.ALL | wx.EXPAND, 5)
self.floatSpin = FloatSpin(self, value=sec, min_val=-5.0, max_val=5.0, increment=0.1, digits=2, size=(100, -1))
+ self.floatSpin.SetBackgroundColour(Frame.getBackgroundColorOffset())
bSizer1.Add(self.floatSpin, 0, wx.ALIGN_CENTER | wx.ALL, 5)
btnOk = wx.Button(self, wx.ID_OK)
diff --git a/gui/characterSelection.py b/gui/characterSelection.py
index dbde1aa2f6..eb04ddd53c 100644
--- a/gui/characterSelection.py
+++ b/gui/characterSelection.py
@@ -26,7 +26,7 @@
from service.fit import Fit
from logbook import Logger
from eos.config import settings as eos_settings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
pyfalog = Logger(__name__)
diff --git a/gui/chromeTabs.py b/gui/chromeTabs.py
index 07b403e27f..ae0ae4b5ef 100644
--- a/gui/chromeTabs.py
+++ b/gui/chromeTabs.py
@@ -26,7 +26,7 @@
from gui.bitmapLoader import BitmapLoader
from logbook import Logger
from service.fit import Fit
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -107,6 +107,8 @@ def __init__(self, parent, canAdd=True):
wx.Panel.__init__(self, parent, wx.ID_ANY, size=(-1, -1))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+
self.pages = []
self.activePage = None
@@ -114,13 +116,15 @@ def __init__(self, parent, canAdd=True):
tabsSizer = wx.BoxSizer(wx.VERTICAL)
self.tabsContainer = PFTabsContainer(self, canAdd=canAdd)
+
tabsSizer.Add(self.tabsContainer, 0, wx.EXPAND)
style = wx.DOUBLE_BORDER if 'wxMSW' in wx.PlatformInfo else wx.SIMPLE_BORDER
contentSizer = wx.BoxSizer(wx.VERTICAL)
self.pageContainer = wx.Panel(self, style=style)
- self.pageContainer.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.pageContainer.SetBackgroundColour(Frame.getBackgroundColor())
+ self.pageContainer.SetForegroundColour(Frame.getForegroundColor())
contentSizer.Add(self.pageContainer, 1, wx.EXPAND, 5)
mainSizer.Add(tabsSizer, 0, wx.EXPAND, 5)
@@ -221,14 +225,29 @@ def AddPage(self, tabWnd=None, tabTitle="Empty Tab", tabImage=None, showClose=Tr
if not tabWnd:
tabWnd = wx.Panel(self)
+ self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
+
tabWnd.Reparent(self.pageContainer)
+ tabWnd.SetBackgroundColour(Frame.getBackgroundColor())
+ tabWnd.SetForegroundColour(Frame.getForegroundColor())
+ self.pageContainer.SetBackgroundColour(Frame.getBackgroundColor())
+ self.pageContainer.SetForegroundColour(Frame.getForegroundColor())
+
self.pageContainer.Layout()
self.pages.append(tabWnd)
self.tabsContainer.AddTab(tabTitle, tabImage, showClose)
+ self.tabsContainer.SetBackgroundColour(Frame.getBackgroundColor())
+ self.tabsContainer.SetForegroundColour(Frame.getForegroundColor())
+
self.activePage = tabWnd
+ self.activePage.SetBackgroundColour(Frame.getBackgroundColor())
+ self.activePage.SetForegroundColour(Frame.getForegroundColor())
+
self.ShowActive(True)
def DisablePage(self, page, toggle):
@@ -567,7 +586,7 @@ def InitTabRegions(self):
def InitColors(self):
"""Determines colors used for tab, based on system settings"""
- self.tabColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)
+ self.tabColor = Frame.getBackgroundColor()
self.inactiveColor = colorUtils.GetSuitableColor(self.tabColor, 0.25)
self.selectedColor = colorUtils.GetSuitableColor(self.tabColor, 0.10)
@@ -608,9 +627,11 @@ def _Render(self):
mdc.SetFont(Fonts.getFont("font_standard"))
maxsize = self.tabWidth - textStart - self.rightWidth - self.padding * 4
- color = self.selectedColor if self.selected else self.inactiveColor
- mdc.SetTextForeground(colorUtils.GetSuitableColor(color, 1))
+ if self.selected:
+ mdc.SetTextForeground(Frame.getForegroundColor())
+ else:
+ mdc.SetTextForeground(colorUtils.GetSuitableColor(Frame.getForegroundColor(), .2))
text = drawUtils.GetPartialText(mdc, self.text, maxsize, "")
__, ty = mdc.GetTextExtent(text)
@@ -720,14 +741,14 @@ def _Render(self):
class PFTabsContainer(wx.Panel):
- def __init__(self, parent, pos=(0, 0), size=(100, 22), id=wx.ID_ANY, canAdd=True):
+ def __init__(self, parent, pos=(0, 0), size=(100, 22), init_id=wx.ID_ANY, canAdd=True):
"""
Defines the tab container. Handles functions such as tab selection and
dragging, and defines minimum width of tabs (all tabs are of equal width,
which is determined via widest tab). Also handles the tab preview, if any.
"""
- wx.Panel.__init__(self, parent, id, pos, size)
+ wx.Panel.__init__(self, parent, init_id, pos, size)
if wx.VERSION >= (3, 0):
self.SetBackgroundStyle(wx.BG_STYLE_PAINT)
@@ -1363,7 +1384,7 @@ def __init__(self, parent, pos, bitmap, title):
wx.Frame.__init__(
self,
parent,
- id=wx.ID_ANY,
+ init_id=wx.ID_ANY,
title=wx.EmptyString,
pos=pos,
size=wx.DefaultSize,
diff --git a/gui/commandView.py b/gui/commandView.py
index 5e4cfa8dd1..bb2741eb28 100644
--- a/gui/commandView.py
+++ b/gui/commandView.py
@@ -26,7 +26,7 @@
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
from gui.builtinContextMenus.commandFits import CommandFits
-from gui.utils.staticHelpers import DragDropHelper
+from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
from eos.saveddata.drone import Drone as es_Drone
diff --git a/gui/crestFittings.py b/gui/crestFittings.py
index 512ebd3623..7b434e1eed 100644
--- a/gui/crestFittings.py
+++ b/gui/crestFittings.py
@@ -15,7 +15,7 @@
import gui.globalEvents as GE
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -28,7 +28,7 @@ def __init__(self, parent):
wx.Frame.__init__(self, parent, id=wx.ID_ANY, title="Browse EVE Fittings", pos=wx.DefaultPosition,
size=wx.Size(550, 450), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
- self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
self.mainFrame = parent
mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -195,7 +195,7 @@ def __init__(self, parent):
size=(wx.Size(350, 100)), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
self.mainFrame = parent
- self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
sCrest = Crest.getInstance()
mainSizer = wx.BoxSizer(wx.VERTICAL)
diff --git a/gui/display.py b/gui/display.py
index ec1962c068..ba76b9f22c 100644
--- a/gui/display.py
+++ b/gui/display.py
@@ -23,7 +23,7 @@
import gui.mainFrame
from gui.viewColumn import ViewColumn
from gui.cachingImageList import CachingImageList
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
class Display(wx.ListCtrl):
@@ -34,6 +34,8 @@ def __init__(self, parent, size=wx.DefaultSize, style=0):
wx.ListCtrl.__init__(self, parent, size=size, style=wx.LC_REPORT | style)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
self.imageList = CachingImageList(16, 16)
self.SetImageList(self.imageList, wx.IMAGE_LIST_SMALL)
diff --git a/gui/droneView.py b/gui/droneView.py
index e4316059c4..d6c2967e17 100644
--- a/gui/droneView.py
+++ b/gui/droneView.py
@@ -25,7 +25,7 @@
from gui.display import Display
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
-from gui.utils.staticHelpers import DragDropHelper
+from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
from service.market import Market
diff --git a/gui/errorDialog.py b/gui/errorDialog.py
index 37d8b3ca10..6b94e8c79c 100644
--- a/gui/errorDialog.py
+++ b/gui/errorDialog.py
@@ -19,12 +19,13 @@
import platform
import sys
-from gui.utils.fonts import Fonts
-from service.settings import GeneralSettings
# noinspection PyPackageRequirements
import wx
+from gui.utils.helpers_wxPython import Fonts, Frame
+from service.settings import GeneralSettings
+
try:
import config
except:
@@ -69,9 +70,8 @@ def __init__(self, exception=None, tb=None, error_title='Error!'):
self.SetFont(Fonts.getFont("font_standard"))
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
-
- if 'wxMSW' in wx.PlatformInfo:
- self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
headSizer = wx.BoxSizer(wx.HORIZONTAL)
diff --git a/gui/fighterView.py b/gui/fighterView.py
index d890c346b8..12906ee49d 100644
--- a/gui/fighterView.py
+++ b/gui/fighterView.py
@@ -27,7 +27,7 @@
from gui.builtinViewColumns.state import State
from eos.saveddata.module import Slot
from gui.contextMenu import ContextMenu
-from gui.utils.staticHelpers import DragDropHelper
+from gui.utils.helpers_wxPython import DragDropHelper, Frame
from service.fit import Fit
from service.market import Market
@@ -94,8 +94,7 @@ def fitChanged(self, event):
slot = getattr(Slot, "F_{}".format(x.upper()))
used = fit.getSlotsUsed(slot)
total = fit.getNumSlots(slot)
- color = wx.Colour(204, 51, 51) if used > total else wx.SystemSettings_GetColour(
- wx.SYS_COLOUR_WINDOWTEXT)
+ color = Frame.getWarningColor() if used > total else Frame.getForegroundColor()
lbl = getattr(self, "label%sUsed" % x.capitalize())
lbl.SetLabel(str(int(used)))
diff --git a/gui/graphFrame.py b/gui/graphFrame.py
index 8dfa8a16b3..e69b389912 100644
--- a/gui/graphFrame.py
+++ b/gui/graphFrame.py
@@ -30,7 +30,7 @@
from gui.graph import Graph
from gui.bitmapLoader import BitmapLoader
import traceback
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
from service.settings import GeneralSettings
pyfalog = Logger(__name__)
@@ -116,6 +116,8 @@ def __init__(self, parent, style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_
i = wx.IconFromBitmap(BitmapLoader.getBitmap("graphs_small", "gui"))
self.SetIcon(i)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.CreateStatusBar()
@@ -135,13 +137,12 @@ def __init__(self, parent, style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_
self.figure = Figure(figsize=(4, 3))
- rgbtuple = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE).Get()
- clr = [c / 255. for c in rgbtuple]
+ clr = [c / 255. for c in wx.LIGHT_GREY]
self.figure.set_facecolor(clr)
self.figure.set_edgecolor(clr)
self.canvas = Canvas(self, -1, self.figure)
- self.canvas.SetBackgroundColour(wx.Colour(*rgbtuple))
+ self.canvas.SetBackgroundColour(Frame.getBackgroundColorOffset())
self.subplot = self.figure.add_subplot(111)
self.subplot.grid(True)
@@ -234,8 +235,9 @@ def select(self, index):
else:
label = field
- imgLabelSizer.Add(wx.StaticText(self.gridPanel, wx.ID_ANY, label), 0,
- wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
+ labelText = wx.StaticText(self.gridPanel, wx.ID_ANY, label)
+ labelText.SetForegroundColour(Frame.getForegroundColor())
+ imgLabelSizer.Add(labelText, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
sizer.Add(imgLabelSizer, 0, wx.ALIGN_CENTER_VERTICAL)
self.draw()
diff --git a/gui/itemStats.py b/gui/itemStats.py
index 736000b779..bcc3833308 100644
--- a/gui/itemStats.py
+++ b/gui/itemStats.py
@@ -48,7 +48,7 @@
from gui.bitmapLoader import BitmapLoader
from gui.utils.numberFormatter import formatAmount
from gui.contextMenu import ContextMenu
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
class ItemStatsDialog(wx.Dialog):
@@ -75,6 +75,8 @@ def __init__(
# Set the font size used on the stats pane
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
empty = getattr(victim, "isEmpty", False)
@@ -106,11 +108,8 @@ def __init__(
self.SetTitle("%s: %s%s" % ("%s Stats" % itmContext if itmContext is not None else "Stats", item.name,
" (%d)" % item.ID if config.debug else ""))
- self.SetMinSize((300, 200))
- if "wxGTK" in wx.PlatformInfo: # GTK has huge tab widgets, give it a bit more room
- self.SetSize((580, 500))
- else:
- self.SetSize((550, 500))
+ self.SetMinSize((400, 300))
+ self.SetSize((750, 600))
# self.SetMaxSize((500, -1))
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
self.container = ItemStatsContainer(self, victim, item, itmContext)
@@ -171,6 +170,8 @@ class ItemStatsContainer(wx.Panel):
def __init__(self, parent, stuff, item, context=None):
wx.Panel.__init__(self, parent)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
sMkt = Market.getInstance()
@@ -243,12 +244,16 @@ def __init__(self, parent, stuff, item):
wx.Panel.__init__(self, parent)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(mainSizer)
self.traits = wx.html.HtmlWindow(self)
self.traits.SetPage(item.traits.traitText)
+ self.traits.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.traits.SetForegroundColour(Frame.getForegroundColor())
mainSizer.Add(self.traits, 1, wx.ALL | wx.EXPAND, 0)
self.Layout()
@@ -258,10 +263,12 @@ class ItemDescription(wx.Panel):
def __init__(self, parent, stuff, item):
wx.Panel.__init__(self, parent)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(mainSizer)
- bgcolor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- fgcolor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ bgcolor = Frame.getBackgroundColorOffset()
+ fgcolor = Frame.getForegroundColor()
self.description = wx.html.HtmlWindow(self)
@@ -286,6 +293,8 @@ class ItemParams(wx.Panel):
def __init__(self, parent, stuff, item, context=None):
wx.Panel.__init__(self, parent)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -758,6 +767,8 @@ def __init__(self, parent, stuff, item):
self.SetSizer(mainSizer)
self.root = self.reqTree.AddRoot("WINRARZOR")
self.reqTree.SetPyData(self.root, None)
+ self.reqTree.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.reqTree.SetForegroundColour(Frame.getForegroundColor())
self.imageList = wx.ImageList(16, 16)
self.reqTree.SetImageList(self.imageList)
diff --git a/gui/mainFrame.py b/gui/mainFrame.py
index c95bec06a4..adb3994a5f 100644
--- a/gui/mainFrame.py
+++ b/gui/mainFrame.py
@@ -17,70 +17,62 @@
# along with pyfa. If not, see .
# =============================================================================
-import sys
import os.path
-from logbook import Logger
+import sys
+import threading
+import time
+import webbrowser
+from codecs import open
+from time import gmtime, strftime
import sqlalchemy
# noinspection PyPackageRequirements
import wx
+from logbook import Logger
# noinspection PyPackageRequirements
from wx._core import PyDeadObjectError
# noinspection PyPackageRequirements
-from wx.lib.wordwrap import wordwrap
-# noinspection PyPackageRequirements
from wx.lib.inspection import InspectionTool
-import time
-
-from codecs import open
+# noinspection PyPackageRequirements
+from wx.lib.wordwrap import wordwrap
import config
-
-from eos.config import gamedata_version
-
import gui.aboutData
-from gui.chromeTabs import PFNotebook
import gui.globalEvents as GE
-
-from gui.bitmapLoader import BitmapLoader
-from gui.mainMenuBar import MainMenuBar
+from eos.config import gamedata_version
+from eos.db.saveddata.loadDefaultDatabaseValues import DefaultDatabaseValues
+from eos.db.saveddata.queries import getFit as db_getFit
+# import this to access override setting
+from eos.modifiedAttributeDict import ModifiedAttributeDict
+from gui import graphFrame
from gui.additionsPane import AdditionsPane
-from gui.marketBrowser import MarketBrowser, ItemSelected
-from gui.multiSwitch import MultiSwitch
-from gui.statsPane import StatsPane
-from gui.shipBrowser import ShipBrowser, FitSelected, ImportSelected, Stage3Selected
-from gui.recentShipBrowser import RecentShipBrowser
+from gui.bitmapLoader import BitmapLoader
+# noinspection PyUnresolvedReferences
+from gui.builtinViews import emptyView, entityEditor, fittingView, implantEditor # noqa: F401
from gui.characterEditor import CharacterEditor, SaveCharacterAs
from gui.characterSelection import CharacterSelection
+from gui.chromeTabs import PFNotebook
+from gui.copySelectDialog import CopySelectDialog
+from gui.graphFrame import GraphFrame
+from gui.mainMenuBar import MainMenuBar
+from gui.marketBrowser import ItemSelected, MarketBrowser
+from gui.multiSwitch import MultiSwitch
from gui.patternEditor import DmgPatternEditorDlg
+from gui.preferenceDialog import PreferenceDialog
+from gui.recentShipBrowser import RecentShipBrowser
from gui.resistsEditor import ResistsEditorDlg
from gui.setEditor import ImplantSetEditorDlg
-from gui.preferenceDialog import PreferenceDialog
-from gui.graphFrame import GraphFrame
-from gui.copySelectDialog import CopySelectDialog
-from gui.utils.clipboard import toClipboard, fromClipboard
+from gui.shipBrowser import FitSelected, ImportSelected, ShipBrowser, Stage3Selected
+from gui.statsPane import StatsPane
from gui.updateDialog import UpdateDialog
-# noinspection PyUnresolvedReferences
-from gui.builtinViews import emptyView, entityEditor, fittingView, implantEditor # noqa: F401
-from gui import graphFrame
-
-from service.settings import SettingsProvider
-from service.fit import Fit
+from gui.utils.clipboard import fromClipboard, toClipboard
+from gui.utils.helpers_wxPython import Frame
from service.character import Character
+from service.fit import Fit
+from service.port import IPortUser, Port
+from service.settings import HTMLExportSettings, SettingsProvider
from service.update import Update
-# import this to access override setting
-from eos.modifiedAttributeDict import ModifiedAttributeDict
-from eos.db.saveddata.loadDefaultDatabaseValues import DefaultDatabaseValues
-from eos.db.saveddata.queries import getFit as db_getFit
-from service.port import Port, IPortUser
-from service.settings import HTMLExportSettings
-
-from time import gmtime, strftime
-
-import threading
-import webbrowser
-
if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)):
from service.crest import Crest
from service.crest import CrestModes
@@ -156,9 +148,8 @@ def __init__(self, title="Pyfa.fit"):
self.disableOverrideEditor = disableOverrideEditor
- # Fix for msw (have the frame background color match panel color
- if 'wxMSW' in wx.PlatformInfo:
- self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
# Load and set the icon for pyfa main window
i = wx.IconFromBitmap(BitmapLoader.getBitmap("pyfa", "gui"))
@@ -246,6 +237,8 @@ def __init__(self, title="Pyfa.fit"):
def ShowUpdateBox(self, release):
dlg = UpdateDialog(self, release)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.ShowModal()
def LoadPreviousOpenFits(self):
@@ -279,7 +272,6 @@ def LoadMainFrameAttribs(self):
}
self.mainFrameAttribs = SettingsProvider.getInstance().getSettings("pyfaMainWindowAttribs",
mainFrameDefaultAttribs)
-
if self.mainFrameAttribs["wnd_maximized"]:
width = mainFrameDefaultAttribs["wnd_width"]
height = mainFrameDefaultAttribs["wnd_height"]
@@ -389,10 +381,14 @@ def ShowAboutBox(self, evt):
def showCharacterEditor(self, event):
dlg = CharacterEditor(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.Show()
def showAttrEditor(self, event):
dlg = AttributeEditor(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.Show()
def showTargetResistsEditor(self, event):
@@ -400,7 +396,12 @@ def showTargetResistsEditor(self, event):
def showDamagePatternEditor(self, event):
dlg = DmgPatternEditorDlg(self)
+
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+
dlg.ShowModal()
+
try:
dlg.Destroy()
except PyDeadObjectError:
@@ -419,6 +420,10 @@ def showExportDialog(self, event):
wildcard="EVE XML fitting files (*.xml)|*.xml",
style=wx.FD_SAVE,
defaultFile=defaultFile)
+
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+
if dlg.ShowModal() == wx.ID_OK:
format_ = dlg.GetFilterIndex()
path = dlg.GetPath()
@@ -445,6 +450,8 @@ def showExportDialog(self, event):
def showPreferenceDialog(self, event):
dlg = PreferenceDialog(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.ShowModal()
@staticmethod
@@ -587,6 +594,8 @@ def registerMenu(self):
def eveFittings(self, event):
dlg = CrestFittings(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.Show()
def updateTitle(self, event):
@@ -647,10 +656,14 @@ def ssoHandler(self, event):
webbrowser.open(uri)
else:
dlg = CrestMgmt(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.Show()
def exportToEve(self, event):
dlg = ExportToEve(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.Show()
def toggleOverrides(self, event):
@@ -669,6 +682,8 @@ def saveChar(self, event):
def saveCharAs(self, event):
charID = self.charSelection.getActiveCharacter()
dlg = SaveCharacterAs(self, charID)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.ShowModal()
def revertChar(self, event):
@@ -754,6 +769,8 @@ def exportToClipboard(self, event):
CopySelectDialog.copyFormatMultiBuy: self.clipboardMultiBuy
}
dlg = CopySelectDialog(self)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.ShowModal()
selected = dlg.GetSelected()
@@ -776,6 +793,9 @@ def exportSkillsNeeded(self, event):
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
)
+ saveDialog.SetBackgroundColour(Frame.getBackgroundColor())
+ saveDialog.SetForegroundColour(Frame.getForegroundColor())
+
if saveDialog.ShowModal() == wx.ID_OK:
saveFmtInt = saveDialog.GetFilterIndex()
@@ -805,6 +825,10 @@ def fileImportDialog(self, event):
"All Files (*)|*"),
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
)
+
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+
if dlg.ShowModal() == wx.ID_OK:
self.progressDialog = wx.ProgressDialog(
"Importing fits",
@@ -812,7 +836,8 @@ def fileImportDialog(self, event):
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
)
- # self.progressDialog.message = None
+ self.progressDialog.SetBackgroundColour(Frame.getBackgroundColor())
+ self.progressDialog.SetForegroundColour(Frame.getForegroundColor())
Port.importFitsThreaded(dlg.GetPaths(), self)
self.progressDialog.ShowModal()
try:
@@ -832,6 +857,9 @@ def backupToXml(self, event):
defaultFile=defaultFile,
)
+ saveDialog.SetBackgroundColour(Frame.getBackgroundColor())
+ saveDialog.SetForegroundColour(Frame.getForegroundColor())
+
if saveDialog.ShowModal() == wx.ID_OK:
filePath = saveDialog.GetPath()
if u'.' not in os.path.basename(filePath):
@@ -847,11 +875,13 @@ def backupToXml(self, event):
parent=self,
style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL
)
+ self.progressDialog.SetBackgroundColour(Frame.getBackgroundColor())
+ self.progressDialog.SetForegroundColour(Frame.getForegroundColor())
Port.backupFits(filePath, self)
self.progressDialog.ShowModal()
def exportHtml(self, event):
- from gui.utils.exportHtml import exportHtml
+ from gui.utils.exportHtml import ExportHtml
sFit = Fit.getInstance()
settings = HTMLExportSettings.getInstance()
@@ -866,6 +896,9 @@ def exportHtml(self, event):
wx.OK | wx.ICON_ERROR
)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+
if dlg.ShowModal() == wx.ID_OK:
return
@@ -876,7 +909,10 @@ def exportHtml(self, event):
style=wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME
)
- exportHtml.getInstance().refreshFittingHtml(True, self.backupCallback)
+ self.progressDialog.SetBackgroundColour(Frame.getBackgroundColor())
+ self.progressDialog.SetForegroundColour(Frame.getForegroundColor())
+
+ ExportHtml.getInstance().refreshFittingHtml(True, self.backupCallback)
self.progressDialog.ShowModal()
def backupCallback(self, info):
@@ -918,8 +954,8 @@ def _on_port_processing(self, action, data):
dlg = wx.MessageDialog(self,
"The following error was generated\n\n%s\n\nBe aware that already processed fits were not saved" % data,
_message, wx.OK | wx.ICON_ERROR)
- # if dlg.ShowModal() == wx.ID_OK:
- # return
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
dlg.ShowModal()
return
@@ -981,6 +1017,9 @@ def importCharacter(self, event):
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE
)
+ dlg.SetBackgroundColour(Frame.getBackgroundColor())
+ dlg.SetForegroundColour(Frame.getForegroundColor())
+
if dlg.ShowModal() == wx.ID_OK:
self.waitDialog = wx.BusyInfo("Importing Character...")
sCharacter = Character.getInstance()
diff --git a/gui/marketBrowser.py b/gui/marketBrowser.py
index 99af202db0..2f2e84686f 100644
--- a/gui/marketBrowser.py
+++ b/gui/marketBrowser.py
@@ -27,9 +27,8 @@
from gui.contextMenu import ContextMenu
from gui.bitmapLoader import BitmapLoader
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, DragDropHelper, Frame
from service.settings import GeneralSettings
-from utils.staticHelpers import DragDropHelper
pyfalog = Logger(__name__)
@@ -64,6 +63,8 @@ def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
pyfalog.debug("Initialize marketBrowser")
vbox = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(vbox)
@@ -143,6 +144,10 @@ def __init__(self, parent, **kwargs):
class MarketTree(wx.TreeCtrl):
def __init__(self, parent, marketBrowser):
wx.TreeCtrl.__init__(self, parent, style=wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT)
+
+ self.SetFont(Fonts.getFont("font_standard"))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
pyfalog.debug("Initialize marketTree")
self.root = self.AddRoot("root")
diff --git a/gui/multiSwitch.py b/gui/multiSwitch.py
index ac2ad92bc7..f99ecb9c9a 100644
--- a/gui/multiSwitch.py
+++ b/gui/multiSwitch.py
@@ -17,13 +17,15 @@
# along with pyfa. If not, see .
# =============================================================================
-from gui.chromeTabs import PFNotebook
import gui.builtinViews.emptyView
+from gui.chromeTabs import PFNotebook
+from gui.utils.helpers_wxPython import Frame
class MultiSwitch(PFNotebook):
def __init__(self, parent):
PFNotebook.__init__(self, parent)
+ self.SetBackgroundColour(Frame.getBackgroundColor())
# self.AddPage() # now handled by mainFrame
self.handlers = handlers = []
for tab_type in TabSpawner.tabTypes:
diff --git a/gui/patternEditor.py b/gui/patternEditor.py
index fd796ed085..7628a68879 100644
--- a/gui/patternEditor.py
+++ b/gui/patternEditor.py
@@ -26,7 +26,7 @@
from gui.builtinViews.entityEditor import EntityEditor, BaseValidator
from service.damagePattern import DamagePattern, ImportError
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
from service.settings import GeneralSettings
pyfalog = Logger(__name__)
diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py
index ca3617a8f8..42d60cac11 100644
--- a/gui/preferenceDialog.py
+++ b/gui/preferenceDialog.py
@@ -23,7 +23,7 @@
from gui.bitmapLoader import BitmapLoader
from service.settings import SettingsProvider, GeneralSettings
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -38,10 +38,21 @@ def __init__(self, parent):
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.listbook = wx.Listbook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT)
+ self.listbook.SetBackgroundColour(Frame.getBackgroundColor())
- self.listview = self.listbook.GetListView()
- # self.listview.SetMinSize((500, -1))
- # self.listview.SetSize((500, -1))
+ preferences_listview = self.listbook.Children[0]
+
+ preferences_listview.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ preferences_listview.SetForegroundColour(Frame.getForegroundColor())
+ preferences_listview.Size.x = self.listbook.GetTextExtent("Statistics Panels")[0]
+ # preferences_listview.SetSize((self.listbook.GetTextExtent("Statistics Panels")[0], -1))
+
+ '''
+ self.listbook.Children[0].SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.listbook.Children[0].SetForegroundColour(Frame.getForegroundColor())
+ self.listbook.Children[0].SetSize((self.listbook.GetTextExtent("Statistics Panels")[0], -1))
+ test = self.listbook.Children[0]
+ '''
self.imageList = wx.ImageList(32, 32)
self.listbook.SetImageList(self.imageList)
@@ -62,6 +73,7 @@ def __init__(self, parent):
for prefView in PreferenceView.views:
page = wx.Panel(self.listbook)
+ page.SetForegroundColour(Frame.getForegroundColor())
bmp = prefView.getImage()
if bmp:
imgID = self.imageList.Add(bmp)
@@ -73,8 +85,8 @@ def __init__(self, parent):
self.generalSettings = GeneralSettings.getInstance()
fontSize = self.generalSettings.get("fontSize")
- window_x = 650
- window_y = 550
+ window_x = 900
+ window_y = 450
# Set the height based on a condition. Can all the panels fit in the current height?
# If not, use the .GetBestVirtualSize() to ensure that all content is available.
diff --git a/gui/preferenceView.py b/gui/preferenceView.py
index 0972cf863c..4dfa923992 100644
--- a/gui/preferenceView.py
+++ b/gui/preferenceView.py
@@ -41,6 +41,7 @@ def getImage(self):
# noinspection PyUnresolvedReferences
from gui.builtinPreferenceViews import ( # noqa: E402, F401
pyfaGeneralPreferences,
+ pyfaGeneral2Preferences,
pyfaNetworkPreferences,
pyfaHTMLExportPreferences,
pyfaCrestPreferences,
diff --git a/gui/projectedView.py b/gui/projectedView.py
index 0d7f0fc1c7..19673c3e7d 100644
--- a/gui/projectedView.py
+++ b/gui/projectedView.py
@@ -25,7 +25,7 @@
import gui.droneView
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
-from gui.utils.staticHelpers import DragDropHelper
+from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
from service.market import Market
from eos.saveddata.drone import Drone as es_Drone
diff --git a/gui/propertyEditor.py b/gui/propertyEditor.py
index fc69707280..adbdd8d1e8 100644
--- a/gui/propertyEditor.py
+++ b/gui/propertyEditor.py
@@ -20,7 +20,7 @@
import gui.PFSearchBox as SBox
from gui.marketBrowser import SearchBox
from gui.bitmapLoader import BitmapLoader
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
from service.settings import GeneralSettings
pyfalog = Logger(__name__)
@@ -74,7 +74,13 @@ def __init__(self, parent):
style=wx.DOUBLE_BORDER if 'wxMSW' in wx.PlatformInfo else wx.SIMPLE_BORDER)
self.searchBox = SearchBox(leftPanel)
+ self.searchBox.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.searchBox.SetForegroundColour(Frame.getForegroundColor())
+ self.searchBox.SetFont(Fonts.getFont("font_standard"))
+
self.itemView = ItemView(leftPanel)
+ self.itemView.SetBackgroundColour(Frame.getBackgroundColorOffset())
+ self.itemView.SetForegroundColour(Frame.getForegroundColor())
leftSizer.Add(self.searchBox, 0, wx.EXPAND)
leftSizer.Add(self.itemView, 1, wx.EXPAND)
diff --git a/gui/pyfatogglepanel.py b/gui/pyfatogglepanel.py
index 786a88aa1b..58ab22e4c1 100644
--- a/gui/pyfatogglepanel.py
+++ b/gui/pyfatogglepanel.py
@@ -24,7 +24,7 @@
# noinspection PyPackageRequirements
import wx
from gui.bitmapLoader import BitmapLoader
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
class TogglePanel(wx.Panel):
@@ -35,7 +35,8 @@ def __init__(self, parent, forceLayout=-1):
self._toggle = 1
self.parent = parent
self.forceLayout = forceLayout
- self.bkColour = self.GetBackgroundColour()
+ # self.bkColour = self.GetBackgroundColour()
+ self.bkColour = Frame.getBackgroundColor()
# Create the main sizer of this panel
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
@@ -51,7 +52,8 @@ def __init__(self, parent, forceLayout=-1):
self.bmpCollapsed = BitmapLoader.getBitmap("up-arrow2", "gui")
# Make the bitmaps have the same color as window text
- sysTextColour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ # sysTextColour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ sysTextColour = Frame.getForegroundColor()
img = self.bmpExpanded.ConvertToImage()
img.Replace(0, 0, 0, sysTextColour[0], sysTextColour[1], sysTextColour[2])
@@ -76,6 +78,7 @@ def __init__(self, parent, forceLayout=-1):
hbmpSizer.Add(self.headerBmp, 0, 0, 5)
self.headerLabel = wx.StaticText(self.headerPanel, wx.ID_ANY, u"PYFA", wx.DefaultPosition, wx.DefaultSize, 0)
+ self.headerLabel.SetForegroundColour(Frame.getForegroundColor())
hlblSizer.Add(self.headerLabel, 0, wx.EXPAND, 5)
headerSizer.Add(hbmpSizer, 0, wx.RIGHT, 5)
diff --git a/gui/pygauge.py b/gui/pygauge.py
index 317e26e828..c74397f21a 100644
--- a/gui/pygauge.py
+++ b/gui/pygauge.py
@@ -18,7 +18,7 @@
from gui.utils import colorUtils
import gui.utils.drawUtils as drawUtils
import gui.utils.animEffects as animEffects
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts
from service.fit import Fit
diff --git a/gui/recentShipBrowser.py b/gui/recentShipBrowser.py
index fbaf367437..b02ef9852e 100644
--- a/gui/recentShipBrowser.py
+++ b/gui/recentShipBrowser.py
@@ -5,23 +5,23 @@
# noinspection PyPackageRequirements
import wx
+from logbook import Logger
# noinspection PyPackageRequirements
from wx.lib.buttons import GenBitmapButton
-from service.fit import Fit
-from service.market import Market
-import gui.mainFrame
import gui.globalEvents as GE
+import gui.mainFrame
import gui.sfBrowserItem as SFItem
+import gui.utils.animEffects as animEffects
+import gui.utils.animUtils as animUtils
import gui.utils.colorUtils as colorUtils
import gui.utils.drawUtils as drawUtils
-import gui.utils.animUtils as animUtils
-import gui.utils.animEffects as animEffects
from gui.PFListPane import PFListPane
-from gui.contextMenu import ContextMenu
from gui.bitmapLoader import BitmapLoader
-from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.contextMenu import ContextMenu
+from gui.utils.helpers_wxPython import Fonts, Frame
+from service.fit import Fit
+from service.market import Market
pyfalog = Logger(__name__)
@@ -104,7 +104,7 @@ def __init__(self, parent, wxid=wx.ID_ANY, label="", pos=wx.DefaultPosition, siz
# Make the bitmaps have the same color as window text
- sysTextColour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ sysTextColour = Frame.getForegroundColor()
img = self.bmpArrow.ConvertToImage()
if layout == wx.VERTICAL:
@@ -203,8 +203,7 @@ def OnBackgroundErase(self, event):
def OnPaint(self, event):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- # bkColor = colorUtils.GetSuitableColor(windowColor, 0.1)
+ windowColor = Frame.getBackgroundColor()
sepColor = colorUtils.GetSuitableColor(windowColor, 0.2)
mdc = wx.BufferedPaintDC(self)
@@ -375,8 +374,8 @@ def UpdateElementsPos(self, mdc):
def DrawItem(self, mdc):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
+ windowColor = Frame.getBackgroundColor()
+ textColor = Frame.getForegroundColor()
sepColor = colorUtils.GetSuitableColor(windowColor, 0.2)
mdc.SetTextForeground(textColor)
@@ -394,7 +393,7 @@ def DrawItem(self, mdc):
def RenderBackground(self):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ windowColor = Frame.getBackgroundColor()
sFactor = 0.1
@@ -559,7 +558,7 @@ def recentStage(self, event=None):
class PFStaticText(wx.Panel):
def __init__(self, parent, label=wx.EmptyString):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=parent.GetSize())
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, wx.ID_ANY, label, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE)
@@ -752,10 +751,7 @@ def UpdateElementsPos(self, mdc):
self.thoverw = wlabel
def DrawItem(self, mdc):
- # rect = self.GetRect()
-
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
+ textColor = Frame.getForegroundColor()
mdc.SetTextForeground(textColor)
@@ -1245,8 +1241,7 @@ def UpdateElementsPos(self, mdc):
def DrawItem(self, mdc):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
+ textColor = Frame.getForegroundColor()
mdc.SetTextForeground(textColor)
@@ -1270,7 +1265,9 @@ def DrawItem(self, mdc):
pfdate = drawUtils.GetPartialText(mdc, fitLocalDate,
self.toolbarx - self.textStartx - self.padding * 2 - self.thoverw)
- mdc.DrawText(pfdate, self.textStartx, self.timestampy)
+ if Fonts.getFont("font_standard") < 13:
+ # Too large of a font will cause issuses with size and fit, so don't display extra info
+ mdc.DrawText(pfdate, self.textStartx, self.timestampy)
mdc.SetFont(Fonts.getFont("font_minus_one"))
mdc.DrawText(self.toolbar.hoverLabel, self.thoverx, self.thovery)
@@ -1322,7 +1319,7 @@ def GetState(self):
def RenderBackground(self):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ windowColor = Frame.getBackgroundColor()
# activeFitID = self.mainFrame.getActiveFit()
state = self.GetState()
diff --git a/gui/resistsEditor.py b/gui/resistsEditor.py
index 31c8054d9d..1a7bdc6035 100644
--- a/gui/resistsEditor.py
+++ b/gui/resistsEditor.py
@@ -24,7 +24,7 @@
from gui.utils.clipboard import toClipboard, fromClipboard
from gui.builtinViews.entityEditor import EntityEditor, BaseValidator
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -87,6 +87,9 @@ class ResistsEditorDlg(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"Target Resists Editor", size=wx.Size(350, 240))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
+
self.block = False
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
@@ -223,7 +226,7 @@ def ValuesUpdated(self, event=None):
# if everything checks out, set resist attribute
setattr(p, "%sAmount" % type_, value / 100)
- editObj.SetForegroundColour(self.colorReset)
+ editObj.SetForegroundColour(Frame.getForegroundColor())
self.stNotice.SetLabel("")
self.totSizer.Layout()
@@ -234,12 +237,12 @@ def ValuesUpdated(self, event=None):
TargetResists.getInstance().saveChanges(p)
except ValueError:
- editObj.SetForegroundColour(wx.RED)
+ editObj.SetForegroundColour(Frame.getWarningColor())
msg = "Incorrect Formatting (decimals only)"
pyfalog.warning(msg)
self.stNotice.SetLabel(msg)
except AssertionError:
- editObj.SetForegroundColour(wx.RED)
+ editObj.SetForegroundColour(Frame.getWarningColor())
msg = "Incorrect Range (must be 0-100)"
pyfalog.warning(msg)
self.stNotice.SetLabel(msg)
diff --git a/gui/setEditor.py b/gui/setEditor.py
index f8b7de4872..5c380397e0 100644
--- a/gui/setEditor.py
+++ b/gui/setEditor.py
@@ -26,6 +26,7 @@
from gui.utils.clipboard import toClipboard, fromClipboard
from gui.builtinViews.entityEditor import EntityEditor, BaseValidator
from service.settings import GeneralSettings
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -84,8 +85,7 @@ def DoDelete(self, entity):
class ImplantSetEditor(BaseImplantEditorView):
def __init__(self, parent):
BaseImplantEditorView.__init__(self, parent)
- if 'wxMSW' in wx.PlatformInfo:
- self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
def bindContext(self):
self.Parent.entityEditor.Bind(wx.EVT_CHOICE, self.contextChanged)
@@ -124,6 +124,10 @@ def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"Implant Set Editor", size=wx.Size(640, 600))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
+ self.SetForegroundColour(Frame.getForegroundColor())
+ self.SetFont(Fonts.getFont("font_standard"))
+
self.block = False
self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)
diff --git a/gui/sfBrowserItem.py b/gui/sfBrowserItem.py
index 52f652ea3b..562bfc84ff 100644
--- a/gui/sfBrowserItem.py
+++ b/gui/sfBrowserItem.py
@@ -2,6 +2,7 @@
import wx
from wx._core import PyDeadObjectError
import gui.utils.drawUtils as drawUtils
+from gui.utils.helpers_wxPython import Frame
SB_ITEM_NORMAL = 0
SB_ITEM_SELECTED = 1
@@ -388,7 +389,7 @@ def GetState(self):
def RenderBackground(self):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ windowColor = Frame.getBackgroundColor()
state = self.GetState()
diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py
index 771b6c3c8a..1bb0e910b0 100644
--- a/gui/shipBrowser.py
+++ b/gui/shipBrowser.py
@@ -5,23 +5,23 @@
# noinspection PyPackageRequirements
import wx
+from logbook import Logger
# noinspection PyPackageRequirements
from wx.lib.buttons import GenBitmapButton
-from service.fit import Fit
-from service.market import Market
-import gui.mainFrame
import gui.globalEvents as GE
+import gui.mainFrame
import gui.sfBrowserItem as SFItem
+import gui.utils.animEffects as animEffects
+import gui.utils.animUtils as animUtils
import gui.utils.colorUtils as colorUtils
import gui.utils.drawUtils as drawUtils
-import gui.utils.animUtils as animUtils
-import gui.utils.animEffects as animEffects
from gui.PFListPane import PFListPane
-from gui.contextMenu import ContextMenu
from gui.bitmapLoader import BitmapLoader
-from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.contextMenu import ContextMenu
+from gui.utils.helpers_wxPython import Fonts, Frame
+from service.fit import Fit
+from service.market import Market
pyfalog = Logger(__name__)
@@ -119,7 +119,7 @@ def __init__(self, parent, id=wx.ID_ANY, label="", pos=wx.DefaultPosition, size=
# Make the bitmaps have the same color as window text
- sysTextColour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ sysTextColour = Frame.getForegroundColor()
img = self.bmpArrow.ConvertToImage()
if layout == wx.VERTICAL:
@@ -224,8 +224,7 @@ def OnBackgroundErase(self, event):
def OnPaint(self, event):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- # bkColor = colorUtils.GetSuitableColor(windowColor, 0.1)
+ windowColor = Frame.getBackgroundColor()
sepColor = colorUtils.GetSuitableColor(windowColor, 0.2)
mdc = wx.BufferedPaintDC(self)
@@ -491,8 +490,8 @@ def UpdateElementsPos(self, mdc):
def DrawItem(self, mdc):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
+ windowColor = Frame.getBackgroundColor()
+ textColor = Frame.getForegroundColor()
sepColor = colorUtils.GetSuitableColor(windowColor, 0.2)
mdc.SetTextForeground(textColor)
@@ -510,7 +509,7 @@ def DrawItem(self, mdc):
def RenderBackground(self):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ windowColor = Frame.getBackgroundColor()
sFactor = 0.1
@@ -971,7 +970,7 @@ class PFStaticText(wx.Panel):
def __init__(self, parent, label=wx.EmptyString):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=parent.GetSize())
- self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+ self.SetBackgroundColour(Frame.getBackgroundColor())
mainSizer = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, wx.ID_ANY, label, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE)
@@ -1073,11 +1072,9 @@ def UpdateElementsPos(self, mdc):
self.caty = (rect.height - htext) / 2
def DrawItem(self, mdc):
- # rect = self.GetRect()
self.UpdateElementsPos(mdc)
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
+ textColor = Frame.getForegroundColor()
mdc.SetTextForeground(textColor)
mdc.DrawBitmap(self.dropShadowBitmap, self.shipBmpx + 1, self.shipBmpy + 1)
@@ -1316,10 +1313,7 @@ def UpdateElementsPos(self, mdc):
def DrawItem(self, mdc):
# rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
-
- mdc.SetTextForeground(textColor)
+ mdc.SetTextForeground(Frame.getForegroundColor())
self.UpdateElementsPos(mdc)
@@ -1347,7 +1341,9 @@ def DrawItem(self, mdc):
fformat = "%d fits"
mdc.SetFont(Fonts.getFont("font_standard"))
- mdc.DrawText(fformat % fittings if fittings > 0 else fformat, self.textStartx, self.fittingsy)
+ if Fonts.getFont("font_standard") < 13:
+ # If the font is too big, we don't have room, so don't include this extra information
+ mdc.DrawText(fformat % fittings if fittings > 0 else fformat, self.textStartx, self.fittingsy)
mdc.SetFont(Fonts.getFont("font_minus_one"))
mdc.DrawText(self.toolbar.hoverLabel, self.thoverx, self.thovery)
@@ -1876,10 +1872,7 @@ def UpdateElementsPos(self, mdc):
def DrawItem(self, mdc):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- textColor = colorUtils.GetSuitableColor(windowColor, 1)
-
- mdc.SetTextForeground(textColor)
+ mdc.SetTextForeground(Frame.getForegroundColor())
self.UpdateElementsPos(mdc)
@@ -1898,18 +1891,18 @@ def DrawItem(self, mdc):
fitDate = self.timestamp.strftime("%m/%d/%Y %H:%M")
fitLocalDate = fitDate # "%d/%02d/%02d %02d:%02d" % (fitDate[0], fitDate[1], fitDate[2], fitDate[3], fitDate[4])
- pfdate = drawUtils.GetPartialText(mdc, fitLocalDate,
- self.toolbarx - self.textStartx - self.padding * 2 - self.thoverw)
+ pfdate = drawUtils.GetPartialText(mdc, fitLocalDate, self.toolbarx - self.textStartx - self.padding * 2 - self.thoverw)
- mdc.DrawText(pfdate, self.textStartx, self.timestampy)
+ if Fonts.getFont("font_standard") < 13:
+ # Too large of a font will cause issuses with size and fit, so don't display extra info
+ mdc.DrawText(pfdate, self.textStartx, self.timestampy)
mdc.SetFont(Fonts.getFont("font_minus_one"))
mdc.DrawText(self.toolbar.hoverLabel, self.thoverx, self.thovery)
mdc.SetFont(Fonts.getFont("font_plus_one"))
- psname = drawUtils.GetPartialText(mdc, self.fitName,
- self.toolbarx - self.textStartx - self.padding * 2 - self.thoverw)
+ psname = drawUtils.GetPartialText(mdc, self.fitName, self.toolbarx - self.textStartx - self.padding * 2 - self.thoverw)
mdc.DrawText(psname, self.textStartx, self.fitNamey)
@@ -1965,7 +1958,7 @@ def Refresh(self):
def RenderBackground(self):
rect = self.GetRect()
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
+ windowColor = Frame.getBackgroundColor()
# activeFitID = self.mainFrame.getActiveFit()
state = self.GetState()
diff --git a/gui/statsPane.py b/gui/statsPane.py
index 11afbc33d5..fb8329ed12 100644
--- a/gui/statsPane.py
+++ b/gui/statsPane.py
@@ -29,7 +29,7 @@
from gui.contextMenu import ContextMenu
from gui.pyfatogglepanel import TogglePanel
from logbook import Logger
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
pyfalog = Logger(__name__)
@@ -94,6 +94,7 @@ def __init__(self, parent):
tp = TogglePanel(self)
contentPanel = tp.GetContentPane()
contentPanel.viewName = viewName
+ contentPanel.SetForegroundColour(Frame.getForegroundColor())
try:
view = StatsView.getView(viewName)(self)
@@ -105,6 +106,7 @@ def __init__(self, parent):
self.views.append(view)
headerPanel = tp.GetHeaderPanel()
+ headerPanel.SetForegroundColour(Frame.getForegroundColor())
view.populatePanel(contentPanel, headerPanel)
tp.SetLabel(view.getHeaderText(None))
diff --git a/gui/updateDialog.py b/gui/updateDialog.py
index f32e29ffe3..496fc0f188 100644
--- a/gui/updateDialog.py
+++ b/gui/updateDialog.py
@@ -22,7 +22,7 @@
# noinspection PyPackageRequirements
import dateutil.parser
from service.settings import UpdateSettings as svc_UpdateSettings
-from gui.utils.fonts import Fonts
+from gui.utils.helpers_wxPython import Fonts, Frame
class UpdateDialog(wx.Dialog):
@@ -54,7 +54,7 @@ def __init__(self, parent, release):
if self.releaseInfo['prerelease']:
self.releaseText = wx.StaticText(self, wx.ID_ANY, "Pre-release:", wx.DefaultPosition, wx.DefaultSize,
wx.ALIGN_RIGHT)
- self.releaseText.SetForegroundColour(wx.Colour(230, 0, 0))
+ self.releaseText.SetForegroundColour(Frame.getWarningColor())
else:
self.releaseText = wx.StaticText(self, wx.ID_ANY, "Stable:", wx.DefaultPosition, wx.DefaultSize,
wx.ALIGN_RIGHT)
diff --git a/gui/utils/exportHtml.py b/gui/utils/ExportHtml.py
similarity index 97%
rename from gui/utils/exportHtml.py
rename to gui/utils/ExportHtml.py
index 41c299b525..8e39dc285f 100644
--- a/gui/utils/exportHtml.py
+++ b/gui/utils/ExportHtml.py
@@ -1,40 +1,42 @@
import threading
import time
+
# noinspection PyPackageRequirements
import wx
-from service.settings import HTMLExportSettings
-from service.fit import Fit
-from service.port import Port
-from service.market import Market
from logbook import Logger
+
from eos.db import getFit
+from service.fit import Fit
+from service.market import Market
+from service.port import Port
+from service.settings import HTMLExportSettings
pyfalog = Logger(__name__)
-class exportHtml(object):
+class ExportHtml(object):
_instance = None
@classmethod
def getInstance(cls):
if cls._instance is None:
- cls._instance = exportHtml()
+ cls._instance = ExportHtml()
return cls._instance
def __init__(self):
- self.thread = exportHtmlThread()
+ self.thread = ExportHtmlThread()
def refreshFittingHtml(self, force=False, callback=False):
settings = HTMLExportSettings.getInstance()
if force or settings.getEnabled():
self.thread.stop()
- self.thread = exportHtmlThread(callback)
+ self.thread = ExportHtmlThread(callback)
self.thread.start()
-class exportHtmlThread(threading.Thread):
+class ExportHtmlThread(threading.Thread):
def __init__(self, callback=False):
threading.Thread.__init__(self)
self.name = "HTMLExport"
@@ -202,7 +204,7 @@ def generateFullHTML(self, sMkt, sFit, dnaUrl):
fit[1] + '\n'
except:
pyfalog.warning("Failed to export line")
- pass
+ continue
finally:
if self.callback:
wx.CallAfter(self.callback, count)
diff --git a/gui/utils/animUtils.py b/gui/utils/animUtils.py
index 4003e77605..31b61611cb 100644
--- a/gui/utils/animUtils.py
+++ b/gui/utils/animUtils.py
@@ -1,11 +1,13 @@
# noinspection PyPackageRequirements
import wx
+
import gui.utils.colorUtils as colorUtils
+from gui.utils.helpers_wxPython import Frame
class LoadAnimation(wx.Window):
- def __init__(self, parent, id=wx.ID_ANY, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=0):
- wx.Window.__init__(self, parent, id, pos=pos, size=size, style=style)
+ def __init__(self, parent, init_id=wx.ID_ANY, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=0):
+ wx.Window.__init__(self, parent, init_id, pos=pos, size=size, style=style)
self.label = label
@@ -53,11 +55,10 @@ def OnEraseBackground(self, event):
def OnPaint(self, event):
rect = self.GetClientRect()
dc = wx.BufferedPaintDC(self)
- windowColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
- dc.SetBackground(wx.Brush(windowColor))
+ dc.SetBackground(wx.Brush(Frame.getBackgroundColor()))
dc.Clear()
- barColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ barColor = Frame.getForegroundColor()
shadeColor = colorUtils.GetSuitableColor(barColor, 0.75)
barWidth = rect.width / self.bars
@@ -81,14 +82,13 @@ def OnPaint(self, event):
dc.DrawRectangle(x, y, barWidth, bh)
x += barWidth
- textColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
- dc.SetTextForeground(textColor)
+ dc.SetTextForeground(Frame.getForegroundColor())
dc.DrawLabel(self.label, rect, wx.ALIGN_CENTER)
class WaitDialog(wx.Dialog):
def __init__(self, parent, title="Processing"):
- wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=title, size=(300, 30),
+ wx.Dialog.__init__(self, parent, init_id=wx.ID_ANY, title=title, size=(300, 30),
style=wx.NO_BORDER)
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
diff --git a/gui/utils/colorUtils.py b/gui/utils/colorUtils.py
index d2f10336bf..583f643f40 100644
--- a/gui/utils/colorUtils.py
+++ b/gui/utils/colorUtils.py
@@ -1,7 +1,8 @@
# noinspection PyPackageRequirements
-import wx
import math
+import wx
+
def BrightenColor(color, factor):
# Brightens a color (wx.Colour), factor = [0,1]
diff --git a/gui/utils/drawUtils.py b/gui/utils/drawUtils.py
index 1cd2abacd7..b1e95fbc04 100644
--- a/gui/utils/drawUtils.py
+++ b/gui/utils/drawUtils.py
@@ -1,5 +1,6 @@
# noinspection PyPackageRequirements
import wx
+
import gui.utils.colorUtils as colorUtils
diff --git a/gui/utils/floatspin.py b/gui/utils/floatspin.py
index b24e19bbaa..834006d15d 100644
--- a/gui/utils/floatspin.py
+++ b/gui/utils/floatspin.py
@@ -248,7 +248,7 @@ class FloatTextCtrl(wx.TextCtrl):
of :class:`FloatSpin`.
"""
- def __init__(self, parent, id=wx.ID_ANY, value="", pos=wx.DefaultPosition,
+ def __init__(self, parent, init_id=wx.ID_ANY, value="", pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.TE_NOHIDESEL | wx.TE_PROCESS_ENTER,
validator=wx.DefaultValidator,
name=wx.TextCtrlNameStr):
@@ -257,7 +257,7 @@ def __init__(self, parent, id=wx.ID_ANY, value="", pos=wx.DefaultPosition,
Used internally. Do not call directly this class in your code!
:param parent: the :class:`FloatTextCtrl` parent;
- :param id: an identifier for the control: a value of -1 is taken to mean a default;
+ :param init_id: an identifier for the control: a value of -1 is taken to mean a default;
:param value: default text value;
:param pos: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
@@ -269,7 +269,7 @@ def __init__(self, parent, id=wx.ID_ANY, value="", pos=wx.DefaultPosition,
"""
- wx.TextCtrl.__init__(self, parent, id, value, pos, size, style, validator, name)
+ wx.TextCtrl.__init__(self, parent, init_id, value, pos, size, style, validator, name)
self._parent = parent
self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
@@ -329,7 +329,7 @@ class FloatSpin(wx.PyControl):
from Tim Peters.
"""
- def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
+ def __init__(self, parent, init_id=wx.ID_ANY, pos=wx.DefaultPosition,
size=(95, -1), style=0, value=0.0, min_val=None, max_val=None,
increment=1.0, digits=-1, agwStyle=FS_LEFT,
name="FloatSpin"):
@@ -337,7 +337,7 @@ def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
Default class constructor.
:param parent: the :class:`FloatSpin` parent;
- :param id: an identifier for the control: a value of -1 is taken to mean a default;
+ :param init_id: an identifier for the control: a value of -1 is taken to mean a default;
:param pos: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
:param size: the control size. A value of (-1, -1) indicates a default size,
@@ -363,7 +363,7 @@ def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
"""
- wx.PyControl.__init__(self, parent, id, pos, size, style | wx.NO_BORDER |
+ wx.PyControl.__init__(self, parent, init_id, pos, size, style | wx.NO_BORDER |
wx.NO_FULL_REPAINT_ON_RESIZE | wx.CLIP_CHILDREN,
wx.DefaultValidator, name)
diff --git a/gui/utils/fonts.py b/gui/utils/fonts.py
deleted file mode 100644
index ab94511cf6..0000000000
--- a/gui/utils/fonts.py
+++ /dev/null
@@ -1,74 +0,0 @@
-"""
-Font file to handle the differences in font calculations between
-different wxPython versions
-"""
-
-# noinspection PyPackageRequirements
-import wx
-
-from service.settings import GeneralSettings
-
-if 'wxMac' in wx.PlatformInfo:
- sizes = (10, 11, 12)
-else:
- sizes = (7, 8, 9)
-
-SMALL, NORMAL, BIG = sizes
-
-
-class Fonts(object):
- @staticmethod
- def getFont(FontType):
- size, family, style, weight = getattr(Fonts, FontType, Fonts.font_standard)
- return wx.Font(size, family, style, weight)
-
- general_settings = GeneralSettings.getInstance()
-
- font_standard = (
- general_settings.get('fontSize'),
- getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
- )
-
- font_title_plus_one = (
- general_settings.get('fontSize') + 1,
- getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- wx.FONTWEIGHT_BOLD,
- )
-
- font_title_plus_two = (
- general_settings.get('fontSize') + 2,
- getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- wx.FONTWEIGHT_BOLD,
- )
-
- font_minus_one = (
- general_settings.get('fontSize') - 1,
- getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
- )
-
- font_plus_one = (
- general_settings.get('fontSize') + 1,
- getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
- )
-
- font_standard_bold = (
- general_settings.get('fontSize'),
- getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- wx.FONTWEIGHT_BOLD,
- )
-
- font_console = (
- general_settings.get('fontSize'),
- wx.FONTFAMILY_TELETYPE,
- getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
- getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
- )
diff --git a/gui/utils/helpers_wxPython.py b/gui/utils/helpers_wxPython.py
index 366c60c70f..50c5909d50 100644
--- a/gui/utils/helpers_wxPython.py
+++ b/gui/utils/helpers_wxPython.py
@@ -1,5 +1,9 @@
+# noinspection PyPackageRequirements
import wx
+import gui.utils.colorUtils as colorUtils
+from service.settings import GeneralSettings
+
def YesNoDialog(question=u'Are you sure you want to do this?', caption=u'Yes or no?'):
dlg = wx.MessageDialog(None, question, caption, wx.YES_NO | wx.ICON_QUESTION)
@@ -25,7 +29,6 @@ def __init__(self, parent, title, msg):
box = wx.BoxSizer(wx.VERTICAL)
box2 = wx.BoxSizer(wx.HORIZONTAL)
# Add an Info graphic
- bitmap = wx.EmptyBitmap(32, 32)
bitmap = wx.ArtProvider_GetBitmap(wx.ART_INFORMATION, wx.ART_MESSAGE_BOX, (32, 32))
graphic = wx.StaticBitmap(self, -1, bitmap)
box2.Add(graphic, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, 10)
@@ -43,3 +46,127 @@ def __init__(self, parent, title, msg):
self.Show()
# Make sure the screen gets fully drawn before continuing.
wx.Yield()
+
+
+class Fonts(object):
+ @staticmethod
+ def getFont(FontType):
+ size, family, style, weight = getattr(Fonts, FontType, Fonts.font_standard)
+ return wx.Font(size, family, style, weight)
+
+ general_settings = GeneralSettings.getInstance()
+
+ font_standard = (
+ general_settings.get('fontSize'),
+ getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
+ )
+
+ font_title_plus_one = (
+ general_settings.get('fontSize') + 1,
+ getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ wx.FONTWEIGHT_BOLD,
+ )
+
+ font_title_plus_two = (
+ general_settings.get('fontSize') + 2,
+ getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ wx.FONTWEIGHT_BOLD,
+ )
+
+ font_minus_one = (
+ general_settings.get('fontSize') - 1,
+ getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
+ )
+
+ font_plus_one = (
+ general_settings.get('fontSize') + 1,
+ getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
+ )
+
+ font_standard_bold = (
+ general_settings.get('fontSize'),
+ getattr(wx, 'FONTFAMILY_' + general_settings.get('fontType'), wx.FONTFAMILY_DEFAULT),
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ wx.FONTWEIGHT_BOLD,
+ )
+
+ font_console = (
+ general_settings.get('fontSize'),
+ wx.FONTFAMILY_TELETYPE,
+ getattr(wx, 'FONTSTYLE_' + general_settings.get('fontStyle'), wx.FONTSTYLE_NORMAL),
+ getattr(wx, 'FONTWEIGHT_' + general_settings.get('fontWeight'), wx.FONTWEIGHT_NORMAL),
+ )
+
+
+class Frame(object):
+ @staticmethod
+ def ColorParser(color, default):
+ # Check for valid color
+ if color not in [
+ 'BLACK', 'BLUE', 'CYAN', 'GREEN', 'YELLOW', 'LIGHT_GREY', 'RED', 'WHITE', 'SYS_COLOUR_SCROLLBAR', 'SYS_COLOUR_BACKGROUND', 'SYS_COLOUR_ACTIVECAPTION',
+ 'SYS_COLOUR_INACTIVECAPTION', 'SYS_COLOUR_MENU', 'SYS_COLOUR_WINDOW', 'SYS_COLOUR_WINDOWFRAME', 'SYS_COLOUR_MENUTEXT', 'SYS_COLOUR_WINDOWTEXT',
+ 'SYS_COLOUR_CAPTIONTEXT', 'SYS_COLOUR_ACTIVEBORDER', 'SYS_COLOUR_INACTIVEBORDER', 'SYS_COLOUR_APPWORKSPACE', 'SYS_COLOUR_HIGHLIGHT',
+ 'SYS_COLOUR_HIGHLIGHTTEXT', 'SYS_COLOUR_BTNFACE', 'SYS_COLOUR_BTNSHADOW', 'SYS_COLOUR_GRAYTEXT', 'SYS_COLOUR_BTNTEXT', 'SYS_COLOUR_INACTIVECAPTIONTEXT',
+ 'SYS_COLOUR_BTNHIGHLIGHT', 'SYS_COLOUR_3DDKSHADOW', 'SYS_COLOUR_3DLIGHT', 'SYS_COLOUR_INFOTEXT', 'SYS_COLOUR_INFOBK', 'SYS_COLOUR_LISTBOX',
+ 'SYS_COLOUR_HOTLIGHT', 'SYS_COLOUR_GRADIENTACTIVECAPTION', 'SYS_COLOUR_GRADIENTINACTIVECAPTION', 'SYS_COLOUR_MENUHILIGHT', 'SYS_COLOUR_MENUBAR',
+ 'SYS_COLOUR_LISTBOXTEXT', 'SYS_COLOUR_LISTBOXHIGHLIGHTTEXT', 'SYS_COLOUR_MAX', 'SYS_COLOUR_DESKTOP', 'SYS_COLOUR_3DFACE', 'SYS_COLOUR_3DSHADOW',
+ 'SYS_COLOUR_BTNHILIGHT', 'SYS_COLOUR_3DHIGHLIGHT', 'SYS_COLOUR_3DHILIGHT', 'SYS_COLOUR_FRAMEBK'
+ ]:
+ color = 'BLACK'
+
+ # Check for valid default colors
+ # We use a limited list to make it simpler to handle compatibility
+ if default not in ['BLACK', 'BLUE', 'CYAN', 'GREEN', 'YELLOW', 'LIGHT_GREY', 'RED', 'WHITE']:
+ default = 'BLACK'
+
+ if "SYS_COLOUR_" in color:
+ color = wx.SystemSettings.GetColour(getattr(wx, color, getattr(wx, default)))
+ else:
+ color = getattr(wx, color, getattr(wx, default))
+
+ return color
+
+ @staticmethod
+ def getBackgroundColor():
+ general_settings = GeneralSettings.getInstance()
+ color = Frame.ColorParser(general_settings.get('colorBackground'), 'LIGHT_GREY')
+
+ return color
+
+ @staticmethod
+ def getBackgroundColorOffset():
+ general_settings = GeneralSettings.getInstance()
+ color = Frame.ColorParser(general_settings.get('colorBackground'), 'LIGHT_GREY')
+
+ color = colorUtils.GetSuitableColor(color, 0.1)
+
+ return color
+
+ @staticmethod
+ def getForegroundColor():
+ general_settings = GeneralSettings.getInstance()
+ color = Frame.ColorParser(general_settings.get('colorForeground'), 'BLACK')
+
+ return color
+
+ @staticmethod
+ def getWarningColor():
+ general_settings = GeneralSettings.getInstance()
+ color = Frame.ColorParser(general_settings.get('colorWarning'), 'RED')
+
+ return color
+
+
+class DragDropHelper(object):
+ data = None
+
+ def __init__(self):
+ pass
diff --git a/gui/utils/staticHelpers.py b/gui/utils/staticHelpers.py
deleted file mode 100644
index 538936e3a9..0000000000
--- a/gui/utils/staticHelpers.py
+++ /dev/null
@@ -1,5 +0,0 @@
-class DragDropHelper:
- data = None
-
- def __init__(self):
- pass
diff --git a/pyfa.py b/pyfa.py
index 6eaa08bb5b..224bba07d6 100755
--- a/pyfa.py
+++ b/pyfa.py
@@ -124,8 +124,8 @@ def handleGUIException(exc_type, exc_value, exc_traceback):
if wx and ErrorFrame:
pyfa_gui = wx.App(False)
- if exc_type == PreCheckException:
- ErrorFrame(exc_value, tb, "Missing prerequisites")
+ if exc_type == PreCheckException or isinstance(exc_value, ImportError):
+ ErrorFrame(exc_value, tb, "Missing prerequisites\nPlease import all modules from requirements.txt")
else:
ErrorFrame(exc_value, tb)
@@ -146,7 +146,7 @@ def handleGUIException(exc_type, exc_value, exc_traceback):
if wx and ErrorFrame:
pyfa_gui = wx.App(False)
- if exc_type == PreCheckException:
+ if exc_type == PreCheckException or isinstance(exc_value, ImportError):
ErrorFrame(exc_value, tb, "Missing prerequisites")
else:
ErrorFrame(exc_value, tb)
@@ -384,6 +384,7 @@ def handleGUIException(exc_type, exc_value, exc_traceback):
import requests
config.requestsVersion = requests.__version__
except ImportError:
+ requests = None
raise PreCheckException("Cannot import requests. You can download requests from https://pypi.python.org/pypi/requests.")
import eos.db
diff --git a/service/market.py b/service/market.py
index c48433073a..e98888e7bf 100644
--- a/service/market.py
+++ b/service/market.py
@@ -533,7 +533,7 @@ def getMetaGroupIdByItem(self, item, fallback=0):
def getMarketGroupByItem(self, item, parentcheck=True):
"""Get market group by item, its ID or name"""
# Check if we force market group for given item
- pyfalog.debug("Getting market group for item: {0}", repr(item))
+ pyfalog.debug(u"Getting market group for {0} ({1})", item.name, item.ID)
if item.name in self.ITEMS_FORCEDMARKETGROUP:
mgid = self.ITEMS_FORCEDMARKETGROUP[item.name]
return self.getMarketGroup(mgid)
diff --git a/service/settings.py b/service/settings.py
index f0ab838e68..99a7cea5ed 100644
--- a/service/settings.py
+++ b/service/settings.py
@@ -21,9 +21,10 @@
import os.path
import urllib2
+from logbook import Logger
+
import config
import eos.config as eos_config
-from logbook import Logger
pyfalog = Logger(__name__)
@@ -367,18 +368,23 @@ def getInstance(cls):
def __init__(self):
# standardFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
GeneralDefaultSettings = {
- "itemSearchLimit": 150,
- "marketSearchDelay": 250,
- "fontSize": 9,
- "fontType": 'DEFAULT',
- "fontStyle": 'NORMAL',
- "fontWeight": 'NORMAL',
+ "itemSearchLimit" : 150,
+ "marketSearchDelay" : 250,
+ "fontSize" : 9,
+ "fontType" : 'DEFAULT',
+ "fontStyle" : 'NORMAL',
+ "fontWeight" : 'NORMAL',
+ "colorBackground" : "SYS_COLOUR_FRAMEBK",
+ "colorForeground" : "SYS_COLOUR_WINDOWTEXT",
+ "colorWarning" : "RED",
"showAllMarketGroups": False,
}
self.serviceGeneralDefaultSettings = SettingsProvider.getInstance().getSettings("pyfaGeneralSettings", GeneralDefaultSettings)
# We're changing the way we're handling font sizes, so switch to the new method
+ # Shouldn't ever need to do this, but there was a brief window where we tried
+ # to use the old named sizes instead of numbers.
if not isinstance(self.serviceGeneralDefaultSettings['fontSize'], int):
self.serviceGeneralDefaultSettings['fontSize'] = 9
@@ -406,8 +412,8 @@ def __init__(self):
# 2 - Full View
DatabaseDefaultSettings = {
"ImportItemsNotInMarketGroups": False,
- "ImportItemsNotPublished": False,
- "UpdateThreads": 25,
+ "ImportItemsNotPublished" : False,
+ "UpdateThreads" : 25,
}
self.serviceDatabaseDefaultSettings = SettingsProvider.getInstance().getSettings("pyfaDatabaseSettings", DatabaseDefaultSettings)