Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI/nviz: make tools panel verically and horizontally scrollable for Single Window Mode #3089

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions gui/wxpython/nviz/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,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 @@ -206,6 +202,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 @@ -243,7 +243,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 @@ -478,7 +478,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 @@ -662,7 +662,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 @@ -820,7 +819,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 @@ -1135,12 +1134,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 @@ -1379,12 +1379,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 @@ -1471,12 +1472,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 @@ -1903,6 +1905,7 @@ def _createVectorPage(self, parent):

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

return panel

Expand All @@ -1915,7 +1918,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 @@ -2117,12 +2120,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 @@ -2298,12 +2302,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 @@ -2394,12 +2399,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 @@ -2528,6 +2534,7 @@ def _createDecorationPage(self, parent):
panel.SetSizer(pageSizer)
panel.Layout()
panel.Fit()
panel.SetupScrolling(scroll_y=False)

return panel

Expand Down