Mercurial > hg > ltpda
diff m-toolbox/m/gui/gltpda/g_HelpButtonCallback.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/gltpda/g_HelpButtonCallback.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,22 @@ +function g_HelpButtonCallback(varargin) + % Whenever the user click the Help button + + global guiFontSize + + try + functionname = getappdata(0,'ltpda_currFunctionName'); + + [func,classes] = strtok(get(gcbh,'Tag')); + if strcmp(func,'method') + helptext = help([strtrim(classes),'/',functionname]); + else + helptext = help(functionname); + end + + helpFigure = figure('MenuBar','none','Toolbar','none','Name',strcat(functionname,' help'),'NumberTitle','off','Units','pixels','Position',[200,200,500,300],'Resize','on','ResizeFcn','refresh(gcf)','Color', get(0, 'defaultuicontrolbackgroundcolor')); + % Help text: + uicontrol('Parent',helpFigure,'Units','normalized','HorizontalAlignment','left','Position',[0 0 1 1],'FontSize',guiFontSize+1,'String',helptext,'Visible','on','max',100,'Style','edit'); + catch + disp('Something''s wrong with the creation of the Help figure. Please check ''g_HelpButtonCallback''') + end +end