⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rri_wait_box.m

📁 绝对经典,老外制作的功能强大的matlab实现PLS_TOOBOX
💻 M
字号:
%  Create a waitbox for slow processing
%
%  Usage:
%
%     old_pointer = get(gcbf,'Pointer');
%     set(gcbf,'Pointer','watch');
%
%     h = rri_wait_box(msg, [Width Height], title);
%
%     ...
%
%     set(gcbf,'Pointer',old_pointer);
%     delete(h);
%
%  Example:
%
%     old_pointer = get(gcbf,'Pointer');
%     set(gcbf,'Pointer','watch');
%
%     msg = 'Loading PLS results ...    Please wait!';
%     h = rri_wait_box(msg, [0.5 0.1], 'Loading PLS results');
%
%     ...
%
%     set(gcbf,'Pointer',old_pointer);
%     delete(h);
%

%  Created by Wilkin
%  Modified by Jimmy
%
%---------------------------------------------------------------
function h0 = rri_wait_box(varargin);

   Message = varargin{1};
   DiagWH = varargin{2};

   if nargin > 2
      tit = varargin{3};
   else
      tit = '';
   end

   diag_w = DiagWH(1);
   diag_h = DiagWH(2);
   diag_x = (1 - diag_w)/2;
   diag_y = (1 - diag_h)/2;

   diag_pos = [diag_x diag_y diag_w diag_h];
   
   h0 = figure('Units','normal', ...
                'Menubar', 'none', ...
                'Resize', 'off', ...
                'NumberTitle', 'off', ...
                'WindowStyle', 'normal', ...
		'Color', [0.8 0.8 0.8], ...
                'Position', diag_pos, ...
		'Pointer','watch', ...
                'Name', tit, ...
                'Tag', 'WaitDialog');

   x = 0.05;
   y = 0.1;
   w = 0.9;
   h = 0.6;

   pos = [x y w h];

   h1 = uicontrol('Parent',h0, ...
		'unit','normal', ...
   		'Position', pos, ...
		'Background', [0.8 0.8 0.8], ...
   		'Style', 'text', ...	
		'fontunit','point', ...
   		'FontSize', 14, ...
   		'String', Message);

%                'fontunit','normal', ...
%                'FontSize', 0.35, ...
%   	         'FontWeight', 'bold', ...

   drawnow;

   return;					% rri_wait_box

⌨️ 快捷键说明

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