Commit aa1e90e2f648f31efc0b46fa759f1d8d07e582cd
1 parent
93778ed4
Exists in
master
and in
6 other branches
ENH: Toolbar icon for showing/hiding tasks
Showing
3 changed files
with
17 additions
and
22 deletions
Show diff stats
.gitattributes
.pydevproject
... | ... | @@ -1,10 +0,0 @@ |
1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | -<?eclipse-pydev version="1.0"?> | |
3 | - | |
4 | -<pydev_project> | |
5 | -<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> | |
6 | -<path>/InVesalius3/src</path> | |
7 | -</pydev_pathproperty> | |
8 | -<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property> | |
9 | -<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> | |
10 | -</pydev_project> |
invesalius/gui/frame.py
... | ... | @@ -674,29 +674,28 @@ class LayoutToolBar(wx.ToolBar): |
674 | 674 | self.parent = parent |
675 | 675 | self.__init_items() |
676 | 676 | self.__bind_events_wx() |
677 | + self.ontool = False | |
677 | 678 | |
678 | 679 | def __init_items(self): |
679 | 680 | |
680 | 681 | if sys.platform == 'darwin': |
681 | - BMP_WITHOUT_MENU =\ | |
682 | + self.BMP_WITHOUT_MENU =\ | |
682 | 683 | wx.Bitmap(os.path.join(const.ICON_DIR, |
683 | 684 | "layout_data_only_original.gif"), |
684 | 685 | wx.BITMAP_TYPE_GIF) |
685 | - BMP_WITH_MENU = wx.Bitmap(os.path.join(const.ICON_DIR, | |
686 | + self.BMP_WITH_MENU = wx.Bitmap(os.path.join(const.ICON_DIR, | |
686 | 687 | "layout_full_original.gif"), |
687 | 688 | wx.BITMAP_TYPE_GIF) |
688 | 689 | |
689 | 690 | else: |
690 | - BMP_WITHOUT_MENU = wx.Bitmap(os.path.join(const.ICON_DIR, | |
691 | + self.BMP_WITHOUT_MENU = wx.Bitmap(os.path.join(const.ICON_DIR, | |
691 | 692 | "layout_data_only.gif"), |
692 | 693 | wx.BITMAP_TYPE_GIF) |
693 | - BMP_WITH_MENU = wx.Bitmap(os.path.join(const.ICON_DIR, | |
694 | + self.BMP_WITH_MENU = wx.Bitmap(os.path.join(const.ICON_DIR, | |
694 | 695 | "layout_full.gif"), |
695 | 696 | wx.BITMAP_TYPE_GIF) |
696 | 697 | |
697 | - self.AddLabelTool(101, "Full layout", BMP_WITHOUT_MENU, kind = wx.ITEM_RADIO) | |
698 | - self.AddLabelTool(102, "Original layout", BMP_WITH_MENU, kind = wx.ITEM_RADIO) | |
699 | - self.ToggleTool(102, True) | |
698 | + self.AddLabelTool(101, "",bitmap=self.BMP_WITHOUT_MENU, shortHelp= "Hide task panel") | |
700 | 699 | |
701 | 700 | self.Realize() |
702 | 701 | |
... | ... | @@ -704,8 +703,15 @@ class LayoutToolBar(wx.ToolBar): |
704 | 703 | self.Bind(wx.EVT_TOOL, self.OnClick) |
705 | 704 | |
706 | 705 | def OnClick(self, evt): |
707 | - | |
708 | - if (evt.GetId() == 101): | |
709 | - ps.Publisher().sendMessage('Hide task panel') | |
710 | - else: | |
706 | + if self.ontool: | |
707 | + self.SetToolNormalBitmap(101,self.BMP_WITHOUT_MENU ) | |
711 | 708 | ps.Publisher().sendMessage('Show task panel') |
709 | + self.SetToolShortHelp(101,"Hide task panel") | |
710 | + self.ontool = False | |
711 | + else: | |
712 | + self.bitmap = self.BMP_WITH_MENU | |
713 | + self.SetToolNormalBitmap(101,self.BMP_WITH_MENU) | |
714 | + ps.Publisher().sendMessage('Hide task panel') | |
715 | + self.SetToolShortHelp(101, "Show task panel") | |
716 | + self.ontool = True | |
717 | + | ... | ... |