File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
SparkFunKiCadCAMmer/dialog Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -218,3 +218,21 @@ def OnRunCAMmerClick(self, e):
218
218
219
219
def OnCancelClick (self , e ):
220
220
self .EndModal (wx .ID_CANCEL )
221
+
222
+ def OnLayersGridCellClicked (self , event ):
223
+ self .LayersGrid .ClearSelection ()
224
+ #self.LayersGrid.SelectRow(event.Row)
225
+ if event .Col == 0 :
226
+ # toggle checkbox
227
+ val = self .LayersGrid .GetCellValue (event .Row , event .Col )
228
+ val = "" if val else "1"
229
+ self .LayersGrid .SetCellValue (event .Row , event .Col , val )
230
+
231
+ def OnEdgesGridCellClicked (self , event ):
232
+ self .EdgesGrid .ClearSelection ()
233
+ #self.EdgesGrid.SelectRow(event.Row)
234
+ if event .Col == 0 :
235
+ # toggle checkbox
236
+ val = self .EdgesGrid .GetCellValue (event .Row , event .Col )
237
+ val = "" if val else "1"
238
+ self .EdgesGrid .SetCellValue (event .Row , event .Col , val )
Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ def __init__( self, parent ):
157
157
158
158
# Connect Events
159
159
self .Bind ( wx .EVT_INIT_DIALOG , self .OnInitDlg )
160
+ self .LayersGrid .Bind ( wx .grid .EVT_GRID_CELL_LEFT_CLICK , self .OnLayersGridCellClicked )
161
+ self .EdgesGrid .Bind ( wx .grid .EVT_GRID_CELL_LEFT_CLICK , self .OnEdgesGridCellClicked )
160
162
self .m_buttonRunCAMmer .Bind ( wx .EVT_BUTTON , self .OnRunCAMmerClick )
161
163
self .m_buttonCancel .Bind ( wx .EVT_BUTTON , self .OnCancelClick )
162
164
@@ -168,6 +170,12 @@ def __del__( self ):
168
170
def OnInitDlg ( self , event ):
169
171
pass
170
172
173
+ def OnLayersGridCellClicked ( self , event ):
174
+ pass
175
+
176
+ def OnEdgesGridCellClicked ( self , event ):
177
+ pass
178
+
171
179
def OnRunCAMmerClick ( self , event ):
172
180
pass
173
181
Original file line number Diff line number Diff line change 241
241
<property name =" window_extra_style" ></property >
242
242
<property name =" window_name" ></property >
243
243
<property name =" window_style" ></property >
244
+ <event name =" OnGridCellLeftClick" >OnLayersGridCellClicked</event >
244
245
</object >
245
246
</object >
246
247
</object >
408
409
<property name =" window_extra_style" ></property >
409
410
<property name =" window_name" ></property >
410
411
<property name =" window_style" ></property >
412
+ <event name =" OnGridCellLeftClick" >OnEdgesGridCellClicked</event >
411
413
</object >
412
414
</object >
413
415
</object >
You can’t perform that action at this time.
0 commit comments