Commit ab07674e3a60c29375aeb0ff8529d5013a7fac13

Authored by tfmoraes
1 parent 4d912616

ENH: Change the image from item related to layout in toolbar when import panel is showed

Showing 1 changed file with 15 additions and 7 deletions   Show diff stats
invesalius/gui/frame.py
... ... @@ -183,8 +183,7 @@ class Frame(wx.Frame):
183 183 self.aui_manager = aui_manager
184 184  
185 185 def ShowImportPanel(self, evt_pubsub):
186   - #ps.Publisher().sendMessage("Load data to import panel", path)
187   -
  186 + ps.Publisher().sendMessage("Set layout button data only")
188 187 aui_manager = self.aui_manager
189 188 aui_manager.GetPane("Import").Show(1)
190 189 aui_manager.GetPane("Data").Show(0)
... ... @@ -193,17 +192,15 @@ class Frame(wx.Frame):
193 192  
194 193 def HideImportPanel(self, evt_pubsub):
195 194 print "HideImportPanel"
196   -
197 195 aui_manager = self.aui_manager
198 196 aui_manager.GetPane("Import").Show(0)
199 197 aui_manager.GetPane("Data").Show(0)
200 198 aui_manager.GetPane("Tasks").Show(1)
201 199 aui_manager.Update()
202 200  
203   -
204   -
205 201 def ShowContentPanel(self, evt_pubsub):
206 202 print "ShowContentPanel"
  203 + ps.Publisher().sendMessage("Set layout button full")
207 204 aui_manager = self.aui_manager
208 205 aui_manager.GetPane("Import").Show(0)
209 206 aui_manager.GetPane("Data").Show(1)
... ... @@ -760,6 +757,7 @@ class LayoutToolBar(wx.ToolBar):
760 757 self.parent = parent
761 758 self.__init_items()
762 759 self.__bind_events_wx()
  760 + self.__bind_events()
763 761 self.ontool = False
764 762  
765 763 def __init_items(self):
... ... @@ -790,6 +788,12 @@ class LayoutToolBar(wx.ToolBar):
790 788  
791 789 self.Realize()
792 790  
  791 + def __bind_events(self):
  792 + ps.Publisher().subscribe(self.SetLayoutButtonOnlyData,
  793 + "Set layout button data only")
  794 + ps.Publisher().subscribe(self.SetLayoutButtonFull,
  795 + "Set layout button full")
  796 +
793 797 def __bind_events_wx(self):
794 798 self.Bind(wx.EVT_TOOL, self.OnClick)
795 799  
... ... @@ -807,9 +811,8 @@ class LayoutToolBar(wx.ToolBar):
807 811 self.ToggleTool(item, False)
808 812  
809 813 def OnTask(self):
810   -
811 814 if self.ontool:
812   - self.SetToolNormalBitmap(ID_LAYOUT,self.BMP_WITHOUT_MENU )
  815 + self.SetToolNormalBitmap(ID_LAYOUT,self.BMP_WITHOUT_MENU)
813 816 ps.Publisher().sendMessage('Show task panel')
814 817 self.SetToolShortHelp(ID_LAYOUT,"Hide task panel")
815 818 self.ontool = False
... ... @@ -826,3 +829,8 @@ class LayoutToolBar(wx.ToolBar):
826 829 else:
827 830 print "TODO: Send message so all textactors are hiden"
828 831  
  832 + def SetLayoutButtonOnlyData(self, pubsub_evt):
  833 + self.SetToolNormalBitmap(ID_LAYOUT,self.BMP_WITH_MENU)
  834 +
  835 + def SetLayoutButtonFull(self, pubsub_evt):
  836 + self.SetToolNormalBitmap(ID_LAYOUT,self.BMP_WITHOUT_MENU)
... ...