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

波变换

开发平台:

Matlab

  1. function varargout = dw1ddisp(option,win_dw1dtool,in3,in4)
  2. %DW1DDISP Discrete wavelet 1-D display mode options.
  3. %   DW1DDISP(OPTION,WIN_DW1DTOOL,IN3,IN4)
  4. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
  5. %   Last Revision: 10-Mar-2004.
  6. %   Copyright 1995-2004 The MathWorks, Inc.
  7. %   $Revision: 1.23.4.1 $
  8. % MemBloc1 of stored values.
  9. %---------------------------
  10. n_param_anal   = 'DWAn1d_Par_Anal';
  11. ind_sig_name   = 1;
  12. ind_sig_size   = 2;
  13. ind_wav_name   = 3;
  14. ind_lev_anal   = 4;
  15. ind_axe_ref    = 5;
  16. ind_act_option = 6;
  17. ind_ssig_type  = 7;
  18. ind_thr_val    = 8;
  19. nb1_stored     = 8;
  20. % Tag property of objects.
  21. %-------------------------
  22. tag_pop_viewm   = 'View_Mode';
  23. tag_pus_dispopt = 'Pus_Options';
  24. tag_valapp_scr  = 'ValApp_Scr';
  25. tag_valdet_scr  = 'ValDet_Scr';
  26. tag_win_disp    = 'DispOpt1D';
  27. % Local Tag property of objects.
  28. %-------------------------------
  29. tag_app_on   = 'Chk_App';
  30. tag_s_app    = 'Chk_SA';
  31. tag_ss_app   = 'Chk_SSA';
  32. tag_app_num  = 'Chk_ANum';
  33. tag_det_on   = 'Chk_Det';
  34. tag_s_det    = 'Chk_SD';
  35. tag_ss_det   = 'Chk_SSD';
  36. tag_det_num  = 'Chk_DNum';
  37. tag_cfs_on   = 'Chk_Cfs';
  38. tag_txt_ccfs = 'Txt_CCfs';
  39. tag_pop_ccfs = 'Pop_CCfs';
  40. tag_app_txt  = 'App_Txt';
  41. tag_app_all  = 'App_All';
  42. tag_app_none = 'App_None';
  43. tag_det_txt  = 'Det_Txt';
  44. tag_det_all  = 'Det_All';
  45. tag_det_none = 'Det_None';
  46. children    = get(win_dw1dtool,'Children');
  47. uic_handles = findobj(children,'flat','type','uicontrol');
  48. switch option
  49.     case 'chk_sel'
  50.         % in3 = chk_value
  51.         % in4 = 'a' or 'd'
  52.         %------------------
  53.         chk_handles = findobj(uic_handles,'Style','checkbox');
  54.         chk         = findobj(chk_handles,'tag',in4);
  55.         set(chk,'Value',in3);
  56.         return
  57.     case 'app_on'
  58.         % in3 = num mode
  59.         %------------------
  60.         chk_handles = findobj(uic_handles,'Style','checkbox');
  61.         chk_on  = findobj(chk_handles,'tag',tag_app_on);
  62.         chk_sa  = findobj(chk_handles,'tag',tag_s_app);
  63.         chk_ssa = findobj(chk_handles,'tag',tag_ss_app);
  64.         if in3==4
  65.             pus_handles = findobj(uic_handles,'Style','pushbutton');
  66.             txt_handles = findobj(uic_handles,'Style','text');
  67.             pall    = findobj(pus_handles,'tag',tag_app_all);
  68.             pnone   = findobj(pus_handles,'tag',tag_app_none);
  69.             txt     = findobj(txt_handles,'tag',tag_app_txt);
  70.             chk_app = findobj(chk_handles,'tag',tag_app_num);
  71.         else
  72.             pall = [];  pnone = [];  txt = [];  chk_app = [];
  73.         end
  74.         if get(chk_on,'Value')==1 , vis = 'on'; else , vis = 'off'; end
  75.         set([chk_sa ; chk_ssa ; pall ; pnone ; txt ; chk_app],'Visible',vis);     
  76.         return
  77.     case 'det_on'
  78.         % in3 = num mode
  79.         %------------------
  80.         chk_handles = findobj(uic_handles,'Style','checkbox');
  81.         chk_on  = findobj(chk_handles,'tag',tag_det_on);
  82.         chk_sd  = findobj(chk_handles,'tag',tag_s_det);
  83.         chk_ssd = findobj(chk_handles,'tag',tag_ss_det);
  84.         if in3==4
  85.             pus_handles = findobj(uic_handles,'Style','pushbutton');
  86.             txt_handles = findobj(uic_handles,'Style','text');
  87.             pall    = findobj(pus_handles,'tag',tag_det_all);
  88.             pnone   = findobj(pus_handles,'tag',tag_det_none);
  89.             txt     = findobj(txt_handles,'tag',tag_det_txt);
  90.             chk_det = findobj(chk_handles,'tag',tag_det_num);
  91.         else
  92.             pall = [];  pnone = [];  txt = [];  chk_det = [];
  93.         end
  94.         if get(chk_on,'Value')==1 , vis = 'on'; else , vis = 'off'; end
  95.         set([chk_sd ; chk_ssd ; pall ; pnone ; txt ; chk_det],'Visible',vis);
  96.         return
  97.     case 'cfs_on'
  98.         chk_on = findobj(uic_handles,'tag',tag_cfs_on);
  99.         txt    = findobj(uic_handles,'tag',tag_txt_ccfs);
  100.         pop    = findobj(uic_handles,'tag',tag_pop_ccfs);
  101.         if get(chk_on,'Value')==1 , vis = 'on'; else , vis = 'off'; end
  102.         set([txt pop],'Visible',vis);
  103.         return
  104.     case 'ena_pop'
  105.         % in3 = flg_axe
  106.         pop_handles = findobj(uic_handles,'Style','popupmenu');
  107.         pop_app = findobj(pop_handles,'tag',tag_valapp_scr);
  108.         pop_det = findobj(pop_handles,'tag',tag_valdet_scr);
  109.         if in3(1)==1 , ena = 'on'; else , ena = 'off'; end
  110.         set(pop_app,'Enable',ena);
  111.         if in3(2)==1 , ena = 'on'; else , ena = 'off'; end
  112.         set(pop_det,'Enable',ena);
  113.         return
  114. end
  115.         
  116. pus_handles = findobj(uic_handles,'Style','pushbutton');
  117. pop_handles = findobj(uic_handles,'Style','popupmenu');
  118. pop_viewm   = findobj(pop_handles,'tag',tag_pop_viewm);
  119. num_mode    = get(pop_viewm,'Value');
  120. switch option
  121.     case 'create'
  122.         % Get Globals.
  123.         %-------------
  124.         [...
  125.         Def_Txt_Height,Def_Btn_Height,Def_Btn_Width,    ...
  126.         Pop_Min_Width,X_Graph_Ratio,X_Spacing,Y_Spacing,...
  127.         Def_TxtBkColor,Def_EdiBkColor,Def_FraBkColor,   ...
  128.         Def_UicFtWeight] = ...
  129.             mextglob('get',...
  130.                 'Def_Txt_Height','Def_Btn_Height','Def_Btn_Width',   ...
  131.                 'Pop_Min_Width','X_Graph_Ratio','X_Spacing','Y_Spacing', ...
  132.                 'Def_TxtBkColor','Def_EdiBkColor','Def_FraBkColor', ...
  133.                 'Def_UicFtWeight'                                   ...
  134.                 );
  135.         % Begin waiting.
  136.         %--------------
  137.         mousefrm(0,'watch');
  138.         win_units = 'pixels';
  139.         [nul,nul,win_height,win_width] = wfigmngr('figsizes');
  140.         old_units = get(win_dw1dtool,'Units');
  141.         set(win_dw1dtool,'Units','pixels');
  142.         pos_wcall = get(win_dw1dtool,'Position');
  143.         set(win_dw1dtool,'Units',old_units);
  144.         width0  = pos_wcall(3);
  145.         height0 = pos_wcall(4);
  146.         
  147.         % Resizing the Figure.
  148.         %---------------------
  149.         if win_height~=height0 , resize_win = 1; else , resize_win = 0; end;        
  150.         if resize_win & isappdata(0,'ResizeRatioWTBX_Fig')
  151.             RatScrPixPerInch = getappdata(0,'ResizeRatioWTBX_Fig');
  152.             win_height = pos_wcall(4);
  153.             win_width  = win_width*RatScrPixPerInch;
  154.         end
  155.         d_left = 10;
  156.         if pos_wcall(1)<win_width+d_left
  157.             x_left0 = pos_wcall(1)+pos_wcall(3)-win_width;
  158.         else
  159.             x_left0 = pos_wcall(1)-win_width-d_left;
  160.         end
  161.         pos_win = [x_left0 , pos_wcall(2) , win_width , win_height];
  162.         
  163.         win_dw1d_more  = wfindobj('figure','tag',tag_win_disp);
  164.         fig_name = ['More Display Options : Fig.' sprintf('%.0f',win_dw1dtool)];
  165.         if ~isempty(win_dw1d_more)
  166.             old_win = get(win_dw1d_more,'Userdata');
  167.             if old_win~=win_dw1dtool
  168.                 msg = ['Fig. ' sprintf('%.0f',old_win) ' : ' ...
  169.                         'Keep Display Options ?' ];
  170.                 % Test for keeping display options.
  171.                 %----------------------------------
  172.                 new = wwaitans(old_win,msg,1,'cancel');
  173.                 if new==-1 , return; end
  174.                 if new==0  , dw1ddisp('cancel',old_win,win_dw1d_more); end
  175.                 dw1dutil('enable',old_win,'end_more_disp');
  176.                 figure(win_dw1dtool);  
  177.             end
  178.         end
  179.         dw1dutil('enable',win_dw1dtool,'more_disp');
  180.         if ~isempty(win_dw1d_more)
  181.             hdl_in  = findobj(win_dw1d_more,'type','uicontrol');
  182.             delete(hdl_in);
  183.             set(win_dw1d_more,'Name',fig_name,'Userdata',win_dw1dtool);
  184.         else
  185.             win_dw1d_more = colordef('new','none');
  186.             set(win_dw1d_more,...
  187.                     'MenuBar','none',...
  188.                     'DefaultUicontrolBackgroundcolor', Def_FraBkColor,...
  189.                     'DefaultUicontrolFontWeight',Def_UicFtWeight,...
  190.                     'visible','on',         ...
  191.                     'Unit',win_units,       ...
  192.                     'NumberTitle','off',    ...
  193.                     'Name',fig_name,        ...
  194.                     'Position',pos_win,     ...
  195.                     'Color',Def_FraBkColor, ...
  196.                     'BackingStore','off',   ...
  197.                     'Userdata',win_dw1dtool,...
  198.                     'Tag',tag_win_disp      ...
  199.                     );
  200.             wfigmngr('extfig',win_dw1d_more,'ExtFig_More');
  201.             set(win_dw1d_more,'Renderer','painters','RendererMode','auto')
  202. % Add Help for Tool.
  203. %------------------
  204. wfighelp('addHelpTool',...
  205. win_dw1d_more,'More Display Options','DW1D_MOREDISP');
  206.         end
  207. if nargout>0 , varargout{1} = win_dw1d_more; end
  208. % Select the figure.
  209. %-------------------
  210.         hidegui(win_dw1d_more,'on')
  211.         figure(win_dw1d_more);
  212.         % Borders and double borders.
  213.         %----------------------------
  214.         dx = X_Spacing;  dx2 = 2*dx;
  215.         dy = Y_Spacing;  dy2 = 2*dy;
  216.         d_txt = (Def_Btn_Height-Def_Txt_Height);
  217.         % Position property of objects.
  218.         %------------------------------
  219.         Screen_Size = get(0,'Screensize');
  220.         hpush = 3*Def_Btn_Height/2;
  221.         if Screen_Size(4)<600
  222.             Level_Anal = wmemtool('rmb',win_dw1dtool,n_param_anal,ind_lev_anal);
  223.             if Level_Anal>6 & (num_mode==3 | num_mode==4)
  224.                 hpush = Def_Btn_Height;
  225.             end
  226.         end
  227.         x_left0 = 0;
  228.         ylow    = win_height-Def_Btn_Height-dy2;
  229.         pos_txt_mname = [dx2, ylow, win_width-2*dx2,Def_Btn_Height];
  230.         push_width = (win_width-3*dx2)/2;
  231.         xleft      = (win_width-7*push_width/4)/2;
  232.         pos_close  = [xleft, Def_Btn_Height,7*push_width/4, hpush];
  233.         xleft = pos_close(1);
  234.         ylow  = pos_close(2)+pos_close(4)+dy2;
  235.         width = (pos_close(3)-dx2)/2;
  236.         pos_apply  = [ xleft ,  ylow , width , hpush];
  237.         xleft = pos_apply(1)+pos_apply(3)+dx2;
  238.         pos_cancel = [ xleft ,  ylow , width , hpush];
  239.         % String property of objects.
  240.         %----------------------------
  241.         str_mname  = get(pop_viewm,'String');
  242.         str_mname  = [deblank(str_mname(num_mode,:)) ' Options'];
  243.         str_apply  = 'Apply';
  244.         str_cancel = 'Cancel';
  245.         str_close  = 'Close';
  246.         str_cfs_on = 'Show Coefs. Axes';
  247.         switch num_mode
  248.             case {1,3,4} 
  249.               str_txt_ccfs = 'Coloration Mode';
  250.               str_pop_ccfs = [ ...
  251.                                'init + by level + abs     ' ;  ...
  252.                                'init + by level           ' ;  ...
  253.                                'init + all levels + abs   ' ;  ...
  254.                                'init + all levels         ' ;  ...
  255.                                'current + by level + abs  ' ;  ...
  256.                                'current + by level        ' ;  ...
  257.                                'current + all levels + abs' ;  ...
  258.                                'current + all levels      '    ...
  259.                                 ];
  260.             case 6
  261.               str_txt_ccfs = 'Coefficients Values';
  262.               str_pop_ccfs = ['Absolute values' ;'Current values '];
  263.         end
  264.         opt_act = wmemtool('rmb',win_dw1dtool,n_param_anal,ind_act_option);
  265.         if strcmp(opt_act,'synt')
  266.             ini_str = 'Ori. Synth. Sig.';
  267.         else
  268.             ini_str = 'Signal';
  269.         end
  270.         str_s_app = sprintf('Show %s', xlate(ini_str));
  271.         ss_type = wmemtool('rmb',win_dw1dtool,n_param_anal,ind_ssig_type);
  272.         if     ss_type=='ss', str_ss_app = 'Synth.';
  273.         elseif ss_type=='ds', str_ss_app = 'Deno.';
  274.         elseif ss_type=='cs', str_ss_app = 'Comp.';
  275.         end
  276.         str_ss_app = sprintf('Show %s Signal',xlate(str_ss_app));
  277.         str_s_det  = str_s_app;
  278.         str_ss_det = str_ss_app;
  279.         switch num_mode
  280.             case {1,4,6}
  281.               str_app_on = 'Show Approx. Axes';
  282.               str_det_on = 'Show Detail Axes';
  283.             case 3
  284.               str_app_on = 'Show Left Signal Axes';
  285.               str_det_on = 'Show Right Signal Axes';
  286.         end
  287.         if (num_mode==3)
  288.             str_app_txt = 'Approximations Axes';
  289.             str_det_txt = 'Details Axes';
  290.         elseif (num_mode==4)
  291.             str_app_txt = 'Approximation levels';
  292.             str_det_txt = 'Detail levels';
  293.         end
  294.         if (num_mode==3) | (num_mode==4)
  295.             str_app_all  = 'All';
  296.             str_app_none = 'None';
  297.             str_det_all  = 'All';
  298.             str_det_none = 'None';
  299.         end
  300.         % Callback property of objects.
  301.         %------------------------------
  302.         action      = '';
  303.         str_wincall = sprintf('%.0f',win_dw1dtool);
  304.         str_winloc  = sprintf('%.0f',win_dw1d_more);
  305.         str_numm    = sprintf('%.0f',num_mode);
  306.         cba_close   = [mfilename '(''close'',' str_wincall ',' str_winloc ');'];
  307.         cba_apply   = [mfilename '(''apply'',' str_wincall ',' str_winloc ');'];
  308.         cba_cancel  = [mfilename '(''cancel'',' str_wincall ',' str_winloc ');'];
  309.         cba_app_on  = [mfilename '(''app_on'',' str_winloc ',' str_numm ');'];
  310.         cba_det_on  = [mfilename '(''det_on'',' str_winloc ',' str_numm ');'];
  311.         cba_app_all = [mfilename '(''chk_sel'',' str_winloc ...
  312.                                      ',1,''' tag_app_num ''');'];
  313.         cba_app_none = [mfilename '(''chk_sel'',' str_winloc ...
  314.                                      ',0,''' tag_app_num ''');'];
  315.         cba_det_all  = [mfilename '(''chk_sel'',' str_winloc ...
  316.                                       ',1,''' tag_det_num ''');'];
  317.         cba_det_none = [mfilename '(''chk_sel'',' str_winloc ...
  318.                                      ',0,''' tag_det_num ''');'];
  319.         cba_cfs_on   = [mfilename '(''cfs_on'',' str_winloc ');'];
  320.         % Properties of HG.
  321.         %------------------
  322.         comFigProp = {'Parent',win_dw1d_more,'Unit',win_units};
  323.         comPusProp = {comFigProp{:},'Style','Pushbutton'};
  324.         comChkProp = {comFigProp{:}, ...
  325.            'Style','Checkbox','HorizontalAlignment','left'};
  326.         comTxtProp = {comFigProp{:}, ...
  327.            'Style','Text','Backgroundcolor',Def_FraBkColor};
  328.         txt_mname  = uicontrol(...
  329.                                comFigProp{:},         ...
  330.                                'Style','Edit',        ...
  331.                                'enable','Inactive',   ...
  332.                                'HorizontalAlignment','center', ...
  333.                                'Position',pos_txt_mname,       ...
  334.                                'String',str_mname,             ...
  335.                                'Backgroundcolor',Def_TxtBkColor...
  336.                                );
  337.         pus_apply  = uicontrol(...
  338.                                comPusProp{:}, ...
  339.                                'Position',pos_apply, ...
  340.                                'String',xlate(str_apply),   ...
  341.                                'Interruptible','On', ...
  342.                                'Callback',cba_apply  ...
  343.                                );
  344.         pus_cancel = uicontrol(...
  345.                                comPusProp{:}, ...
  346.                                'Position',pos_cancel,...
  347.                                'String',xlate(str_cancel),  ...
  348.                                'Interruptible','On', ...
  349.                                'Callback',cba_cancel ...
  350.                                );
  351.         pus_close  = uicontrol(...
  352.                                comPusProp{:}, ...
  353.                                'Position',pos_close,   ...
  354.                                'String',xlate(str_close),     ...
  355.                                'Interruptible','On',   ...
  356.                                'ToolTipString',xlate('Close window'), ...
  357.                                'Callback',cba_close    ...
  358.                                );
  359.         % Prevent OS closing (04-Sep-97)
  360.         set(win_dw1d_more,'CloseRequestFcn',cba_close);
  361.         ylow = pos_txt_mname(2);
  362.         switch num_mode
  363.             case {1,6}
  364.                 %%%%%%%%%%-------- Mode : "Show and Scroll" ------%%%%%%%%%%
  365.                 [flg_axe,flg_sa,flg_app,flg_sd,flg_det,ccfs_m] = ...
  366.                                 dw1dvmod('get_vm',win_dw1dtool,num_mode);
  367.                 val_flg = [flg_axe(1) flg_sa flg_axe(2) flg_sd];
  368.                 vis_str = getonoff([1 flg_axe([1 1]) 1 flg_axe([2 2])]);
  369.                 val_cfs = flg_axe(3);
  370.                 if val_cfs==0
  371.                     vis_txt_ccfs = 'off';   vis_pop_ccfs = 'off';
  372.                 else
  373.                     vis_txt_ccfs = 'on';    vis_pop_ccfs = 'on';
  374.                 end
  375.                 % Position property of objects.
  376.                 %------------------------------
  377.                 ylow       = ylow-Def_Btn_Height-3*dy2;
  378.                 wid1       = 2*(Def_Btn_Width+dx2);
  379.                 wid2       = 2*Def_Btn_Width+dx2;
  380.                 pos_app_on = [2*dx2, ylow, wid1, Def_Btn_Height];
  381.                 ylow       = ylow-Def_Btn_Height-dy;
  382.                 pos_s_app  = [3*dx2, ylow, wid2, Def_Btn_Height];
  383.                 ylow       = ylow-Def_Btn_Height;
  384.                 pos_ss_app = [3*dx2, ylow, wid2, Def_Btn_Height];
  385.                 ylow       = ylow-Def_Btn_Height-3*dy2;
  386.                 pos_det_on = [2*dx2, ylow, wid1, Def_Btn_Height];
  387.                 ylow       = ylow-Def_Btn_Height-dy;
  388.                 pos_s_det  = [3*dx2, ylow, wid2, Def_Btn_Height];
  389.                 ylow       = ylow-Def_Btn_Height;
  390.                 pos_ss_det = [3*dx2, ylow, wid2, Def_Btn_Height];
  391.                 ylow       = ylow-Def_Btn_Height-3*dy2;
  392.                 pos_cfs_on = [2*dx2, ylow, wid1, Def_Btn_Height];
  393.                 ylow       = ylow-Def_Btn_Height-dy2;
  394.                 pos_txt_ccfs= [2*dx2, ylow, wid1, Def_Btn_Height];
  395.                 ylow        = ylow-Def_Btn_Height;
  396.                 pos_pop_ccfs= [2*dx2, ylow, wid1, Def_Btn_Height];
  397.                 chk_app_on = uicontrol(...
  398.                                    comChkProp{:}, ...
  399.                                    'Position',pos_app_on,  ...
  400.                                    'String',str_app_on,    ...
  401.                                    'Visible',vis_str(1,:), ...
  402.                                    'Value',val_flg(1),     ...
  403.                                    'Tag',tag_app_on,       ...
  404.                                    'Callback',cba_app_on   ...
  405.                                    );
  406.                 chk_s_app  = uicontrol(...
  407.                                    comChkProp{:}, ...
  408.                                    'Position',pos_s_app,   ...
  409.                                    'String',str_s_app,     ...
  410.                                    'Visible',vis_str(2,:), ...
  411.                                    'Value',val_flg(2),     ...
  412.                                    'Tag',tag_s_app         ...
  413.                                    );
  414.                 chk_ss_app = uicontrol(...
  415.                                    comChkProp{:}, ...
  416.                                    'Position',pos_ss_app,  ...
  417.                                    'String',str_ss_app,    ...
  418.                                    'Visible',vis_str(3,:), ...
  419.                                    'Value',val_flg(3),     ...
  420.                                    'Tag',tag_ss_app        ...
  421.                                    );
  422.                 chk_det_on = uicontrol(...
  423.                                    comChkProp{:}, ...
  424.                                    'Position',pos_det_on,  ...
  425.                                    'String',str_det_on,    ...
  426.                                    'Visible',vis_str(4,:), ...
  427.                                    'Value',val_flg(4),     ...
  428.                                    'Tag',tag_det_on,       ...
  429.                                    'Callback',cba_det_on   ...
  430.                                    );
  431.                 chk_s_det  = uicontrol(...
  432.                                    comChkProp{:}, ...
  433.                                    'Position',pos_s_det,   ...
  434.                                    'String',str_s_det,     ...
  435.                                    'Visible',vis_str(5,:), ...
  436.                                    'Value',val_flg(5),     ...
  437.                                    'Tag',tag_s_det ...
  438.                                    );
  439.                 chk_ss_det = uicontrol(...
  440.                                    comChkProp{:}, ...
  441.                                    'Position',pos_ss_det,  ...
  442.                                    'String',str_ss_det,    ...
  443.                                    'Visible',vis_str(6,:), ...
  444.                                    'Value',val_flg(6),     ...
  445.                                    'Tag',tag_ss_det        ...
  446.                                    );
  447.                 dw1ddisp('ena_pop',win_dw1dtool,flg_axe(1:2));
  448.             case 2
  449.                 %%%%%%%%%%---- Mode : "Full Decomposition" ----%%%%%%%%%%
  450.             case 3
  451.                 %%%%%%%%%%---------- Mode : "Separate" --------%%%%%%%%%%
  452.                 Level_Anal = wmemtool('rmb',win_dw1dtool,n_param_anal,...
  453.                                                         ind_lev_anal);
  454.                 nb_inline = 3;
  455.                 nb_lines  = max(2,ceil(Level_Anal/nb_inline))+1;
  456.                 nb        = nb_inline+1;
  457.                 if Level_Anal > 6
  458.                     btn_height = 4*Def_Btn_Height/5;
  459.                     if Screen_Size(4)<600
  460.                         chk_height = Def_Btn_Height;
  461.                     else
  462.                         chk_height = btn_height;
  463.                     end
  464.                 else
  465.                     btn_height = Def_Btn_Height;
  466.                     chk_height = Def_Btn_Height;
  467.                 end
  468.                 [flg_axe,sa_flg,app_flg,sd_flg,det_flg,ccfs_m] = ...
  469.                                 dw1dvmod('get_vm',win_dw1dtool,num_mode);
  470.                 l_s_flg = flg_axe(1);
  471.                 r_s_flg = flg_axe(2);   
  472.                 val_cfs = flg_axe(3);
  473.                 val_flg = [l_s_flg , sa_flg , r_s_flg , sd_flg];
  474.                 vis_str = getonoff([1 l_s_flg l_s_flg 1 r_s_flg r_s_flg ]);
  475.                 if val_cfs==0
  476.                     vis_txt_ccfs = 'off'; vis_pop_ccfs = 'off';
  477.                 else
  478.                     vis_txt_ccfs = 'on';  vis_pop_ccfs = 'on';
  479.                 end
  480.                 % Position property of objects.
  481.                 %------------------------------
  482.                 ylow         = ylow-Def_Btn_Height-3*dy2;
  483.                 w_uic        = 2*(Def_Btn_Width+1.5*dx2);
  484.                 pos_app_on   = [dx2, ylow, w_uic, Def_Btn_Height];
  485.                 ylow         = ylow-Def_Btn_Height-dy;
  486.                 w_uic        = 2*Def_Btn_Width+dx2;
  487.                 pos_s_app    = [3*dx2, ylow, w_uic, Def_Btn_Height];
  488.                 ylow         = ylow-Def_Btn_Height;
  489.                 pos_ss_app   = [3*dx2, ylow, w_uic, Def_Btn_Height];
  490.                 px           = x_left0+(win_width-3*push_width/2)/2;
  491.                 ylow         = ylow-3*Def_Btn_Height/2;
  492.                 w_uic        = 3*push_width/2;
  493.                 pos_app_txt  = [px, ylow+d_txt/2, w_uic, Def_Txt_Height];
  494.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  495.                 xbtchk0      = x_left0+Def_Btn_Width/2+2*wx;
  496.                 ybtchk0      = pos_app_txt(2)-Def_Btn_Height;
  497.                 ylow         = ybtchk0;
  498.                 w_uic        = Def_Btn_Width/2;
  499.                 pos_app_all  = [x_left0+wx, ylow, w_uic, btn_height];
  500.                 ylow         = ylow-6*btn_height/5;
  501.                 pos_app_none = [pos_app_all(1), ylow, w_uic, btn_height];
  502.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  503.                 xbtchk       = xbtchk0;
  504.                 ybtchk       = ybtchk0;
  505.                 pos_chk_app  = zeros(Level_Anal,4);
  506.                 for i=1:Level_Anal
  507.                     pos_chk_app(i,:) = ....
  508.                         [xbtchk ybtchk Def_Btn_Width/2 chk_height];
  509.                     if rem(i,nb_inline)==0
  510.                         xbtchk = xbtchk0;
  511.                         ybtchk = ybtchk-6*btn_height/5;
  512.                     else
  513.                         xbtchk = xbtchk+Def_Btn_Width/2+wx;
  514.                     end
  515.                 end
  516.                 mi = min(pos_app_none(2),pos_chk_app(Level_Anal,2));
  517.                 ylow         = mi-Def_Btn_Height-2*dy2;
  518.                 w_uic        = 2*(Def_Btn_Width+1.5*dx2);
  519.                 pos_det_on   = [dx2, ylow, w_uic, Def_Btn_Height];
  520.                 ylow         = ylow-Def_Btn_Height-dy;
  521.                 w_uic        = 2*Def_Btn_Width+dx2;
  522.                 pos_s_det    = [3*dx2, ylow, w_uic, Def_Btn_Height];
  523.                 ylow         = ylow-Def_Btn_Height;
  524.                 pos_ss_det   = [3*dx2, ylow, w_uic, Def_Btn_Height];
  525.                 px           = x_left0+(win_width-3*push_width/2)/2;
  526.                 ylow         = ylow-3*Def_Btn_Height/2;
  527.                 w_uic        = 3*push_width/2;
  528.                 pos_det_txt  = [px, ylow+d_txt/2, w_uic, Def_Txt_Height];
  529.                 xbtchk0      = x_left0+Def_Btn_Width/2+2*wx;
  530.                 ybtchk0      = pos_det_txt(2)-Def_Btn_Height;
  531.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  532.                 ylow         = ybtchk0;
  533.                 w_uic        = Def_Btn_Width/2;
  534.                 pos_det_all  = [x_left0+wx, ylow, w_uic, btn_height];
  535.                 ylow         = ylow-6*btn_height/5;
  536.                 pos_det_none = [pos_det_all(1), ylow, w_uic, btn_height];
  537.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  538.                 xbtchk       = xbtchk0;
  539.                 ybtchk       = ybtchk0;
  540.                 pos_chk_det  = zeros(Level_Anal,4);
  541.                 for i=1:Level_Anal
  542.                     pos_chk_det(i,:) = ...
  543.                         [xbtchk ybtchk Def_Btn_Width/2 chk_height];
  544.                     if rem(i,nb_inline)==0
  545.                         xbtchk = xbtchk0;
  546.                         ybtchk = ybtchk-6*btn_height/5;
  547.                     else
  548.                         xbtchk = xbtchk+Def_Btn_Width/2+wx;
  549.                     end
  550.                 end
  551.                 mi = min(pos_det_none(2),pos_chk_det(Level_Anal,2));
  552.                 ylow         = mi-Def_Btn_Height-2*dy2;
  553.                 w_uic        = 2*(Def_Btn_Width+1.5*dx2);
  554.                 pos_cfs_on   = [dx2, ylow, w_uic, Def_Btn_Height];
  555.                 ylow         = ylow-Def_Btn_Height-dy;
  556.                 w_uic        = 2*(Def_Btn_Width+dx2);
  557.                 pos_txt_ccfs = [2*dx2, ylow+d_txt/2, w_uic, Def_Txt_Height];
  558.                 ylow         = ylow-Def_Btn_Height;
  559.                 pos_pop_ccfs = [2*dx2, ylow+d_txt/2, w_uic, Def_Btn_Height];
  560.                 chk_app_on   = uicontrol(...
  561.                                      comChkProp{:}, ...
  562.                                      'Position',pos_app_on,  ...
  563.                                      'String',str_app_on,    ...
  564.                                      'Visible',vis_str(1,:), ...
  565.                                      'Value',val_flg(1),     ...
  566.                                      'Tag',tag_app_on,       ...
  567.                                      'Callback',cba_app_on   ...
  568.                                      );
  569.                 chk_s_app    = uicontrol(...
  570.                                      comChkProp{:}, ...
  571.                                      'Position',pos_s_app,   ...
  572.                                      'String',str_s_app,     ...
  573.                                      'Visible',vis_str(2,:), ...
  574.                                      'Value',val_flg(2),     ...
  575.                                      'Tag',tag_s_app         ...
  576.                                      );
  577.                 chk_ss_app   = uicontrol(...
  578.                                      comChkProp{:}, ...
  579.                                      'Unit',win_units,       ...
  580.                                      'Position',pos_ss_app,  ...
  581.                                      'String',str_ss_app,    ...
  582.                                      'Visible',vis_str(3,:), ...
  583.                                      'Value',val_flg(3),     ...
  584.                                      'Tag',tag_ss_app        ...
  585.                                      );
  586.                 txt_app_txt  = uicontrol(...
  587.                                      comTxtProp{:}, ...
  588.                                      'Position',pos_app_txt,...
  589.                                      'String',str_app_txt,...
  590.                                      'HorizontalAlignment','center', ...
  591.                                      'Visible','on',...
  592.                                      'Tag',tag_app_txt...
  593.                                      );
  594.                 pus_app_all  = uicontrol(...
  595.                                      comPusProp{:}, ...
  596.                                      'Position',pos_app_all,...
  597.                                      'String',xlate(str_app_all),...
  598.                                      'Visible','on',...
  599.                                      'Tag',tag_app_all,...
  600.                                      'Callback',cba_app_all  ...
  601.                                      );
  602.                 pus_app_none = uicontrol(...
  603.                                      comPusProp{:}, ...
  604.                                      'Position',pos_app_none,...
  605.                                      'String',xlate(str_app_none),...
  606.                                      'Visible','on',...
  607.                                      'Tag',tag_app_none,...
  608.                                      'Callback',cba_app_none ...
  609.                                      );
  610.                 Chk_App_Lst  = zeros(Level_Anal,1);
  611.                 for i=1:Level_Anal
  612.                     Chk_App_Lst(i) = uicontrol(...
  613.                                       comChkProp{:},     ...
  614.                                       'Position',pos_chk_app(i,:),...
  615.                                       'Value',app_flg(i),         ...
  616.                                       'String',sprintf('%.0f',i), ...
  617.                                       'Visible','on',             ...
  618.                                       'Userdata',i,               ...
  619.                                       'Tag',tag_app_num           ...
  620.                                       );
  621.                 end
  622.                 set(pus_app_all,'Userdata',Chk_App_Lst);
  623.                 chk_det_on   = uicontrol(...
  624.                                      comChkProp{:}, ...
  625.                                      'Position',pos_det_on,  ...
  626.                                      'String',str_det_on,    ...
  627.                                      'Visible',vis_str(4,:), ...
  628.                                      'Value',val_flg(4),     ...
  629.                                      'Tag',tag_det_on,       ...
  630.                                      'Callback',cba_det_on   ...
  631.                                      );
  632.                 chk_s_det    = uicontrol(...
  633.                                      comChkProp{:}, ...
  634.                                      'Position',pos_s_det,   ...
  635.                                      'String',str_s_det,     ...
  636.                                      'Visible',vis_str(5,:), ...
  637.                                      'Value',val_flg(5),     ...
  638.                                      'Tag',tag_s_det ...
  639.                                      );
  640.                 chk_ss_det   = uicontrol(...
  641.                                      comChkProp{:}, ...
  642.                                      'Position',pos_ss_det,  ...
  643.                                      'String',str_ss_det,    ...
  644.                                      'Visible',vis_str(6,:), ...
  645.                                      'Value',val_flg(6),     ...
  646.                                      'Tag',tag_ss_det        ...
  647.                                      );
  648.                 txt_det_txt  = uicontrol(...
  649.                                      comTxtProp{:}, ...
  650.                                      'Position',pos_det_txt,...
  651.                                      'String',str_det_txt,...
  652.                                      'HorizontalAlignment','center', ...
  653.                                      'Visible','on',...
  654.                                      'Tag',tag_det_txt...
  655.                                      );
  656.                 pus_det_all  = uicontrol(...
  657.                                      comPusProp{:}, ...
  658.                                      'Position',pos_det_all,...
  659.                                      'String',xlate(str_det_all),...
  660.                                      'Visible','on',...
  661.                                      'Tag',tag_det_all,...
  662.                                      'Callback',cba_det_all  ...
  663.                                      );
  664.                 pus_det_none = uicontrol(...
  665.                                      comPusProp{:}, ...
  666.                                      'Position',pos_det_none,...
  667.                                      'String',xlate(str_det_none),...
  668.                                      'Visible','on',...
  669.                                      'Tag',tag_det_none,...
  670.                                      'Callback',cba_det_none ...
  671.                                      );
  672.                 Chk_Det_Lst  = zeros(Level_Anal,1);
  673.                 for i=1:Level_Anal
  674.                     Chk_Det_Lst(i) = uicontrol(...
  675.                                     comChkProp{:}, ...
  676.                                     'Position',pos_chk_det(i,:),...
  677.                                     'Value',det_flg(i),         ...
  678.                                     'String',sprintf('%.0f',i), ...
  679.                                     'Visible','on',             ...
  680.                                     'Tag',tag_det_num           ...
  681.                                     );
  682.                 end
  683.                 set(pus_det_all,'Userdata',Chk_Det_Lst);
  684.                 drawnow;
  685.             case 4
  686.                 %%%%%%%%%%------ Mode : "Superimpose" ----%%%%%%%%%%
  687.                 Level_Anal = wmemtool('rmb',win_dw1dtool,n_param_anal,...
  688.                                                         ind_lev_anal);
  689.                 nb_inline = 3;
  690.                 nb_lines  = max(2,ceil(Level_Anal/nb_inline))+1;
  691.                 nb        = nb_inline+1;
  692.                 if Level_Anal > 6
  693.                     btn_height = 4*Def_Btn_Height/5;
  694.                     if Screen_Size(4)<600
  695.                         chk_height = Def_Btn_Height;
  696.                     else
  697.                         chk_height = btn_height;
  698.                     end
  699.                 else
  700.                     btn_height = Def_Btn_Height;
  701.                     chk_height = Def_Btn_Height;
  702.                 end
  703.                 [flg_axe,flg_sa,flg_app,flg_sd,flg_det,ccfs_m] = ...
  704.                                 dw1dvmod('get_vm',win_dw1dtool,num_mode);
  705.                 if flg_axe(3)== 0
  706.                     vis_txt_ccfs = 'off'; vis_pop_ccfs = 'off';
  707.                 else
  708.                     vis_txt_ccfs = 'on';  vis_pop_ccfs = 'on';
  709.                 end
  710.                 vis_str = getonoff([1 flg_axe([1 1]) 1 flg_axe([2 2])]);
  711.                 val_flg = [flg_axe(1) flg_sa flg_axe(2) flg_sd flg_axe(3)];
  712.                 val_app = flg_app;
  713.                 val_det = flg_det;
  714.                 val_cfs = flg_axe(3);
  715.                 % Position property of objects.
  716.                 %------------------------------
  717.                 ylow         = ylow-Def_Btn_Height-3*dy2;
  718.                 w_uic        = 2*(Def_Btn_Width+1.5*dx2);                
  719.                 pos_app_on   = [dx2, ylow, w_uic, Def_Btn_Height];
  720.                 ylow         = ylow-Def_Btn_Height-dy;
  721.                 w_uic        = 2*Def_Btn_Width+dx2;
  722.                 pos_s_app    = [3*dx2, ylow, w_uic, Def_Btn_Height];
  723.                 ylow         = ylow-Def_Btn_Height;
  724.                 pos_ss_app   = [3*dx2, ylow, w_uic, Def_Btn_Height];
  725.                 px           = x_left0+(win_width-3*push_width/2)/2;
  726.                 ylow         = ylow-3*Def_Btn_Height/2;
  727.                 w_uic        = 3*push_width/2;
  728.                 pos_app_txt  = [px, ylow+d_txt/2, w_uic, Def_Txt_Height];
  729.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  730.                 ylow         = ylow-6*btn_height/5;
  731.                 w_uic        = Def_Btn_Width/2;
  732.                 pos_app_all  = [x_left0+wx, ylow, w_uic, btn_height];
  733.                 ylow         = ylow-6*btn_height/5;
  734.                 pos_app_none = [pos_app_all(1), ylow, w_uic, btn_height];
  735.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  736.                 xbtchk0      = x_left0+Def_Btn_Width/2+2*wx;
  737.                 ybtchk0      = pos_app_txt(2)-Def_Btn_Height;
  738.                 xbtchk       = xbtchk0;
  739.                 ybtchk       = ybtchk0;
  740.                 pos_chk_app  = zeros(Level_Anal,4);
  741.                 for i=1:Level_Anal
  742.                     pos_chk_app(i,:) = ...
  743.                         [xbtchk ybtchk Def_Btn_Width/2 chk_height];
  744.                     if rem(i,nb_inline)==0
  745.                         xbtchk = xbtchk0;
  746.                         ybtchk = ybtchk-6*btn_height/5;
  747.                     else
  748.                         xbtchk = xbtchk+Def_Btn_Width/2+wx;
  749.                     end
  750.                 end
  751.                 mi = min(pos_app_none(2),pos_chk_app(Level_Anal,2));
  752.                 ylow         = mi-Def_Btn_Height-2*dy2;
  753.                 w_uic        = 2*(Def_Btn_Width+1.5*dx2);
  754.                 pos_det_on   = [dx2, ylow, w_uic, Def_Btn_Height];
  755.                 ylow         = ylow-Def_Btn_Height-dy;
  756.                 w_uic        = 2*Def_Btn_Width+dx2;
  757.                 pos_s_det    = [3*dx2, ylow, w_uic, Def_Btn_Height];
  758.                 ylow         = ylow-Def_Btn_Height;
  759.                 pos_ss_det   = [3*dx2, ylow, w_uic, Def_Btn_Height];
  760.                 px           = x_left0+(win_width-3*push_width/2)/2;
  761.                 ylow         = ylow-3*Def_Btn_Height/2;
  762.                 w_uic        = 3*push_width/2;
  763.                 pos_det_txt  = [px, ylow+d_txt/2, w_uic, Def_Txt_Height];
  764.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  765.                 ylow         = ylow-6*btn_height/5;
  766.                 w_uic        = Def_Btn_Width/2;
  767.                 pos_det_all  = [x_left0+wx, ylow, w_uic, btn_height];
  768.                 ylow         = ylow-6*btn_height/5;
  769.                 pos_det_none = [pos_det_all(1), ylow, w_uic, btn_height];
  770.                 wx           = (win_width-nb*Def_Btn_Width/2)/(nb+1);
  771.                 xbtchk0      = x_left0+Def_Btn_Width/2+2*wx;
  772.                 ybtchk0      = pos_det_txt(2)-Def_Btn_Height;
  773.                 xbtchk       = xbtchk0;
  774.                 ybtchk       = ybtchk0;
  775.                 pos_chk_det  = zeros(Level_Anal,4);
  776.                 for i=1:Level_Anal
  777.                     pos_chk_det(i,:) = ...
  778.                         [xbtchk ybtchk Def_Btn_Width/2 chk_height];
  779.                     if rem(i,nb_inline)==0
  780.                         xbtchk = xbtchk0;
  781.                         ybtchk = ybtchk-6*btn_height/5;
  782.                     else
  783.                         xbtchk = xbtchk+Def_Btn_Width/2+wx;
  784.                     end
  785.                 end
  786.                 mi = min(pos_det_none(2),pos_chk_det(Level_Anal,2));
  787.                 ylow         = mi-Def_Btn_Height-2*dy2;
  788.                 w_uic        = 2*(Def_Btn_Width+1.5*dx2);
  789.                 pos_cfs_on   = [dx2, ylow, w_uic, Def_Btn_Height];
  790.                 ylow         = ylow-Def_Btn_Height-dy;
  791.                 w_uic        = 2*(Def_Btn_Width+dx2);
  792.                 pos_txt_ccfs = [2*dx2, ylow+d_txt/2, w_uic, Def_Txt_Height];
  793.                 ylow         = ylow-Def_Btn_Height;
  794.                 pos_pop_ccfs = [2*dx2, ylow, w_uic, Def_Btn_Height];
  795.                 chk_app_on = uicontrol(...
  796.                                        comChkProp{:}, ...
  797.                                        'Position',pos_app_on,  ...
  798.                                        'String',str_app_on,    ...
  799.                                        'Visible',vis_str(1,:), ...
  800.                                        'Value',val_flg(1),     ...
  801.                                        'Tag',tag_app_on,       ...
  802.                                        'Callback',cba_app_on   ...
  803.                                        );
  804.                 chk_s_app = uicontrol(...
  805.                                        comChkProp{:}, ...
  806.                                        'Position',pos_s_app,   ...
  807.                                        'String',str_s_app,     ...
  808.                                        'Visible',vis_str(2,:), ...
  809.                                        'Value',val_flg(2),     ...
  810.                                        'Tag',tag_s_app         ...
  811.                                        );
  812.                 chk_ss_app = uicontrol(...
  813.                                        comChkProp{:}, ...
  814.                                        'Position',pos_ss_app,  ...
  815.                                        'String',str_ss_app,    ...
  816.                                        'Visible',vis_str(3,:), ...
  817.                                        'Value',val_flg(3),     ...
  818.                                        'Tag',tag_ss_app        ...
  819.                                        );
  820.                 txt_app_txt = uicontrol(...
  821.                                         comTxtProp{:}, ...
  822.                                         'Position',pos_app_txt, ...
  823.                                         'String',str_app_txt,   ...
  824.                                         'Visible',vis_str(3,:), ...
  825.                                         'Tag',tag_app_txt       ...
  826.                                         );
  827.                 pus_app_all = uicontrol(...
  828.                                         comPusProp{:}, ...
  829.                                         'Position',pos_app_all, ...
  830.                                         'String',xlate(str_app_all),   ...
  831.                                         'Visible',vis_str(3,:), ...
  832.                                         'Tag',tag_app_all,      ...
  833.                                         'Callback',cba_app_all  ...
  834.                                         );
  835.                 pus_app_none = uicontrol(...
  836.                                         comPusProp{:}, ...
  837.                                         'Position',pos_app_none,...
  838.                                         'String',xlate(str_app_none),  ...
  839.                                         'Visible',vis_str(3,:), ...
  840.                                         'Tag',tag_app_none,     ...
  841.                                         'Callback',cba_app_none ...
  842.                                         );
  843.                 Chk_App_Lst     = zeros(Level_Anal,1);
  844.                 for i=1:Level_Anal
  845.                   Chk_App_Lst(i) = uicontrol(...
  846.                                      comChkProp{:}, ...
  847.                                      'Position',pos_chk_app(i,:),...
  848.                                      'Value',val_app(i),         ...
  849.                                      'String',sprintf('%.0f',i), ...
  850.                                      'Visible',vis_str(3,:),     ...
  851.                                      'Tag',tag_app_num           ...
  852.                                      );
  853.                 end
  854.                 set(pus_app_all,'Userdata',Chk_App_Lst);
  855.                 chk_det_on = uicontrol(...
  856.                                        comChkProp{:}, ...
  857.                                        'Position',pos_det_on,  ...
  858.                                        'String',str_det_on,    ...
  859.                                        'Visible',vis_str(4,:), ...
  860.                                        'Value',val_flg(4),     ...
  861.                                        'Tag',tag_det_on,       ...
  862.                                        'Callback',cba_det_on   ...
  863.                                        );
  864.                 chk_s_det = uicontrol(...
  865.                                         comChkProp{:}, ...
  866.                                         'Position',pos_s_det,   ...
  867.                                         'String',str_s_det,     ...
  868.                                         'Visible',vis_str(5,:), ...
  869.                                         'Value',val_flg(5),     ...
  870.                                         'Tag',tag_s_det         ...
  871.                                         );
  872.                 chk_ss_det = uicontrol(...
  873.                                        comChkProp{:}, ...
  874.                                        'Position',pos_ss_det,  ...
  875.                                        'String',str_ss_det,    ...
  876.                                        'Visible',vis_str(6,:), ...
  877.                                        'Value',val_flg(6),     ...
  878.                                        'Tag',tag_ss_det        ...
  879.                                        );
  880.                 txt_det_txt = uicontrol(...
  881.                                         comTxtProp{:}, ...
  882.                                         'Position',pos_det_txt, ...
  883.                                         'String',str_det_txt,   ...
  884.                                         'Visible',vis_str(6,:), ...
  885.                                         'Tag',tag_det_txt       ...
  886.                                         );
  887.                 pus_det_all = uicontrol(...
  888.                                         comPusProp{:}, ...
  889.                                         'Position',pos_det_all, ...
  890.                                         'String',xlate(str_det_all),   ...
  891.                                         'Visible',vis_str(6,:), ...
  892.                                         'Tag',tag_det_all,      ...
  893.                                         'Callback',cba_det_all  ...
  894.                                         );
  895.                 pus_det_none = uicontrol(...
  896.                                         comPusProp{:}, ...
  897.                                         'Position',pos_det_none,...
  898.                                         'String',xlate(str_det_none),  ...
  899.                                         'Visible',vis_str(6,:), ...
  900.                                         'Tag',tag_det_none,     ...
  901.                                         'Callback',cba_det_none ...
  902.                                         );
  903.                 Chk_Det_Lst = zeros(Level_Anal,1);
  904.                 for i=1:Level_Anal
  905.                   Chk_Det_Lst(i) = uicontrol(...
  906.                                      comChkProp{:},     ...
  907.                                      'Position',pos_chk_det(i,:),...
  908.                                      'Value',val_det(i),         ...
  909.                                      'String',sprintf('%.0f',i), ...
  910.                                      'Visible',vis_str(6,:),     ...
  911.                                      'Tag',tag_det_num           ...
  912.                                      );
  913.                 end
  914.                 set(pus_det_all,'Userdata',Chk_Det_Lst);
  915.                 drawnow;
  916.             case 5
  917.                 %%%%%%%%%%-------- Mode : "Tree Mode" ------%%%%%%%%%%
  918.         end
  919.         if find(num_mode==[1 3 4 6])
  920.             chk_cfs_on = uicontrol(...
  921.                                    comChkProp{:}, ...
  922.                                    'Position',pos_cfs_on,  ...
  923.                                    'String',str_cfs_on,    ...
  924.                                    'Visible','on',         ...
  925.                                    'Value',val_cfs,        ...
  926.                                    'Tag',tag_cfs_on,       ...
  927.                                    'Callback',cba_cfs_on   ...
  928.                                    );
  929.             txt_ccfs = uicontrol(...
  930.                                 comTxtProp{:}, ...
  931.                                 'Position',pos_txt_ccfs,...
  932.                                 'Visible',vis_txt_ccfs, ...
  933.                                 'String',str_txt_ccfs,  ...
  934.                                 'tag',tag_txt_ccfs      ...
  935.                                 );
  936.             pop_ccfs  = uicontrol(...
  937.                                 comFigProp{:}, ...
  938.                                 'Style','Popup',        ...
  939.                                 'Position',pos_pop_ccfs,...
  940.                                 'Visible',vis_pop_ccfs, ...
  941.                                 'String',str_pop_ccfs,  ...
  942.                                 'Value',ccfs_m,         ...
  943.                                 'Tag',tag_pop_ccfs      ...
  944.                                 );
  945. % Add Context Sensitive Help (CSHelp).
  946. %-------------------------------------
  947. hdl_CSHelp = [txt_ccfs,pop_ccfs];
  948. wfighelp('add_ContextMenu',win_dw1d_more,hdl_CSHelp,'CW_COLMODE');
  949. %-------------------------------------
  950.         end
  951.         %  Normalization.
  952.         %----------------
  953.         set(findobj(win_dw1d_more,'units','pixels'),'units','normalized');
  954.         hidegui(win_dw1d_more,'off')
  955.         % End waiting.
  956.         %---------------
  957.         mousefrm(0,'arrow');
  958.     case 'apply'
  959.         % in3 = win_dw1d_more
  960.         %--------------------
  961.         win_dw1d_more = in3;
  962.         chk_handles   = findobj(win_dw1d_more,'Style','checkbox');
  963.         pus_handles   = findobj(win_dw1d_more,'Style','pushbutton');
  964.         chk_app_on    = findobj(chk_handles,'Tag',tag_app_on);
  965.         chk_s_app     = findobj(chk_handles,'Tag',tag_s_app);
  966.         chk_ss_app    = findobj(chk_handles,'Tag',tag_ss_app);
  967.         chk_det_on    = findobj(chk_handles,'Tag',tag_det_on);
  968.         chk_s_det     = findobj(chk_handles,'Tag',tag_s_det);
  969.         chk_ss_det    = findobj(chk_handles,'Tag',tag_ss_det);
  970.         chk_cfs_on    = findobj(chk_handles,'Tag',tag_cfs_on);
  971.         txt_ccfs      = findobj(win_dw1d_more,'tag',tag_txt_ccfs);
  972.         pop_ccfs      = findobj(win_dw1d_more,'tag',tag_pop_ccfs);
  973.         flg_axe       = [get(chk_app_on,'Value'),...
  974.                          get(chk_det_on,'Value'),...
  975.                          get(chk_cfs_on,'Value') ...
  976.                          ];
  977.         flg_sa        = [get(chk_s_app,'Value'), get(chk_ss_app,'Value')];
  978.         flg_sd        = [get(chk_s_det,'Value'), get(chk_ss_det,'Value')];
  979.         val_cfs       =  get(pop_ccfs,'Value');
  980.         switch num_mode
  981.             case {1,6}
  982.                 new_vm = dw1dvmod('set_vm',win_dw1dtool,num_mode,...
  983.                                 flg_axe,flg_sa,1,flg_sd,1,val_cfs);
  984.                 dw1ddisp('ena_pop',win_dw1dtool,flg_axe(1:2));
  985.                 
  986.             case {2,5}
  987.             case {3,4}
  988.                 pus_app_all = findobj(pus_handles,'Tag',tag_app_all);
  989.                 pus_det_all = findobj(pus_handles,'Tag',tag_det_all);
  990.                 chk_app_lst = get(pus_app_all,'Userdata');
  991.                 chk_det_lst = get(pus_det_all,'Userdata');
  992.                 lev_anal    = length(chk_app_lst);
  993.                 flg_app = get(chk_app_lst(1:lev_anal),'Value');
  994.                 flg_app = cat(2,flg_app{:});
  995.                 flg_det = get(chk_det_lst(1:lev_anal),'Value');
  996.                 flg_det = cat(2,flg_det{:});
  997.                 new_vm  = dw1dvmod('set_vm',win_dw1dtool,num_mode,...
  998.                               flg_axe,flg_sa,flg_app,flg_sd,flg_det,val_cfs);
  999.         end
  1000.         % Changing view mode options
  1001.         %---------------------------
  1002.         if find(val_cfs==[5 6 7 8]) & (new_vm==0)
  1003.             xlim_selbox = mngmbtn('getbox',win_dw1dtool); 
  1004.             if ~isempty(xlim_selbox) , new_vm = 1; end
  1005.         end
  1006.         % Begin waiting.
  1007.         %--------------
  1008.         mousefrm(0,'watch')
  1009.         switch num_mode
  1010.             case 1 , fname = 'dw1dscrm';
  1011.             case 2 , fname = 'dw1ddecm';
  1012.             case 3 , fname = 'dw1dsepm';
  1013.             case 4 , fname = 'dw1dsupm';
  1014.             case 5 , fname = 'dw1dtrem';
  1015.             case 6 , fname = 'dw1dcfsm';
  1016.         end
  1017.         feval(fname,'view',win_dw1dtool,-1);
  1018.         % End waiting.
  1019.         %---------------
  1020.         mousefrm(0,'arrow')
  1021.         figure(win_dw1d_more)
  1022. if nargout>0 , varargout{1} = win_dw1d_more; end
  1023.     case 'cancel'
  1024.         % in3 = win_dw1d_more
  1025.         %--------------------
  1026.         win_dw1d_more = in3;
  1027.         chk_handles   = findobj(win_dw1d_more,'Style','checkbox');
  1028.         pus_handles   = findobj(win_dw1d_more,'Style','pushbutton');
  1029.         chk_app_on    = findobj(chk_handles,'Tag',tag_app_on);
  1030.         chk_s_app     = findobj(chk_handles,'Tag',tag_s_app);
  1031.         chk_ss_app    = findobj(chk_handles,'Tag',tag_ss_app);
  1032.         chk_det_on    = findobj(chk_handles,'Tag',tag_det_on);
  1033.         chk_s_det     = findobj(chk_handles,'Tag',tag_s_det);
  1034.         chk_ss_det    = findobj(chk_handles,'Tag',tag_ss_det);
  1035.         chk_cfs_on    = findobj(chk_handles,'Tag',tag_cfs_on);
  1036.         txt_ccfs      = findobj(win_dw1d_more,'tag',tag_txt_ccfs);
  1037.         pop_ccfs      = findobj(win_dw1d_more,'tag',tag_pop_ccfs);
  1038.         switch num_mode
  1039.             case {1,6}
  1040.                 [flg_axe,flg_sa,flg_app,flg_sd,flg_det,ccfs_m] = ...
  1041.                                 dw1dvmod('get_vm',win_dw1dtool,num_mode,0);
  1042.                 val_flg = [flg_axe(1) flg_sa flg_axe(2) flg_sd];
  1043.                 vis_str = getonoff([1 flg_axe([1 1]) 1 flg_axe([2 2])]);
  1044.                 val_cfs = flg_axe(3);
  1045.                 if val_cfs==0
  1046.                   vis_txt_ccfs = 'off'; vis_pop_ccfs = 'off';
  1047.                 else
  1048.                   vis_txt_ccfs = 'on';  vis_pop_ccfs = 'on';
  1049.                 end
  1050.             case {2,5}
  1051.             case 3
  1052.                 Level_Anal = wmemtool('rmb',win_dw1dtool,n_param_anal,...
  1053.                                             ind_lev_anal);
  1054.                 [flg_axe,sa_flg,app_flg,sd_flg,det_flg,ccfs_m] = ...
  1055.                                 dw1dvmod('get_vm',win_dw1dtool,num_mode,0);
  1056.                 l_s_flg = flg_axe(1);
  1057.                 r_s_flg = flg_axe(2);   
  1058.                 val_cfs = flg_axe(3);
  1059.                 val_flg = [l_s_flg , sa_flg , r_s_flg , sd_flg];
  1060.                 vis_str = getonoff([1 l_s_flg l_s_flg 1 r_s_flg r_s_flg ]);
  1061.                 if val_cfs==0
  1062.                     vis_txt_ccfs = 'off'; vis_pop_ccfs = 'off';
  1063.                 else
  1064.                     vis_txt_ccfs = 'on';  vis_pop_ccfs = 'on';
  1065.                 end
  1066.                 pus_app_all = findobj(pus_handles,'Tag',tag_app_all);
  1067.                 pus_det_all = findobj(pus_handles,'Tag',tag_det_all);
  1068.                 chk_app_lst = get(pus_app_all,'Userdata');
  1069.                 chk_det_lst = get(pus_det_all,'Userdata');
  1070.                 for k=1:Level_Anal , set(chk_app_lst(k),'Value',app_flg(k)); end
  1071.                 for k=1:Level_Anal , set(chk_det_lst(k),'Value',det_flg(k)); end
  1072.             case 4
  1073.                 Level_Anal = wmemtool('rmb',win_dw1dtool,n_param_anal,...
  1074.                                                 ind_lev_anal);
  1075.                 [flg_axe,flg_sa,flg_app,flg_sd,flg_det,ccfs_m] = ...
  1076.                                 dw1dvmod('get_vm',win_dw1dtool,num_mode,0);
  1077.                 if flg_axe(3)== 0
  1078.                     vis_txt_ccfs = 'off';   vis_pop_ccfs = 'off';
  1079.                 else
  1080.                     vis_txt_ccfs = 'on';    vis_pop_ccfs = 'on';
  1081.                 end
  1082.                 vis_str = getonoff([1 flg_axe([1 1]) 1 flg_axe([2 2])]);
  1083.                 val_flg = [1 flg_sa 1 flg_sd flg_axe(3)];
  1084.                 val_app = flg_app;
  1085.                 val_det = flg_det;
  1086.                 val_cfs = flg_axe(3);
  1087.                 pus_app_all  = findobj(pus_handles,'Tag',tag_app_all);
  1088.                 pus_app_none = findobj(pus_handles,'Tag',tag_app_none);
  1089.                 pus_det_all  = findobj(pus_handles,'Tag',tag_det_all);
  1090.                 pus_det_none = findobj(pus_handles,'Tag',tag_det_none);
  1091.                 txt_handles  = findobj(win_dw1d_more,'Style','text');
  1092.                 txt_app_txt  = findobj(txt_handles,'Tag',tag_app_txt);
  1093.                 txt_det_txt  = findobj(txt_handles,'Tag',tag_det_txt);
  1094.                 chk_app_lst  = get(pus_app_all,'Userdata');
  1095.                 chk_det_lst  = get(pus_det_all,'Userdata');
  1096.                 for k=1:Level_Anal , set(chk_app_lst(k),'Value',val_app(k)); end
  1097.                 for k=1:Level_Anal , set(chk_det_lst(k),'Value',val_det(k)); end
  1098.                 set([txt_app_txt; pus_app_all; pus_app_none; chk_app_lst],...
  1099.                                 'Visible',vis_str(3,:));
  1100.                 set([txt_det_txt; pus_det_all; pus_det_none; chk_det_lst],...
  1101.                                 'Visible',vis_str(6,:));
  1102.         end
  1103.         if find(num_mode==[1 3 4 6])
  1104.             set(chk_app_on, 'Visible',vis_str(1,:),'Value',val_flg(1));
  1105.             set(chk_s_app,  'Visible',vis_str(2,:),'Value',val_flg(2));
  1106.             set(chk_ss_app, 'Visible',vis_str(3,:),'Value',val_flg(3));
  1107.             set(chk_det_on, 'Visible',vis_str(4,:),'Value',val_flg(4));
  1108.             set(chk_s_det,  'Visible',vis_str(5,:),'Value',val_flg(5));
  1109.             set(chk_ss_det, 'Visible',vis_str(6,:),'Value',val_flg(6));
  1110.             set(chk_cfs_on, 'Value',val_cfs);
  1111.             set(txt_ccfs,'Visible',vis_txt_ccfs);
  1112.             set(pop_ccfs,'Visible',vis_pop_ccfs,'Value',ccfs_m);
  1113.         end
  1114.         % Restore old view mode options
  1115.         %-------------------------------
  1116.         dw1ddisp('apply',win_dw1dtool,win_dw1d_more);
  1117.     case 'close'
  1118.         delete(in3);
  1119.         dw1dutil('enable',win_dw1dtool,'end_more_disp');
  1120.         % End waiting.
  1121.         %---------------
  1122.         wwaiting('off',win_dw1dtool);
  1123.     otherwise
  1124.         errargt(mfilename,'Unknown Option','msg');
  1125.         error('*');
  1126. end