Refresh graph when graph options change
This commit is contained in:
@@ -3,6 +3,7 @@ from collections import OrderedDict
|
|||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
import wx
|
import wx
|
||||||
|
|
||||||
|
import gui.globalEvents as GE
|
||||||
import gui.mainFrame
|
import gui.mainFrame
|
||||||
from gui.contextMenu import ContextMenuUnconditional
|
from gui.contextMenu import ContextMenuUnconditional
|
||||||
from service.settings import GraphSettings
|
from service.settings import GraphSettings
|
||||||
@@ -22,7 +23,10 @@ class TargetResists(ContextMenuUnconditional):
|
|||||||
|
|
||||||
def handleModeSwitch(self, event):
|
def handleModeSwitch(self, event):
|
||||||
optionName = self.idOptionMap[event.Id]
|
optionName = self.idOptionMap[event.Id]
|
||||||
|
if optionName == self.settings.get('mobileDroneMode'):
|
||||||
|
return
|
||||||
self.settings.set('mobileDroneMode', optionName)
|
self.settings.set('mobileDroneMode', optionName)
|
||||||
|
wx.PostEvent(self.mainFrame, GE.GraphOptionChanged())
|
||||||
|
|
||||||
def getSubMenu(self, context, rootMenu, i, pitem):
|
def getSubMenu(self, context, rootMenu, i, pitem):
|
||||||
m = wx.Menu()
|
m = wx.Menu()
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
# noinspection PyPackageRequirements
|
||||||
|
import wx
|
||||||
|
|
||||||
|
import gui.globalEvents as GE
|
||||||
import gui.mainFrame
|
import gui.mainFrame
|
||||||
from gui.contextMenu import ContextMenuUnconditional
|
from gui.contextMenu import ContextMenuUnconditional
|
||||||
from service.settings import GraphSettings
|
from service.settings import GraphSettings
|
||||||
@@ -17,6 +21,7 @@ class GraphDmgIgnoreResists(ContextMenuUnconditional):
|
|||||||
|
|
||||||
def activate(self, fullContext, i):
|
def activate(self, fullContext, i):
|
||||||
self.settings.set('ignoreResists', not self.settings.get('ignoreResists'))
|
self.settings.set('ignoreResists', not self.settings.get('ignoreResists'))
|
||||||
|
wx.PostEvent(self.mainFrame, GE.GraphOptionChanged())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def checked(self):
|
def checked(self):
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ FitChanged, FIT_CHANGED = wx.lib.newevent.NewEvent()
|
|||||||
FitRemoved, FIT_REMOVED = wx.lib.newevent.NewEvent()
|
FitRemoved, FIT_REMOVED = wx.lib.newevent.NewEvent()
|
||||||
CharListUpdated, CHAR_LIST_UPDATED = wx.lib.newevent.NewEvent()
|
CharListUpdated, CHAR_LIST_UPDATED = wx.lib.newevent.NewEvent()
|
||||||
CharChanged, CHAR_CHANGED = wx.lib.newevent.NewEvent()
|
CharChanged, CHAR_CHANGED = wx.lib.newevent.NewEvent()
|
||||||
|
GraphOptionChanged, GRAPH_OPTION_CHANGED = wx.lib.newevent.NewEvent()
|
||||||
|
|
||||||
SsoLoggingIn, EVT_SSO_LOGGING_IN = wx.lib.newevent.NewEvent()
|
SsoLoggingIn, EVT_SSO_LOGGING_IN = wx.lib.newevent.NewEvent()
|
||||||
SsoLogin, EVT_SSO_LOGIN = wx.lib.newevent.NewEvent()
|
SsoLogin, EVT_SSO_LOGIN = wx.lib.newevent.NewEvent()
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class GraphFrame(wx.Frame):
|
|||||||
self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent)
|
self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent)
|
||||||
# Event bindings - external events
|
# Event bindings - external events
|
||||||
self.mainFrame.Bind(GE.FIT_CHANGED, self.OnFitChanged)
|
self.mainFrame.Bind(GE.FIT_CHANGED, self.OnFitChanged)
|
||||||
|
self.mainFrame.Bind(GE.GRAPH_OPTION_CHANGED, self.OnGraphOptionChanged)
|
||||||
|
|
||||||
self.Layout()
|
self.Layout()
|
||||||
self.UpdateWindowSize()
|
self.UpdateWindowSize()
|
||||||
@@ -154,6 +155,11 @@ class GraphFrame(wx.Frame):
|
|||||||
self.getView().clearCache(fitID=event.fitID)
|
self.getView().clearCache(fitID=event.fitID)
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
|
def OnGraphOptionChanged(self, event):
|
||||||
|
event.Skip()
|
||||||
|
self.getView().clearCache()
|
||||||
|
self.draw()
|
||||||
|
|
||||||
def OnGraphSwitched(self, event):
|
def OnGraphSwitched(self, event):
|
||||||
view = self.getView()
|
view = self.getView()
|
||||||
GraphSettings.getInstance().set('selectedGraph', view.internalName)
|
GraphSettings.getInstance().set('selectedGraph', view.internalName)
|
||||||
@@ -164,6 +170,7 @@ class GraphFrame(wx.Frame):
|
|||||||
|
|
||||||
def closeWindow(self):
|
def closeWindow(self):
|
||||||
self.mainFrame.Unbind(GE.FIT_CHANGED, handler=self.OnFitChanged)
|
self.mainFrame.Unbind(GE.FIT_CHANGED, handler=self.OnFitChanged)
|
||||||
|
self.mainFrame.Unbind(GE.GRAPH_OPTION_CHANGED, handler=self.OnGraphOptionChanged)
|
||||||
self.ctrlPanel.unbindExternalEvents()
|
self.ctrlPanel.unbindExternalEvents()
|
||||||
self.Destroy()
|
self.Destroy()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user