self.toolbar2.AddSeparator()\r
\r
# Scale\r
- self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))\r
+ self.scaleReset = NormalButton(self.toolbar2, self, 'object-scale.png', 'Reset model scale')\r
+ self.scaleReset.Bind(wx.EVT_BUTTON, self.OnScaleReset)\r
+ self.toolbar2.AddControl(self.scaleReset)\r
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.AddSeparator()\r
\r
# Rotate\r
- self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))\r
+ self.rotateReset = NormalButton(self.toolbar2, self, 'object-rotate.png', 'Reset model rotation')\r
+ self.rotateReset.Bind(wx.EVT_BUTTON, self.OnRotateReset)\r
+ self.toolbar2.AddControl(self.rotateReset)\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.Bind(wx.EVT_TEXT, self.OnRotate)\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
sizer.Add(self.glCanvas, 1, flag=wx.EXPAND)\r
sizer.Add(self.toolbar2, 0, flag=wx.EXPAND|wx.BOTTOM|wx.LEFT|wx.RIGHT, border=1)\r
self.SetSizer(sizer)\r
+\r
+ def GetBitmap(self, bitmapFilename):\r
+ return wx.Bitmap(os.path.join(os.path.split(__file__)[0], "../images", bitmapFilename))\r
\r
def OnPopupDisplay(self, e):\r
self.UpdatePopup(e.GetEventObject())\r
profile.putProfileSetting('model_multiply_y', str(max(1, int(profile.getProfileSetting('model_multiply_y'))-1)))\r
self.updateModelTransform()\r
\r
+ def OnScaleReset(self, e):\r
+ self.scale.SetValue('1')\r
+\r
def OnScale(self, e):\r
profile.putProfileSetting('model_scale', self.scale.GetValue())\r
self.updateModelTransform()\r
self.scale.SetValue(str(scale))\r
profile.putProfileSetting('model_scale', self.scale.GetValue())\r
self.updateModelTransform()\r
- \r
+\r
+ def OnRotateReset(self, e):\r
+ self.rotate.SetValue(0)\r
+\r
def OnRotate(self, e):\r
profile.putProfileSetting('model_rotate_base', self.rotate.GetValue())\r
self.updateModelTransform()\r