Commit 69661eb1d393d54a12489689bf89e6c617b9ab5d
1 parent
a00db00a
Exists in
master
and in
68 other branches
ENH: Modes and SafeYield
Showing
5 changed files
with
23 additions
and
3 deletions
Show diff stats
invesalius/data/viewer_slice.py
invesalius/gui/dicom_preview_panel.py
invesalius/gui/frame.py
invesalius/gui/task_slice.py
... | ... | @@ -205,6 +205,9 @@ class InnerFoldPanel(wx.Panel): |
205 | 205 | fold_panel.ApplyCaptionStyle(item, style) |
206 | 206 | fold_panel.AddFoldPanelWindow(item, EditionTools(item), Spacing= 0, |
207 | 207 | leftSpacing=0, rightSpacing=0) |
208 | + self.editor_panel_id = item.GetId() | |
209 | + self.last_panel_opened = None | |
210 | + | |
208 | 211 | #fold_panel.Expand(fold_panel.GetFoldPanel(1)) |
209 | 212 | |
210 | 213 | # Panel sizer to expand fold panel |
... | ... | @@ -214,6 +217,22 @@ class InnerFoldPanel(wx.Panel): |
214 | 217 | self.SetSizer(sizer) |
215 | 218 | self.Update() |
216 | 219 | self.SetAutoLayout(1) |
220 | + fold_panel.Bind(fpb.EVT_CAPTIONBAR, self.OnFoldPressCaption) | |
221 | + | |
222 | + def OnFoldPressCaption(self, evt): | |
223 | + | |
224 | + if (self.editor_panel_id == evt.GetTag().GetId()): | |
225 | + if not(evt.GetFoldStatus()): | |
226 | + ps.Publisher().sendMessage('Enable mode', const.SLICE_STATE_EDITOR) | |
227 | + else: | |
228 | + ps.Publisher().sendMessage('Disable mode', const.SLICE_STATE_EDITOR) | |
229 | + else: | |
230 | + if(self.last_panel_opened == self.editor_panel_id): | |
231 | + ps.Publisher().sendMessage('Disable mode', const.SLICE_STATE_EDITOR) | |
232 | + | |
233 | + self.last_panel_opened = evt.GetTag().GetId() | |
234 | + | |
235 | + evt.Skip() | |
217 | 236 | |
218 | 237 | def GetMaskSelected(self): |
219 | 238 | x= self.mask_prop_panel.GetMaskSelected() | ... | ... |