From: daid Date: Wed, 21 Mar 2012 15:53:05 +0000 (+0100) Subject: Added scale to preview window instead of model tab X-Git-Tag: RC1~36 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=b398e2a2cd00394c0db80d32e986d2eee82fd0c0;p=cura.git Added scale to preview window instead of model tab --- diff --git a/SkeinPyPy/newui/mainWindow.py b/SkeinPyPy/newui/mainWindow.py index d8688c4a..b6200ed3 100644 --- a/SkeinPyPy/newui/mainWindow.py +++ b/SkeinPyPy/newui/mainWindow.py @@ -159,10 +159,6 @@ class mainWindow(configBase.configWindowBase): nb.AddPage(alterationPanel.alterationPanel(nb), "Start/End-GCode") (left, right) = self.CreateConfigTab(nb, '3D Model') - configBase.TitleRow(left, "Scale") - c = configBase.SettingRow(left, "Scale", 'model_scale', '1.0', '') - validators.validFloat(c, 0.01) - configBase.settingNotify(c, self.preview3d.updateModelTransform) configBase.TitleRow(right, "Rotate") c = configBase.SettingRow(right, "Rotate (deg)", 'model_rotate_base', '0', '') validators.validFloat(c) diff --git a/SkeinPyPy/newui/preview3d.py b/SkeinPyPy/newui/preview3d.py index 4941a8f6..fc36fd66 100644 --- a/SkeinPyPy/newui/preview3d.py +++ b/SkeinPyPy/newui/preview3d.py @@ -74,6 +74,13 @@ class previewPanel(wx.Panel): self.toolbar2.AddControl(self.flipZ) self.Bind(wx.EVT_CHECKBOX, self.OnFlipZClick, self.flipZ) + self.toolbar2.InsertSeparator(4) + self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale')) + self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21)) + self.toolbar2.AddControl(self.scale) + self.Bind(wx.EVT_TEXT, self.OnScale, self.scale) + + self.toolbar2.Realize() self.updateToolbar() sizer = wx.BoxSizer(wx.VERTICAL) @@ -94,6 +101,14 @@ class previewPanel(wx.Panel): profile.putProfileSetting('flip_z', str(self.flipZ.GetValue())) self.updateModelTransform() + def OnScale(self, e): + try: + scale = float(self.scale.GetValue()) + except: + scale = 1.0 + profile.putProfileSetting('model_scale', str(scale)) + self.updateModelTransform() + def On3DClick(self, e): self.glCanvas.yaw = 30 self.glCanvas.pitch = 60