From 53c39d5b4f6631b6a1ad19e01fe1eef8af72e48b Mon Sep 17 00:00:00 2001 From: daid Date: Thu, 22 Mar 2012 12:33:39 +0100 Subject: [PATCH] Move the rotate button to the preview window. And... model tab be-gone! --- SkeinPyPy/newui/mainWindow.py | 7 +------ SkeinPyPy/newui/preview3d.py | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/SkeinPyPy/newui/mainWindow.py b/SkeinPyPy/newui/mainWindow.py index d7fef3c7..69e2f427 100644 --- a/SkeinPyPy/newui/mainWindow.py +++ b/SkeinPyPy/newui/mainWindow.py @@ -158,12 +158,6 @@ class mainWindow(configBase.configWindowBase): nb.AddPage(alterationPanel.alterationPanel(nb), "Start/End-GCode") - (left, right) = self.CreateConfigTab(nb, '3D Model') - configBase.TitleRow(right, "Rotate") - c = configBase.SettingRow(right, "Rotate (deg)", 'model_rotate_base', '0', '') - validators.validFloat(c) - configBase.settingNotify(c, self.preview3d.updateModelTransform) - # load and slice buttons. loadButton = wx.Button(self, -1, 'Load Model') sliceButton = wx.Button(self, -1, 'Slice to GCode') @@ -193,6 +187,7 @@ class mainWindow(configBase.configWindowBase): self.SetMinSize(self.GetSize()) self.Centre() self.Show(True) + print self.GetSize() def OnLoadProfile(self, e): dlg=wx.FileDialog(self, "Select profile file to load", self.lastPath, style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) diff --git a/SkeinPyPy/newui/preview3d.py b/SkeinPyPy/newui/preview3d.py index 798eddbf..a888ba7c 100644 --- a/SkeinPyPy/newui/preview3d.py +++ b/SkeinPyPy/newui/preview3d.py @@ -27,7 +27,7 @@ class previewPanel(wx.Panel): wx.Panel.__init__(self, parent,-1) self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DDKSHADOW)) - self.SetMinSize((400,300)) + self.SetMinSize((440,320)) self.glCanvas = PreviewGLCanvas(self) self.init = 0 @@ -59,7 +59,7 @@ class previewPanel(wx.Panel): self.toolbar2 = wx.ToolBar( self, -1 ) self.toolbar2.SetToolBitmapSize( ( 21, 21 ) ) - self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Flip:')) + self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Flip')) self.flipX = wx.CheckBox(self.toolbar2, -1, "X") self.flipX.SetValue(profile.getProfileSetting('flip_x') == 'True') @@ -79,9 +79,9 @@ class previewPanel(wx.Panel): 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.InsertSeparator(self.toolbar2.GetToolsCount()) - self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy:')) + self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount()) + self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy')) self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21)) self.toolbar2.AddControl(self.mulXsub) self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub) @@ -96,6 +96,13 @@ class previewPanel(wx.Panel): self.toolbar2.AddControl(self.mulYadd) self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd) + self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount()) + self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot')) + self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS) + self.rotate.SetRange(0, 360) + self.toolbar2.AddControl(self.rotate) + self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate) + self.toolbar2.Realize() self.updateToolbar() @@ -140,6 +147,10 @@ class previewPanel(wx.Panel): scale = 1.0 profile.putProfileSetting('model_scale', str(scale)) self.updateModelTransform() + + def OnRotate(self, e): + profile.putProfileSetting('model_rotate_base', self.rotate.GetValue()) + self.updateModelTransform() def On3DClick(self, e): self.glCanvas.yaw = 30 -- 2.30.2