diff --git a/gui/wxpython/nviz/tools.py b/gui/wxpython/nviz/tools.py index 01e4bce1f96..09a93de8539 100644 --- a/gui/wxpython/nviz/tools.py +++ b/gui/wxpython/nviz/tools.py @@ -143,10 +143,6 @@ def __init__( self.Update() wx.CallAfter(self.SetPage, "view") - wx.CallAfter( - self.UpdateScrolling, - (self.foldpanelData, self.foldpanelAppear, self.foldpanelAnalysis), - ) wx.CallAfter(self.SetInitialMaps) def SetInitialMaps(self): @@ -205,6 +201,10 @@ def LoadSettings(self): def OnPageChanged(self, event): new = event.GetSelection() # self.ChangeSelection(new) + # Data, Appearance, Analysis page + if new in (1, 2, 3): + foldpanel = self.GetPage(new).GetChildren()[0] + wx.CallLater(100, self.UpdateScrolling, (foldpanel,)) def PostViewEvent(self, zExag=False): """Change view settings""" @@ -242,7 +242,7 @@ def UpdateScrolling(self, foldpanels): def _createViewPage(self): """Create view settings page""" panel = SP.ScrolledPanel(parent=self, id=wx.ID_ANY) - panel.SetupScrolling(scroll_x=False) + panel.SetupScrolling() self.page["view"] = {"id": 0, "notebook": self.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) @@ -477,7 +477,7 @@ def _createViewPage(self): def _createAnimationPage(self): """Create view settings page""" panel = SP.ScrolledPanel(parent=self, id=wx.ID_ANY) - panel.SetupScrolling(scroll_x=False) + panel.SetupScrolling() self.page["animation"] = {"id": 0, "notebook": self.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) @@ -661,7 +661,6 @@ def _createAnimationPage(self): def _createDataPage(self): """Create data (surface, vector, volume) settings page""" - self.mainPanelData = ScrolledPanel(parent=self) self.mainPanelData.SetupScrolling(scroll_x=False) try: # wxpython <= 2.8.10 @@ -819,7 +818,7 @@ def _createAnalysisPage(self): def _createSurfacePage(self, parent): """Create view settings page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["surface"] = {"id": 0, "notebook": self.foldpanelData.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) @@ -1134,12 +1133,13 @@ def _createSurfacePage(self, parent): panel.Layout() panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel def _createCPlanePage(self, parent): """Create cutting planes page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["cplane"] = {"id": 4, "notebook": self.foldpanelData.GetId()} self.win["cplane"] = {} @@ -1378,12 +1378,13 @@ def _createCPlanePage(self, parent): panel.SetSizer(pageSizer) panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel def _createConstantPage(self, parent): """Create constant page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["constant"] = {"id": 1, "notebook": self.foldpanelData.GetId()} self.win["constant"] = {} @@ -1470,12 +1471,13 @@ def _createConstantPage(self, parent): panel.SetSizer(pageSizer) panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel def _createVectorPage(self, parent): """Create view settings page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["vector"] = {"id": 2, "notebook": self.foldpanelData.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) @@ -1902,6 +1904,7 @@ def _createVectorPage(self, parent): panel.SetSizer(pageSizer) panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel @@ -1914,7 +1917,7 @@ def GselectOnPopup(self, ltype, exclude=False): def _createVolumePage(self, parent): """Create view settings page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["volume"] = {"id": 3, "notebook": self.foldpanelData.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) @@ -2116,12 +2119,13 @@ def _createVolumePage(self, parent): ) panel.SetSizer(pageSizer) panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel def _createLightPage(self, parent): """Create light page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["light"] = {"id": 0, "notebook": self.foldpanelAppear.GetId()} self.win["light"] = {} @@ -2297,12 +2301,13 @@ def _createLightPage(self, parent): panel.SetSizer(pageSizer) panel.Layout() panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel def _createFringePage(self, parent): """Create fringe page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["fringe"] = {"id": 1, "notebook": self.foldpanelAppear.GetId()} self.win["fringe"] = {} @@ -2393,12 +2398,13 @@ def _createFringePage(self, parent): panel.SetSizer(pageSizer) panel.Layout() panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel def _createDecorationPage(self, parent): """Create decoration (north arrow, scalebar, legend) page""" - panel = wx.Panel(parent=parent, id=wx.ID_ANY) + panel = ScrolledPanel(parent=parent) self.page["decoration"] = {"id": 2, "notebook": self.foldpanelAppear.GetId()} self.win["decoration"] = {} @@ -2527,6 +2533,7 @@ def _createDecorationPage(self, parent): panel.SetSizer(pageSizer) panel.Layout() panel.Fit() + panel.SetupScrolling(scroll_y=False) return panel