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):
218218
219219 def OnCancelClick (self , e ):
220220 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 ):
157157
158158 # Connect Events
159159 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 )
160162 self .m_buttonRunCAMmer .Bind ( wx .EVT_BUTTON , self .OnRunCAMmerClick )
161163 self .m_buttonCancel .Bind ( wx .EVT_BUTTON , self .OnCancelClick )
162164
@@ -168,6 +170,12 @@ def __del__( self ):
168170 def OnInitDlg ( self , event ):
169171 pass
170172
173+ def OnLayersGridCellClicked ( self , event ):
174+ pass
175+
176+ def OnEdgesGridCellClicked ( self , event ):
177+ pass
178+
171179 def OnRunCAMmerClick ( self , event ):
172180 pass
173181
Original file line number Diff line number Diff line change 241241 <property name =" window_extra_style" ></property >
242242 <property name =" window_name" ></property >
243243 <property name =" window_style" ></property >
244+ <event name =" OnGridCellLeftClick" >OnLayersGridCellClicked</event >
244245 </object >
245246 </object >
246247 </object >
408409 <property name =" window_extra_style" ></property >
409410 <property name =" window_name" ></property >
410411 <property name =" window_style" ></property >
412+ <event name =" OnGridCellLeftClick" >OnEdgesGridCellClicked</event >
411413 </object >
412414 </object >
413415 </object >
You can’t perform that action at this time.
0 commit comments