diff m-toolbox/m/gui/ltpdv/callbacks/ltpdv_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/m/gui/ltpdv/callbacks/ltpdv_tabChanged.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,34 @@
+function ltpdv_tabChanged(varargin)
+
+myh   = varargin{1};
+edata = varargin{2};
+% get old tab
+ti = edata.OldValue;
+tabs = get(myh, 'Children');
+if ti > 0
+  oth  = tabs(ti);
+
+  % Find all java objects below oth
+  jobjs = findobj(oth, 'Type','uitabgroup');
+  set(jobjs, 'Visible', 'off')
+
+end
+
+if ti > 0
+  % get new tab
+  ti = edata.NewValue;
+  tabs = get(myh, 'Children');
+  nth  = tabs(ti);
+
+  % Find all java objects below oth
+  jobjs = findobj(nth, 'Type','uitabgroup');
+  set(jobjs, 'Visible', 'on');
+end
+drawnow
+
+h = findobj(myh, 'Tag', 'LTPDVimportTabPanel');
+if h~=myh
+  set(h, 'SelectedIndex', 1);
+end
+
+end