chiark / gitweb /
Move multiply to preview window. (Only rotate left to move)
authordaid <daid303@gmail.com>
Thu, 22 Mar 2012 10:24:52 +0000 (11:24 +0100)
committerdaid <daid303@gmail.com>
Thu, 22 Mar 2012 10:24:52 +0000 (11:24 +0100)
SkeinPyPy/newui/mainWindow.py
SkeinPyPy/newui/preview3d.py

index b6200ed3e6b97681e10820cc8f72da084a894ea5..d7fef3c76f13c092cce90220e8e3969717856f84 100644 (file)
@@ -163,13 +163,6 @@ class mainWindow(configBase.configWindowBase):
                c = configBase.SettingRow(right, "Rotate (deg)", 'model_rotate_base', '0', '')
                validators.validFloat(c)
                configBase.settingNotify(c, self.preview3d.updateModelTransform)
-               configBase.TitleRow(right, "Multiply")
-               c = configBase.SettingRow(right, "Multiple X", 'model_multiply_x', '1', '')
-               validators.validInt(c)
-               configBase.settingNotify(c, self.preview3d.updateModelTransform)
-               c = configBase.SettingRow(right, "Multiple Y", 'model_multiply_y', '1', '')
-               validators.validInt(c)
-               configBase.settingNotify(c, self.preview3d.updateModelTransform)
 
                # load and slice buttons.
                loadButton = wx.Button(self, -1, 'Load Model')
index fc36fd66ca552992cd6148c7710bdf85b8799f92..798eddbf572db3a48adbc0a79b47d1f1fbaf9826 100644 (file)
@@ -74,11 +74,27 @@ class previewPanel(wx.Panel):
                self.toolbar2.AddControl(self.flipZ)\r
                self.Bind(wx.EVT_CHECKBOX, self.OnFlipZClick, self.flipZ)\r
                \r
-               self.toolbar2.InsertSeparator(4)\r
+               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
                self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))\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.InsertSeparator(self.toolbar2.GetToolsCount())\r
+\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
+               self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))\r
+               self.toolbar2.AddControl(self.mulXadd)\r
+               self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd)\r
+\r
+               self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))\r
+               self.toolbar2.AddControl(self.mulYsub)\r
+               self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub)\r
+               self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))\r
+               self.toolbar2.AddControl(self.mulYadd)\r
+               self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd)\r
                \r
                self.toolbar2.Realize()\r
                self.updateToolbar()\r
@@ -101,6 +117,22 @@ class previewPanel(wx.Panel):
                profile.putProfileSetting('flip_z', str(self.flipZ.GetValue()))\r
                self.updateModelTransform()\r
 \r
+       def OnMulXAddClick(self, e):\r
+               profile.putProfileSetting('model_multiply_x', str(max(1, int(profile.getProfileSetting('model_multiply_x'))+1)))\r
+               self.updateModelTransform()\r
+\r
+       def OnMulXSubClick(self, e):\r
+               profile.putProfileSetting('model_multiply_x', str(max(1, int(profile.getProfileSetting('model_multiply_x'))-1)))\r
+               self.updateModelTransform()\r
+\r
+       def OnMulYAddClick(self, e):\r
+               profile.putProfileSetting('model_multiply_y', str(max(1, int(profile.getProfileSetting('model_multiply_y'))+1)))\r
+               self.updateModelTransform()\r
+\r
+       def OnMulYSubClick(self, e):\r
+               profile.putProfileSetting('model_multiply_y', str(max(1, int(profile.getProfileSetting('model_multiply_y'))-1)))\r
+               self.updateModelTransform()\r
+\r
        def OnScale(self, e):\r
                try:\r
                        scale = float(self.scale.GetValue())\r