Added diverged symbols view

This commit is contained in:
Jamie Cash
2021-06-01 14:20:57 +01:00
parent f6d05873d2
commit b947b928e7
4 changed files with 216 additions and 2 deletions
+16
View File
@@ -76,6 +76,8 @@ class CorrelationMDIFrame(wx.MDIParentFrame):
menu_view = wx.Menu()
self.Bind(wx.EVT_MENU, self.__on_view_status, menu_view.Append(wx.ID_ANY, "Status",
"View status of correlations."))
self.Bind(wx.EVT_MENU, self.__on_view_diverged, menu_view.Append(wx.ID_ANY, "Diverged Symbols",
"View diverged symbols."))
self.menubar.Append(menu_view, "&View")
# Set menu bar
@@ -260,6 +262,20 @@ class CorrelationMDIFrame(wx.MDIParentFrame):
else:
opened_instance.Raise()
def __on_view_diverged(self, evt):
from mt5_correlation.gui.mdi_child_diverged_symbols import MDIChildDivergedSymbols
# Only open if not already open. If already open then raise to top.
opened_instance = None
for child in self.GetChildren():
if isinstance(child, MDIChildDivergedSymbols):
opened_instance = child
if opened_instance is None:
MDIChildDivergedSymbols(parent=self).Show(True)
else:
opened_instance.Raise()
def __refresh(self):
"""
Refresh all open child frames