Skip to content

Commit 47f61de

Browse files
committed
Add Gaps Help
1 parent cb0a73f commit 47f61de

File tree

3 files changed

+242
-17
lines changed

3 files changed

+242
-17
lines changed

SparkFunKiCadPanelizer/dialog/dialog.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ class GeneralPanel(dialog_text_base.GeneralPanelBase):
217217
def __init__(self, parent):
218218
dialog_text_base.GeneralPanelBase.__init__(self, parent)
219219

220+
self.m_buttonGapsVerticalHelp.SetLabelText("")
221+
# Icon by Icons8 https://icons8.com : https://icons8.com/icon/63308/info
222+
self.m_buttonGapsVerticalHelp.SetBitmap(get_btn_bitmap("info-15.png"))
223+
224+
self.m_buttonGapsHorizontalHelp.SetLabelText("")
225+
# Icon by Icons8 https://icons8.com : https://icons8.com/icon/63308/info
226+
self.m_buttonGapsHorizontalHelp.SetBitmap(get_btn_bitmap("info-15.png"))
227+
220228
self.m_buttonFiducialsHelp.SetLabelText("")
221229
# Icon by Icons8 https://icons8.com : https://icons8.com/icon/63308/info
222230
self.m_buttonFiducialsHelp.SetBitmap(get_btn_bitmap("info-15.png"))
@@ -225,6 +233,28 @@ def __init__(self, parent):
225233
# Icon by Icons8 https://icons8.com : https://icons8.com/icon/63308/info
226234
self.m_buttonEdgeHelp.SetBitmap(get_btn_bitmap("info-15.png"))
227235

