Skip to content

Commit

Permalink
wxGUI/nviz: make tools panel verically and horizontally scrollable (O…
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi authored and landam committed Oct 25, 2023
1 parent 52d2a63 commit e201af2
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions gui/wxpython/nviz/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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"] = {}

Expand Down Expand Up @@ -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"] = {}

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -1902,6 +1904,7 @@ def _createVectorPage(self, parent):

panel.SetSizer(pageSizer)
panel.Fit()
panel.SetupScrolling(scroll_y=False)

return panel

Expand All @@ -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)

Expand Down Expand Up @@ -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"] = {}
Expand Down Expand Up @@ -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"] = {}
Expand Down Expand Up @@ -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"] = {}
Expand Down Expand Up @@ -2527,6 +2533,7 @@ def _createDecorationPage(self, parent):
panel.SetSizer(pageSizer)
panel.Layout()
panel.Fit()
panel.SetupScrolling(scroll_y=False)

return panel

Expand Down

0 comments on commit e201af2

Please sign in to comment.