Mercurial > hg > ltpda
diff m-toolbox/classes/@repogui/cb_tabChanged.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@repogui/cb_tabChanged.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,37 @@ +% CB_TABCHANGED callback executed when the user changes tabs. +% +% M Hewitson 22-09-08 +% +% $Id: cb_tabChanged.m,v 1.2 2009/07/29 16:19:38 nicola Exp $ +% + +function cb_tabChanged(varargin) + + myh = varargin{1}; + edata = varargin{2}; + mainfig = varargin{end}; + + % Set tab color + set(myh, 'BackgroundColor', mainfig.Gproperties.Gcol{edata.NewValue}); + % Set status color + set(findobj(mainfig.handle, 'Tag', 'RepoguiStatusLabel'), 'BackgroundColor', mainfig.Gproperties.Gcol{edata.NewValue}); + % Set mainfig color + set(mainfig.handle, 'Color', mainfig.Gproperties.Gcol{edata.NewValue}); + + treeHndl = get(findobj(gcf,'Tag','treeHandle'),'UserData'); + + switch edata.NewValue + case 2 + if ~isempty(treeHndl) + treeHndl.setVisible(true) + else + tree = repogui.cb_treegui(); + set(findobj(gcf,'Tag','treeHandle'),'UserData',tree); + end + otherwise + if ~isempty(treeHndl) + treeHndl.setVisible(false) + end + end + +end