Commit 2a389e1fa8a1619e1934ce361493a07ed6667b5c
1 parent
9af4cec4
Exists in
master
and in
6 other branches
ENH: The double click in text panel is working now
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
invesalius/gui/import_panel.py
... | ... | @@ -34,6 +34,9 @@ EVT_SELECT_SLICE = wx.PyEventBinder(myEVT_SELECT_SLICE, 1) |
34 | 34 | myEVT_SELECT_PATIENT = wx.NewEventType() |
35 | 35 | EVT_SELECT_PATIENT = wx.PyEventBinder(myEVT_SELECT_PATIENT, 1) |
36 | 36 | |
37 | +myEVT_SELECT_SERIE_TEXT = wx.NewEventType() | |
38 | +EVT_SELECT_SERIE_TEXT = wx.PyEventBinder(myEVT_SELECT_SERIE_TEXT, 1) | |
39 | + | |
37 | 40 | class SelectEvent(wx.PyCommandEvent): |
38 | 41 | def __init__(self , evtType, id): |
39 | 42 | super(SelectEvent, self).__init__(evtType, id) |
... | ... | @@ -131,6 +134,7 @@ class InnerPanel(wx.Panel): |
131 | 134 | self.Bind(EVT_SELECT_SLICE, self.OnSelectSlice) |
132 | 135 | self.Bind(EVT_SELECT_PATIENT, self.OnSelectPatient) |
133 | 136 | self.btn_ok.Bind(wx.EVT_BUTTON, self.OnLoadDicom) |
137 | + self.text_panel.Bind(EVT_SELECT_SERIE_TEXT, self.OnLoadDicom) | |
134 | 138 | |
135 | 139 | def ShowDicomPreview(self, pubsub_evt): |
136 | 140 | dicom_groups = pubsub_evt.data |
... | ... | @@ -303,8 +307,9 @@ class TextPanel(wx.Panel): |
303 | 307 | item = evt.GetItem() |
304 | 308 | group = self.tree.GetItemPyData(item) |
305 | 309 | if isinstance(group, dcm.DicomGroup): |
306 | - ps.Publisher().sendMessage('Open DICOM group', | |
307 | - group) | |
310 | + my_evt = SelectEvent(myEVT_SELECT_SERIE_TEXT, self.GetId()) | |
311 | + my_evt.SetItemData(group) | |
312 | + self.GetEventHandler().ProcessEvent(my_evt) | |
308 | 313 | else: |
309 | 314 | if self.tree.IsExpanded(item): |
310 | 315 | self.tree.Collapse(item) | ... | ... |