Merge branch 'master' of github.com:daid/Cura

This commit is contained in:
daid 2012-04-18 10:53:59 +02:00
commit 00ba00cefa
4 changed files with 22 additions and 5 deletions

7
.gitignore vendored
View File

@ -12,3 +12,10 @@ Printrun
Cura/current_profile.ini
Cura/preferences.ini
cura.sh
pypy
python
drivers
printrun.bat
cura.bat
object-mirror.png
object.png

View File

@ -181,7 +181,9 @@ class previewPanel(wx.Panel):
self.toolbar2.AddSeparator()
# Scale
self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))
self.scaleReset = NormalButton(self.toolbar2, self, 'object-scale.png', 'Reset model scale')
self.scaleReset.Bind(wx.EVT_BUTTON, self.OnScaleReset)
self.toolbar2.AddControl(self.scaleReset)
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)
@ -208,11 +210,13 @@ class previewPanel(wx.Panel):
self.toolbar2.AddSeparator()
# Rotate
self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))
self.rotateReset = NormalButton(self.toolbar2, self, 'object-rotate.png', 'Reset model rotation')
self.rotateReset.Bind(wx.EVT_BUTTON, self.OnRotateReset)
self.toolbar2.AddControl(self.rotateReset)
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.Bind(wx.EVT_TEXT, self.OnRotate)
self.toolbar2.AddControl(self.rotate)
self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate)
self.toolbar2.Realize()
self.updateToolbar()
@ -222,7 +226,7 @@ class previewPanel(wx.Panel):
sizer.Add(self.glCanvas, 1, flag=wx.EXPAND)
sizer.Add(self.toolbar2, 0, flag=wx.EXPAND|wx.BOTTOM|wx.LEFT|wx.RIGHT, border=1)
self.SetSizer(sizer)
def OnPopupDisplay(self, e):
self.UpdatePopup(e.GetEventObject())
self.popup.Show(True)
@ -260,6 +264,9 @@ class previewPanel(wx.Panel):
profile.putProfileSetting('model_multiply_y', str(max(1, int(profile.getProfileSetting('model_multiply_y'))-1)))
self.updateModelTransform()
def OnScaleReset(self, e):
self.scale.SetValue('1.0')
def OnScale(self, e):
profile.putProfileSetting('model_scale', self.scale.GetValue())
self.updateModelTransform()
@ -279,7 +286,10 @@ class previewPanel(wx.Panel):
self.scale.SetValue(str(scale))
profile.putProfileSetting('model_scale', self.scale.GetValue())
self.updateModelTransform()
def OnRotateReset(self, e):
self.rotate.SetValue(0)
def OnRotate(self, e):
profile.putProfileSetting('model_rotate_base', self.rotate.GetValue())
self.updateModelTransform()

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB