message.m

来自「matlab处理图像的一些基本方法。其中有一部分mex程序需要安装编译」· M 代码 · 共 79 行

M
79
字号
function message(msg, opt)%MESSAGE Display a message box%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu,    mark@alice.uoregon.edu%global Uibgcolor ssg edm qq dlgfqq=0;if nargin ==1  opt='NOWAIT';endssg=msg;if isempty(Uibgcolor)  Uibgcolor=[.55 .55 .55];endpos=[0 0 0 0];c=screencenter;pos(1)=c(1)-200;pos(2)=c(2)-90;pos(3)=400;pos(4)=180;if strcmp(upper(opt), 'WAIT')  ok_cbk='global qq;qq=1;';else  ok_cbk='global dlgf;close(dlgf);';enddlgf=figure('name', 'Message',...	'Resize', 'off',...	'NumberTitle', 'off',...	'Position', pos,...	'Color', Uibgcolor);edm=uicontrol('style', 'edit',...		'units', 'normalized',...		'pos', [0.03 0.45 0.94 0.5],...		'min', 1,...		'max', 10,...		'horiz', 'center',...		'string', msg,...		'Callback', 'global edm ssg;set(edm, ''string'', ssg);');uicontrol('style', 'frame',...		'units', 'normalized',...		'pos', [0.03 0.05 0.94 0.35],...		'background', Uibgcolor);okb=uicontrol('style', 'push',...		'units', 'normalized',...		'pos', [0.4 0.1 0.2 0.2],...		'horiz', 'center',...		'string', 'Ok',...		'Callback', ok_cbk);drawnow;if strcmp(upper(opt), 'WAIT')  while qq==0    if ~figflag('Message', 0);      return;    end  end  close(dlgf);endreturn;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?