from __future__ import absolute_import
+import platform
import wx, wx.lib.stattext, types
from Cura.util import validators
leftConfigPanel.main = self
rightConfigPanel.main = self
+ configPanel.leftPanel = leftConfigPanel
+ configPanel.rightPanel = rightConfigPanel
+
nb.AddPage(configPanel, name)
return leftConfigPanel, rightConfigPanel, configPanel
setting.SetValue(profile.getPreference(setting.configName))
self.Update()
- def XXXgetLabelColumnWidth(self):
- maxWidth = 0
- for setting in self.settingControlList:
- maxWidth = max(maxWidth, setting.label.GetWidth())
-
- def XXXsetLabelColumnWidth(self, newWidth):
- for setting in self.settingControlList:
- setting.label.SetWidth(newWidth)
-
def getLabelColumnWidth(self, panel):
maxWidth = 0
for child in panel.GetChildren():
if isinstance(child, wx.lib.stattext.GenStaticText):
size = child.GetSize()
size[0] = width
- #child.SetSize(size)
child.SetBestSize(size)
- #child.GetContainingSizer().Layout()
- #child.SetBackgroundColour('Green')
class TitleRow():
def __init__(self, panel, name):
# Set the minimum size of control to something other than the humungous default
minSize = self.ctrl.GetMinSize()
- minSize[0] = 50
+
+ if platform.system() == "Darwin":
+ # Under MacOS, it appears that the minSize is used for the actual size...
+ minSize[0] = 150
+ else:
+ minSize[0] = 50
self.ctrl.SetMinSize(minSize)
sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT,border=10)
# switch to horizontal
#
- col1 = configPanel.Children[0]
+ col1 = configPanel.leftPanel
colSize1 = col1.GetSize()
colBestSize1 = col1.GetBestSize()
- col2 = configPanel.Children[1]
+ col2 = configPanel.rightPanel
colSize2 = col2.GetSize()
colBestSize2 = col2.GetBestSize()
if (colSize1[0] <= colBestSize1[0]) or (colSize2[0] <= colBestSize2[0]):
configPanel.Freeze()
sizer = wx.BoxSizer(wx.VERTICAL)
- sizer.Add(configPanel.Children[0], flag=wx.EXPAND)
- sizer.Add(configPanel.Children[1], flag=wx.EXPAND)
+ sizer.Add(configPanel.leftPanel, flag=wx.EXPAND)
+ sizer.Add(configPanel.rightPanel, flag=wx.EXPAND)
configPanel.SetSizer(sizer)
#sizer.Layout()
configPanel.Layout()
if colSize1[0] > (colBestSize1[0] + colBestSize2[0]):
configPanel.Freeze()
sizer = wx.BoxSizer(wx.HORIZONTAL)
- sizer.Add(configPanel.Children[0], proportion=1, border=35, flag=wx.EXPAND)
- sizer.Add(configPanel.Children[1], proportion=1, flag=wx.EXPAND)
+ sizer.Add(configPanel.leftPanel, proportion=1, border=35, flag=wx.EXPAND)
+ sizer.Add(configPanel.rightPanel, proportion=1, flag=wx.EXPAND)
configPanel.SetSizer(sizer)
#sizer.Layout()
configPanel.Layout()