dmsgfun.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:3k
源码类别:

波变换

开发平台:

Matlab

  1. function figdmsg = dmsgfun(option,in2,in3)
  2. %DMSGFUN  Message function for demos in the Wavelet Toolbox.
  3. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
  4. %   Last Revision: 12-Apr-2001.
  5. %   Copyright 1995-2004 The MathWorks, Inc.
  6. % $Revision: 1.17.4.2 $
  7. % Tag property of objects.
  8. %------------------------
  9. tag_dmsgfig = 'Wdmsgfig';
  10. tag_txtinfo = 'Axe_info';
  11. figdmsg = wfindobj('figure','tag',tag_dmsgfig);
  12. switch option
  13.     case 'create'
  14.         % Get Globals.
  15.         %-------------
  16.         if isempty(figdmsg)
  17. Def_Btn_Height = mextglob('get','Def_Btn_Height');
  18.             win_units  = 'pixels';
  19.             win_height = 6*Def_Btn_Height;
  20.             pos_win = zeros(1,4);
  21.             if nargin==3 ,  win_view = in3; else, win_view = NaN; end
  22.             Screen_Size = get(0,'ScreenSize');
  23. defFigPos = get(0,'DefaultfigurePosition');
  24.             if ishandle(win_view)
  25.                 old_u = get(win_view,'units');
  26.                 set(win_view,'units',win_units);
  27.                 pos_call_win = get(win_view,'Position');
  28. win_width = 4.5*defFigPos(3)/5;
  29.                 xleft = pos_call_win(1)+(pos_call_win(3)-win_width)/4;
  30.                 set(win_view,'units',old_u);
  31.                 pos_win = [xleft, pos_call_win(2), win_width, win_height];
  32.             else
  33.                 win_width = defFigPos(3);
  34.                 pos_win = [ Screen_Size(3)-5-win_width ,...
  35.                             0                          ,...
  36.                             win_width                  ,...
  37.                             win_height                  ...
  38.                             ];
  39.             end
  40. % if Screen_Size(4)<800 , pos_win(2) = 20; end
  41. axe_col = 'w'; 
  42.             figdmsg = colordef('new','none');
  43.             set(figdmsg,...
  44.                     'MenuBar','none',...
  45.                     'Name','Information window',...
  46.                     'Visible','off',...
  47.                     'Unit',win_units,...
  48.                     'Position',pos_win,...
  49.                     'Color',axe_col,...
  50.                     'NumberTitle','off',...
  51.                     'Tag',tag_dmsgfig...
  52.                     );
  53. bord  = 10;
  54.             p_text = [bord bord/5 win_width-2*bord win_height-2*bord/5];
  55.             txt_Hdl = uicontrol(...
  56.                     'Parent',figdmsg,    ...
  57.                     'Style','edit',      ...
  58.                     'Visible','off',     ...
  59.                     'Units',win_units,   ...
  60.                     'Position',p_text,   ...
  61. 'FontWeight','bold', ...
  62. 'FontSize',8,        ...
  63. 'Max',40,            ...
  64. 'HorizontalAlignment','left',...
  65.                     'BackgroundColor',[1 1 1],   ...
  66. 'ForegroundColor',[0 0 0],   ...
  67.                     'Tag',tag_txtinfo    ...
  68.                     );
  69.             set([figdmsg,txt_Hdl],'units','normalized','Visible','on');
  70.             set(figdmsg,'Name',['Message window']);
  71.         else
  72.             hidegui(figdmsg,'on');
  73.             txt_Hdl = findobj(figdmsg,'Tag',tag_txtinfo);
  74.             figure(figdmsg);
  75.         end
  76. set(txt_Hdl,'String',in2);
  77.         hidegui(figdmsg,'off');
  78.     case 'close'
  79.         delete(figdmsg);
  80. end