CircularZone 2.0: layer selection, zone centered on selected pad
This commit is contained in:
1 parent
fa76f5e4e2
commit
0a8e177d05
3 files changed
+101
-997
No files matched your search
@@ -1,25 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
###########################################################################
|
||||
## Python code generated with wxFormBuilder (version Dec 21 2016)
|
||||
## http://www.wxformbuilder.org/
|
||||
##
|
||||
## PLEASE DO "NOT" EDIT THIS FILE!
|
||||
###########################################################################
|
||||
|
||||
import wx
|
||||
import wx.xrc
|
||||
|
||||
###########################################################################
|
||||
## Class CircularZoneDlg
|
||||
###########################################################################
|
||||
|
||||
class CircularZoneDlg ( wx.Dialog ):
|
||||
|
||||
def __init__( self, parent ):
|
||||
wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Circular zone parameters", pos = wx.DefaultPosition, size = wx.Size( 373,290 ), style = wx.DEFAULT_DIALOG_STYLE )
|
||||
wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Circular zone parameters", pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.DEFAULT_DIALOG_STYLE )
|
||||
|
||||
self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
|
||||
self.SetMinSize( wx.Size( 250, 410 ) )
|
||||
|
||||
bSizer3 = wx.BoxSizer( wx.VERTICAL )
|
||||
|
||||
@@ -27,21 +17,32 @@ class CircularZoneDlg ( wx.Dialog ):
|
||||
self.m_comment.Wrap( -1 )
|
||||
bSizer3.Add( self.m_comment, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
bSizer31 = wx.BoxSizer( wx.HORIZONTAL )
|
||||
sbSizerDim = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Dimension Type" ), wx.VERTICAL )
|
||||
|
||||
self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Radius (mm)", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_staticText3.Wrap( -1 )
|
||||
bSizer31.Add( self.m_staticText3, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
self.m_radio_radius = wx.RadioButton( sbSizerDim.GetStaticBox(), wx.ID_ANY, u"Radius", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_radio_radius.SetValue(True)
|
||||
sbSizerDim.Add( self.m_radio_radius, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
self.m_radiusMM = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_radiusMM.SetMinSize( wx.Size( 1000,-1 ) )
|
||||
self.m_radio_diameter = wx.RadioButton( sbSizerDim.GetStaticBox(), wx.ID_ANY, u"Diameter", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
sbSizerDim.Add( self.m_radio_diameter, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
bSizer31.Add( self.m_radiusMM, 1, wx.ALL|wx.EXPAND, 5 )
|
||||
bSizer3.Add( sbSizerDim, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
sbSizerValue = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Radius (mm)" ), wx.HORIZONTAL )
|
||||
self.sbSizerValue = sbSizerValue
|
||||
|
||||
bSizer3.Add( bSizer31, 0, 0, 5 )
|
||||
self.m_radiusMM = wx.TextCtrl( sbSizerValue.GetStaticBox(), wx.ID_ANY, u"10", wx.DefaultPosition, wx.Size( 100,-1 ), 0 )
|
||||
sbSizerValue.Add( self.m_radiusMM, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
|
||||
bSizer3.Add( sbSizerValue, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
sbSizerLayer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Layer" ), wx.HORIZONTAL )
|
||||
|
||||
m_comboBoxLayerChoices = []
|
||||
self.m_comboBoxLayer = wx.ComboBox( sbSizerLayer.GetStaticBox(), wx.ID_ANY, u"Combo!", wx.DefaultPosition, wx.Size( 200,-1 ), m_comboBoxLayerChoices, 0 )
|
||||
sbSizerLayer.Add( self.m_comboBoxLayer, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
|
||||
|
||||
bSizer3.Add( sbSizerLayer, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
sbSizer1 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Type of Zone" ), wx.VERTICAL )
|
||||
|
||||
@@ -51,19 +52,14 @@ class CircularZoneDlg ( wx.Dialog ):
|
||||
self.m_radio_out = wx.RadioButton( sbSizer1.GetStaticBox(), wx.ID_ANY, u"Keepout", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
sbSizer1.Add( self.m_radio_out, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
bSizer4.Add( sbSizer1, 1, wx.EXPAND, 5 )
|
||||
bSizer3.Add( sbSizer1, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
sbSizer2 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Number of segments" ), wx.VERTICAL )
|
||||
|
||||
self.m_textCtrl_seg = wx.TextCtrl( sbSizer2.GetStaticBox(), wx.ID_ANY, u"64", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.m_textCtrl_seg = wx.TextCtrl( sbSizer2.GetStaticBox(), wx.ID_ANY, u"64", wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
|
||||
sbSizer2.Add( self.m_textCtrl_seg, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
bSizer4.Add( sbSizer2, 1, wx.EXPAND, 5 )
|
||||
|
||||
|
||||
bSizer3.Add( bSizer4, 1, wx.EXPAND, 5 )
|
||||
bSizer3.Add( sbSizer2, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
@@ -78,16 +74,27 @@ class CircularZoneDlg ( wx.Dialog ):
|
||||
self.m_button2 = wx.Button( self, wx.ID_CANCEL, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
bSizer1.Add( self.m_button2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
|
||||
|
||||
bSizer3.Add( bSizer1, 0, wx.ALIGN_RIGHT|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
self.SetSizer( bSizer3 )
|
||||
self.Layout()
|
||||
self.Fit()
|
||||
|
||||
self.Centre( wx.BOTH )
|
||||
|
||||
self.m_radio_radius.Bind(wx.EVT_RADIOBUTTON, self.OnDimToggle)
|
||||
self.m_radio_diameter.Bind(wx.EVT_RADIOBUTTON, self.OnDimToggle)
|
||||
|
||||
def OnDimToggle(self, event):
|
||||
if self.m_radio_radius.GetValue():
|
||||
new_label = u"Radius (mm)"
|
||||
else:
|
||||
new_label = u"Diameter (mm)"
|
||||
|
||||
self.sbSizerValue.GetStaticBox().SetLabel(new_label)
|
||||
self.sbSizerValue.Layout()
|
||||
self.Refresh()
|
||||
event.Skip()
|
||||
|
||||
def __del__( self ):
|
||||
pass
|
||||
|
||||
|
||||
Reference in new issue
Block a user