chiark / gitweb /
Move the rotate button to the preview window. And... model tab be-gone!
authordaid <daid303@gmail.com>
Thu, 22 Mar 2012 11:33:39 +0000 (12:33 +0100)
committerdaid <daid303@gmail.com>
Thu, 22 Mar 2012 11:33:39 +0000 (12:33 +0100)
SkeinPyPy/newui/mainWindow.py
SkeinPyPy/newui/preview3d.py

index d7fef3c76f13c092cce90220e8e3969717856f84..69e2f427f785762faa39e3b7f8e18efaec2af4c2 100644 (file)
@@ -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)
index 798eddbf572db3a48adbc0a79b47d1f1fbaf9826..a888ba7c932e9f0ff536d49ec9a6bb37df60aef0 100644 (file)
@@ -27,7 +27,7 @@ class previewPanel(wx.Panel):
                wx.Panel.__init__(self, parent,-1)\r
                \r
                self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DDKSHADOW))\r
-               self.SetMinSize((400,300))\r
+               self.SetMinSize((440,320))\r
 \r
                self.glCanvas = PreviewGLCanvas(self)\r
                self.init = 0\r
@@ -59,7 +59,7 @@ class previewPanel(wx.Panel):
 \r
                self.toolbar2 = wx.ToolBar( self, -1 )\r
                self.toolbar2.SetToolBitmapSize( ( 21, 21 ) )\r
-               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Flip:'))\r
+               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Flip'))\r
 \r
                self.flipX = wx.CheckBox(self.toolbar2, -1, "X")\r
                self.flipX.SetValue(profile.getProfileSetting('flip_x') == 'True')\r
@@ -79,9 +79,9 @@ class previewPanel(wx.Panel):
                self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))\r
                self.toolbar2.AddControl(self.scale)\r
                self.Bind(wx.EVT_TEXT, self.OnScale, self.scale)\r
-               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
 \r
-               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy:'))\r
+               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
+               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy'))\r
                self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))\r
                self.toolbar2.AddControl(self.mulXsub)\r
                self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub)\r
@@ -96,6 +96,13 @@ class previewPanel(wx.Panel):
                self.toolbar2.AddControl(self.mulYadd)\r
                self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd)\r
                \r
+               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
+               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))\r
+               self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS)\r
+               self.rotate.SetRange(0, 360)\r
+               self.toolbar2.AddControl(self.rotate)\r
+               self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate)\r
+               \r
                self.toolbar2.Realize()\r
                self.updateToolbar()\r
                \r
@@ -140,6 +147,10 @@ class previewPanel(wx.Panel):
                        scale = 1.0\r
                profile.putProfileSetting('model_scale', str(scale))\r
                self.updateModelTransform()\r
+       \r
+       def OnRotate(self, e):\r
+               profile.putProfileSetting('model_rotate_base', self.rotate.GetValue())\r
+               self.updateModelTransform()\r
 \r
        def On3DClick(self, e):\r
                self.glCanvas.yaw = 30\r