diff --git a/configtool/addheaterdlg.py b/configtool/addheaterdlg.py index 1b877ab..b3d782b 100644 --- a/configtool/addheaterdlg.py +++ b/configtool/addheaterdlg.py @@ -1,6 +1,6 @@ import wx -from configtool.data import BSIZESMALL +from configtool.data import BSIZESMALL, offsetChLabel, offsetTcLabel class AddHeaterDlg(wx.Dialog): @@ -22,7 +22,7 @@ class AddHeaterDlg(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Heater Name:", size = (80, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) self.tcName = wx.TextCtrl(self, wx.ID_ANY, "") self.tcName.SetFont(font) @@ -37,7 +37,7 @@ class AddHeaterDlg(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Pin:", size = (80, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) self.chPin = wx.Choice(self, wx.ID_ANY, choices = pins) self.chPin.SetFont(font) diff --git a/configtool/addsensordlg.py b/configtool/addsensordlg.py index 8075d8e..d0174b0 100644 --- a/configtool/addsensordlg.py +++ b/configtool/addsensordlg.py @@ -1,6 +1,7 @@ import wx -from configtool.data import pinNames, BSIZESMALL, sensorTypes +from configtool.data import (pinNames, BSIZESMALL, sensorTypes, offsetTcLabel, + offsetChLabel) class AddSensorDlg(wx.Dialog): @@ -27,7 +28,7 @@ class AddSensorDlg(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Sensor Name:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) self.tcName = wx.TextCtrl(self, wx.ID_ANY, "") self.tcName.SetFont(font) @@ -43,7 +44,7 @@ class AddSensorDlg(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Sensor Type:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) sl = sorted(sensorTypes.keys()) @@ -61,7 +62,7 @@ class AddSensorDlg(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Pin:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) self.choiceList = pinNames self.chPin = wx.Choice(self, wx.ID_ANY, choices = pins) @@ -78,7 +79,7 @@ class AddSensorDlg(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Additional:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) self.tcAddtl = wx.TextCtrl(self, wx.ID_ANY, "") self.tcAddtl.SetFont(font) diff --git a/configtool/calcbelt.py b/configtool/calcbelt.py index a86b71c..72ddf2e 100644 --- a/configtool/calcbelt.py +++ b/configtool/calcbelt.py @@ -1,6 +1,7 @@ import wx -from configtool.data import BSIZESMALL, reFloat, reInteger +from configtool.data import (BSIZESMALL, reFloat, reInteger, offsetChLabel, + offsetTcLabel) class CalcBelt(wx.Dialog): @@ -24,7 +25,7 @@ class CalcBelt(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Step Angle:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) lsz.AddSpacer((5, 5)) stepAngles = ["1.8 (200 per revolution)", "0.9 (400 per revolution)", @@ -45,7 +46,7 @@ class CalcBelt(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Microstepping:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) lsz.AddSpacer((5, 5)) microStepping = ["1 - full step", "1/2 - half step", "1/4 - quarter step", @@ -69,7 +70,7 @@ class CalcBelt(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Belt Pitch (in mm):", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) lsz.AddSpacer((5, 5)) tc = wx.TextCtrl(self, wx.ID_ANY, "2", style = wx.TE_RIGHT) @@ -100,7 +101,7 @@ class CalcBelt(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Pulley Teeth Count:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) lsz.AddSpacer((5, 5)) tc = wx.TextCtrl(self, wx.ID_ANY, "8", style = wx.TE_RIGHT) diff --git a/configtool/calcscrew.py b/configtool/calcscrew.py index f380147..9a26327 100644 --- a/configtool/calcscrew.py +++ b/configtool/calcscrew.py @@ -1,6 +1,6 @@ import wx -from configtool.data import BSIZESMALL, reFloat +from configtool.data import BSIZESMALL, reFloat, offsetChLabel, offsetTcLabel class CalcScrew(wx.Dialog): @@ -24,7 +24,7 @@ class CalcScrew(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Step Angle:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) lsz.AddSpacer((5, 5)) stepAngles = ["1.8 (200 per revolution)", "0.9 (400 per revolution)", @@ -45,7 +45,7 @@ class CalcScrew(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Microstepping:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) lsz.AddSpacer((5, 5)) microStepping = ["1 - full step", "1/2 - half step", "1/4 - quarter step", @@ -69,7 +69,7 @@ class CalcScrew(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Screw Pitch (mm/rev):", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) lsz.AddSpacer((5, 5)) tc = wx.TextCtrl(self, wx.ID_ANY, "2", style = wx.TE_RIGHT) @@ -104,7 +104,7 @@ class CalcScrew(wx.Dialog): st = wx.StaticText(self, wx.ID_ANY, "Gear Ratio:", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) lsz.AddSpacer((5, 5)) tc = wx.TextCtrl(self, wx.ID_ANY, "1", size = (40, -1), style = wx.TE_RIGHT) diff --git a/configtool/data.py b/configtool/data.py index 301d115..41c5d2e 100644 --- a/configtool/data.py +++ b/configtool/data.py @@ -1,5 +1,6 @@ import re +from sys import platform supportedCPUs = ['ATmega168', 'ATmega328P', 'ATmega644', 'ATmega644P', @@ -17,6 +18,13 @@ BSIZE = (90, 60) BSIZESMALL = (90, 30) +if platform == "win32": + offsetTcLabel = 4 + offsetChLabel = 4 +else: + offsetTcLabel = 6 + offsetChLabel = 8 + TYPE_GENERAL = 0 TYPE_FLOAT = 1 diff --git a/configtool/page.py b/configtool/page.py index 443bd37..d520fb1 100644 --- a/configtool/page.py +++ b/configtool/page.py @@ -1,7 +1,7 @@ import wx -from configtool.data import reInteger, reFloat +from configtool.data import reInteger, reFloat, offsetChLabel, offsetTcLabel class Page: @@ -31,7 +31,7 @@ class Page: st = wx.StaticText(self, wx.ID_ANY, self.labels[name] + " ", size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(self.font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetTcLabel) tc = wx.TextCtrl(self, wx.ID_ANY, "", style = wx.TE_RIGHT, name = name) tc.SetFont(self.font) @@ -68,7 +68,7 @@ class Page: st = wx.StaticText(self, wx.ID_ANY, self.labels[name], size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(self.font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) ch = wx.Choice(self, wx.ID_ANY, choices = choices, size = size, name = name) ch.SetFont(self.font) @@ -84,7 +84,7 @@ class Page: st = wx.StaticText(self, wx.ID_ANY, self.labels[name], size = (labelWidth, -1), style = wx.ALIGN_RIGHT) st.SetFont(self.font) - lsz.Add(st) + lsz.Add(st, 1, wx.TOP, offsetChLabel) if allowBlank: opts = ["-"] + pins diff --git a/configtool/settings.py b/configtool/settings.py index 556e65b..3fd7c85 100644 --- a/configtool/settings.py +++ b/configtool/settings.py @@ -2,7 +2,7 @@ import ConfigParser import os import wx -from configtool.data import BSIZESMALL +from configtool.data import BSIZESMALL, offsetTcLabel INIFILE = "configtool.default.ini" @@ -108,7 +108,7 @@ class SettingsDlg(wx.Dialog): t = wx.StaticText(self, wx.ID_ANY, f[0], size = (labelWidth, -1), style = wx.ALIGN_RIGHT) t.SetFont(settings.font) - lsz.Add(t) + lsz.Add(t, 1, wx.TOP, offsetTcLabel) lsz.AddSpacer((8, 8))