Commit ab07674e3a60c29375aeb0ff8529d5013a7fac13
1 parent
4d912616
Exists in
master
and in
6 other branches
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,8 +183,7 @@ class Frame(wx.Frame): | ||
183 | self.aui_manager = aui_manager | 183 | self.aui_manager = aui_manager |
184 | 184 | ||
185 | def ShowImportPanel(self, evt_pubsub): | 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 | aui_manager = self.aui_manager | 187 | aui_manager = self.aui_manager |
189 | aui_manager.GetPane("Import").Show(1) | 188 | aui_manager.GetPane("Import").Show(1) |
190 | aui_manager.GetPane("Data").Show(0) | 189 | aui_manager.GetPane("Data").Show(0) |
@@ -193,17 +192,15 @@ class Frame(wx.Frame): | @@ -193,17 +192,15 @@ class Frame(wx.Frame): | ||
193 | 192 | ||
194 | def HideImportPanel(self, evt_pubsub): | 193 | def HideImportPanel(self, evt_pubsub): |
195 | print "HideImportPanel" | 194 | print "HideImportPanel" |
196 | - | ||
197 | aui_manager = self.aui_manager | 195 | aui_manager = self.aui_manager |
198 | aui_manager.GetPane("Import").Show(0) | 196 | aui_manager.GetPane("Import").Show(0) |
199 | aui_manager.GetPane("Data").Show(0) | 197 | aui_manager.GetPane("Data").Show(0) |
200 | aui_manager.GetPane("Tasks").Show(1) | 198 | aui_manager.GetPane("Tasks").Show(1) |
201 | aui_manager.Update() | 199 | aui_manager.Update() |
202 | 200 | ||
203 | - | ||
204 | - | ||
205 | def ShowContentPanel(self, evt_pubsub): | 201 | def ShowContentPanel(self, evt_pubsub): |
206 | print "ShowContentPanel" | 202 | print "ShowContentPanel" |
203 | + ps.Publisher().sendMessage("Set layout button full") | ||
207 | aui_manager = self.aui_manager | 204 | aui_manager = self.aui_manager |
208 | aui_manager.GetPane("Import").Show(0) | 205 | aui_manager.GetPane("Import").Show(0) |
209 | aui_manager.GetPane("Data").Show(1) | 206 | aui_manager.GetPane("Data").Show(1) |
@@ -760,6 +757,7 @@ class LayoutToolBar(wx.ToolBar): | @@ -760,6 +757,7 @@ class LayoutToolBar(wx.ToolBar): | ||
760 | self.parent = parent | 757 | self.parent = parent |
761 | self.__init_items() | 758 | self.__init_items() |
762 | self.__bind_events_wx() | 759 | self.__bind_events_wx() |
760 | + self.__bind_events() | ||
763 | self.ontool = False | 761 | self.ontool = False |
764 | 762 | ||
765 | def __init_items(self): | 763 | def __init_items(self): |
@@ -790,6 +788,12 @@ class LayoutToolBar(wx.ToolBar): | @@ -790,6 +788,12 @@ class LayoutToolBar(wx.ToolBar): | ||
790 | 788 | ||
791 | self.Realize() | 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 | def __bind_events_wx(self): | 797 | def __bind_events_wx(self): |
794 | self.Bind(wx.EVT_TOOL, self.OnClick) | 798 | self.Bind(wx.EVT_TOOL, self.OnClick) |
795 | 799 | ||
@@ -807,9 +811,8 @@ class LayoutToolBar(wx.ToolBar): | @@ -807,9 +811,8 @@ class LayoutToolBar(wx.ToolBar): | ||
807 | self.ToggleTool(item, False) | 811 | self.ToggleTool(item, False) |
808 | 812 | ||
809 | def OnTask(self): | 813 | def OnTask(self): |
810 | - | ||
811 | if self.ontool: | 814 | if self.ontool: |
812 | - self.SetToolNormalBitmap(ID_LAYOUT,self.BMP_WITHOUT_MENU ) | 815 | + self.SetToolNormalBitmap(ID_LAYOUT,self.BMP_WITHOUT_MENU) |
813 | ps.Publisher().sendMessage('Show task panel') | 816 | ps.Publisher().sendMessage('Show task panel') |
814 | self.SetToolShortHelp(ID_LAYOUT,"Hide task panel") | 817 | self.SetToolShortHelp(ID_LAYOUT,"Hide task panel") |
815 | self.ontool = False | 818 | self.ontool = False |
@@ -826,3 +829,8 @@ class LayoutToolBar(wx.ToolBar): | @@ -826,3 +829,8 @@ class LayoutToolBar(wx.ToolBar): | ||
826 | else: | 829 | else: |
827 | print "TODO: Send message so all textactors are hiden" | 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) |