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,6 +34,9 @@ EVT_SELECT_SLICE = wx.PyEventBinder(myEVT_SELECT_SLICE, 1) | ||
34 | myEVT_SELECT_PATIENT = wx.NewEventType() | 34 | myEVT_SELECT_PATIENT = wx.NewEventType() |
35 | EVT_SELECT_PATIENT = wx.PyEventBinder(myEVT_SELECT_PATIENT, 1) | 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 | class SelectEvent(wx.PyCommandEvent): | 40 | class SelectEvent(wx.PyCommandEvent): |
38 | def __init__(self , evtType, id): | 41 | def __init__(self , evtType, id): |
39 | super(SelectEvent, self).__init__(evtType, id) | 42 | super(SelectEvent, self).__init__(evtType, id) |
@@ -131,6 +134,7 @@ class InnerPanel(wx.Panel): | @@ -131,6 +134,7 @@ class InnerPanel(wx.Panel): | ||
131 | self.Bind(EVT_SELECT_SLICE, self.OnSelectSlice) | 134 | self.Bind(EVT_SELECT_SLICE, self.OnSelectSlice) |
132 | self.Bind(EVT_SELECT_PATIENT, self.OnSelectPatient) | 135 | self.Bind(EVT_SELECT_PATIENT, self.OnSelectPatient) |
133 | self.btn_ok.Bind(wx.EVT_BUTTON, self.OnLoadDicom) | 136 | self.btn_ok.Bind(wx.EVT_BUTTON, self.OnLoadDicom) |
137 | + self.text_panel.Bind(EVT_SELECT_SERIE_TEXT, self.OnLoadDicom) | ||
134 | 138 | ||
135 | def ShowDicomPreview(self, pubsub_evt): | 139 | def ShowDicomPreview(self, pubsub_evt): |
136 | dicom_groups = pubsub_evt.data | 140 | dicom_groups = pubsub_evt.data |
@@ -303,8 +307,9 @@ class TextPanel(wx.Panel): | @@ -303,8 +307,9 @@ class TextPanel(wx.Panel): | ||
303 | item = evt.GetItem() | 307 | item = evt.GetItem() |
304 | group = self.tree.GetItemPyData(item) | 308 | group = self.tree.GetItemPyData(item) |
305 | if isinstance(group, dcm.DicomGroup): | 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 | else: | 313 | else: |
309 | if self.tree.IsExpanded(item): | 314 | if self.tree.IsExpanded(item): |
310 | self.tree.Collapse(item) | 315 | self.tree.Collapse(item) |