Skip to content

Commit

Permalink
Add double-click behaviors
Browse files Browse the repository at this point in the history
Double-clicking a footprint brings up part selection.
Double-clicking a part in the selector assigns the part.
  • Loading branch information
wrs committed Nov 10, 2024
1 parent 05e1c3e commit 7cb78a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ def __init__(self, parent, kicad_provider=KicadProvider()):
dv.EVT_DATAVIEW_SELECTION_CHANGED, self.OnFootprintSelected
)

self.footprint_list.Bind(dv.EVT_DATAVIEW_ITEM_ACTIVATED, self.select_part)

self.footprint_list.Bind(dv.EVT_DATAVIEW_ITEM_CONTEXT_MENU, self.OnRightDown)

table_sizer.Add(self.right_toolbar, 1, wx.EXPAND, 5)
Expand Down
3 changes: 3 additions & 0 deletions partselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ def __init__(self, parent, parts):
wx.dataview.EVT_DATAVIEW_SELECTION_CHANGED, self.OnPartSelected
)

self.part_list.Bind(wx.EVT_LEFT_DCLICK, self.select_part)


table_sizer = wx.BoxSizer(wx.HORIZONTAL)
table_sizer.SetMinSize(HighResWxSize(parent.window, wx.Size(-1, 400)))
table_sizer.Add(self.part_list, 20, wx.ALL | wx.EXPAND, 5)
Expand Down

0 comments on commit 7cb78a5

Please sign in to comment.