236+
def ClickGapsVerticalHelp( self, event ):
237+
wx.MessageBox("\
238+
This sets the width of the vertical gaps\n\
239+
within the panel. Vertical gaps run from\n\
240+
the bottom rail to the top rail. The width\n\
241+
is defined in X.\n\
242+
\n\
243+
The gap width should be at least 0.3\" to\n\
244+
aid automated inspection.\
245+
", 'Info', wx.OK | wx.ICON_INFORMATION)
246+
247+
def ClickGapsHorizontalHelp( self, event ):
248+
wx.MessageBox("\
249+
This sets the width of the horizontal gaps\n\
250+
within the panel. Horizontal gaps run from\n\
251+
the left rail to the right rail. The width\n\
252+
is defined in Y.\n\
253+
\n\
254+
The gap width should be at least 0.3\" to\n\
255+
aid automated inspection.\
256+
", 'Info', wx.OK | wx.ICON_INFORMATION)
257+
228258
def ClickFiducialsHelp( self, event ):
229259
wx.MessageBox("\
230260
By default, the panel fiducials are placed in\n\

SparkFunKiCadPanelizer/dialog/dialog_text_base.py

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,34 +159,55 @@ def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.
159159

160160
sbSizer3 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, _(u"Gaps:") ), wx.VERTICAL )
161161

162-
fgSizerGaps = wx.FlexGridSizer( 0, 2, 4, 4 )
163-
fgSizerGaps.SetFlexibleDirection( wx.BOTH )
164-
fgSizerGaps.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
162+
fgSizerVerticalGaps = wx.FlexGridSizer( 0, 3, 0, 0 )
163+
fgSizerVerticalGaps.SetFlexibleDirection( wx.BOTH )
164+
fgSizerVerticalGaps.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
165165

166166
self.m_gapsVerticalLabel = wx.StaticText( sbSizer3.GetStaticBox(), wx.ID_ANY, _(u"Vertical Gap (X):"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_LEFT )
167167
self.m_gapsVerticalLabel.Wrap( -1 )
168168

169-
fgSizerGaps.Add( self.m_gapsVerticalLabel, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
169+
self.m_gapsVerticalLabel.SetMinSize( wx.Size( 120,-1 ) )
170+
171+
fgSizerVerticalGaps.Add( self.m_gapsVerticalLabel, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
170172

171173
self.m_gapsVerticalCtrl = wx.TextCtrl( sbSizer3.GetStaticBox(), wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
172174
self.m_gapsVerticalCtrl.SetMaxLength( 0 )
173175
self.m_gapsVerticalCtrl.SetMinSize( wx.Size( 64,-1 ) )
174176

175-
fgSizerGaps.Add( self.m_gapsVerticalCtrl, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
177+
fgSizerVerticalGaps.Add( self.m_gapsVerticalCtrl, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
178+
179+
self.m_buttonGapsVerticalHelp = wx.Button( sbSizer3.GetStaticBox(), wx.ID_ANY, _(u"MyButton"), wx.DefaultPosition, wx.DefaultSize, 0 )
180+
self.m_buttonGapsVerticalHelp.SetMinSize( wx.Size( 15,15 ) )
181+
182+
fgSizerVerticalGaps.Add( self.m_buttonGapsVerticalHelp, 0, wx.ALL, 5 )
183+
184+
185+
sbSizer3.Add( fgSizerVerticalGaps, 1, wx.EXPAND, 5 )
186+
187+
fgSizerHorizontalGaps = wx.FlexGridSizer( 0, 3, 0, 0 )
188+
fgSizerHorizontalGaps.SetFlexibleDirection( wx.BOTH )
189+
fgSizerHorizontalGaps.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
176190

177191
self.m_gapsHorizontalLabel = wx.StaticText( sbSizer3.GetStaticBox(), wx.ID_ANY, _(u"Horizontal Gap (Y):"), wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_LEFT )
178192
self.m_gapsHorizontalLabel.Wrap( -1 )
179193

180-
fgSizerGaps.Add( self.m_gapsHorizontalLabel, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
194+
self.m_gapsHorizontalLabel.SetMinSize( wx.Size( 120,-1 ) )
195+
196+
fgSizerHorizontalGaps.Add( self.m_gapsHorizontalLabel, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
181197

182198
self.m_gapsHorizontalCtrl = wx.TextCtrl( sbSizer3.GetStaticBox(), wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
183199
self.m_gapsHorizontalCtrl.SetMaxLength( 0 )
184200
self.m_gapsHorizontalCtrl.SetMinSize( wx.Size( 64,-1 ) )
185201

186-
fgSizerGaps.Add( self.m_gapsHorizontalCtrl, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
202+
fgSizerHorizontalGaps.Add( self.m_gapsHorizontalCtrl, 1, wx.ALIGN_CENTER_VERTICAL, 5 )
187203

204+
self.m_buttonGapsHorizontalHelp = wx.Button( sbSizer3.GetStaticBox(), wx.ID_ANY, _(u"MyButton"), wx.DefaultPosition, wx.DefaultSize, 0 )
205+
self.m_buttonGapsHorizontalHelp.SetMinSize( wx.Size( 15,15 ) )
188206

189-
sbSizer3.Add( fgSizerGaps, 0, wx.ALL, 10 )
207+
fgSizerHorizontalGaps.Add( self.m_buttonGapsHorizontalHelp, 0, wx.ALL, 5 )
208+
209+
210+
sbSizer3.Add( fgSizerHorizontalGaps, 1, wx.EXPAND, 5 )
190211

191212
self.m_removeRightVerticalCheck = wx.CheckBox( sbSizer3.GetStaticBox(), wx.ID_ANY, _(u"Remove right-most vertical gap and use v-score instead"), wx.DefaultPosition, wx.DefaultSize, 0 )
192213
sbSizer3.Add( self.m_removeRightVerticalCheck, 0, wx.ALL, 5 )
@@ -238,6 +259,8 @@ def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.
238259
bMainSizer.Fit( self )
239260

240261
# Connect Events
262+
self.m_buttonGapsVerticalHelp.Bind( wx.EVT_BUTTON, self.ClickGapsVerticalHelp )
263+
self.m_buttonGapsHorizontalHelp.Bind( wx.EVT_BUTTON, self.ClickGapsHorizontalHelp )
241264
self.m_buttonFiducialsHelp.Bind( wx.EVT_BUTTON, self.ClickFiducialsHelp )
242265
self.m_buttonEdgeHelp.Bind( wx.EVT_BUTTON, self.ClickEdgeHelp )
243266

@@ -246,6 +269,12 @@ def __del__( self ):
246269

247270

248271
# Virtual event handlers, override them in your derived class
272+
def ClickGapsVerticalHelp( self, event ):
273+
pass
274+
275+
def ClickGapsHorizontalHelp( self, event ):
276+
pass
277+
249278
def ClickFiducialsHelp( self, event ):
250279
pass
251280

0 commit comments

Comments
 (0)