📄 vis_show_gui_tool.m
字号:
set( ... uicontrol( ... %% Trace vector 'Units','pixels', ... 'Position',trace_vect_text_pos, ... 'HorizontalAlignment','left', ... 'String','Hit vector', ... 'Style','text'),'units','normalized'); ed2_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',trace_vect_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed2_h,'units','normalized'); s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ... 'vis_show_gui_tool(tmp(2),''select'')']; set( ... uicontrol( ... %% Select variable 'Units','pixels', ... 'Position',sel_vect_pos, ... 'String','Select variable', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame3_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% Marker 'Units','pixels', ... 'Position',marker_text_pos, ... 'HorizontalAlignment','left', ... 'String','Marker', ... 'Style','text'),'units','normalized'); s = {'lattice' 'o' '.' 'x' '+' '*' 's' 'd' 'v' '^' ... '<' '>' 'p' 'h' 'none' 'cell array'}; p3_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',marker_pos, ... 'String',s, ... 'Style','popupmenu'); s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ... 'vis_show_gui_tool([tmp(6),16],''popup_select'')']; set(p3_h,'units','normalized','Callback',s); set( ... uicontrol( ... %% Marker size 'Units','pixels', ... 'HorizontalAlignment','left', ... 'Position',marker_size_text_pos, ... 'String','Marker size', ... 'Style','text'),'units','normalized'); ed4_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',marker_size_pos, ... 'String','12', ... 'FontSize',12, ... 'Style','edit'); set(ed4_h,'units','normalized','Callback',s); set( ... uicontrol( ... %% Size factor 'Units','pixels', ... 'HorizontalAlignment','left', ... 'Position',size_fact_text_pos, ... 'String','Size factor', ... 'Style','text'),'units','normalized'); s = {'common' 'separate'}; p4_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',size_fact_pos, ... 'String',s, ... 'Style','popupmenu'); set(p4_h,'units','normalized'); set( ... uicontrol( ... %% Marker color 'Units','pixels', ... 'HorizontalAlignment','left', ... 'Position',marker_color_text_pos, ... 'String','Marker color', ... 'Style','text'),'units','normalized'); ud = {'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b' 'none' ''}; s = {'white' 'black' 'yellow' 'magenta' 'cyan' ... 'red' 'green' 'blue' 'none' '-matrix-'}; p5_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',marker_color_pos, ... 'UserData',ud, ... 'String',s, ... 'Style','popupmenu'); s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ... 'vis_show_gui_tool([tmp(9) 10],''popup_select'')']; set(p5_h,'units','normalized','Callback',s); set( ... uicontrol( ... %% EdgeColor 'Units','pixels', ... 'Position',edge_color_text_pos, ... 'HorizontalAlignment','left', ... 'String','Edge color', ... 'Style','text'),'units','normalized'); ud = {'none' 'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b'}; s = {'none' 'white' 'black' 'yellow' 'magenta' 'cyan' ... 'red' 'green' 'blue'}; p6_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',edge_color_pos, ... 'UserData',ud, ... 'String',s, ... 'Style','popupmenu'); set(p6_h,'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame4_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% Text 'Units','pixels', ... 'Position',text_text_pos, ... 'HorizontalAlignment','left', ... 'String','Text', ... 'Style','text'),'units','normalized'); s = {'off' 'on'}; p2_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',text_pos, ... 'String',s, ... 'Style','popupmenu'); set(p2_h,'units','normalized'); set( ... uicontrol( ... %% Text 'Units','pixels', ... 'Position',text_text_pos, ... 'HorizontalAlignment','left', ... 'String','Text', ... 'Style','text'),'units','normalized'); s = {'off' 'on'}; p2_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',text_pos, ... 'String',s, ... 'Style','popupmenu'); set(p2_h,'units','normalized'); set( ... uicontrol( ... %% Text color 'Units','pixels', ... 'Position',text_color_text_pos, ... 'HorizontalAlignment','left', ... 'String','Text color', ... 'Style','text'),'units','normalized'); ud = {'k' 'w' 'y' 'm' 'c' 'r' 'g' 'b' 'xor'}; s = {'black' 'white' 'yellow' 'magenta' 'cyan' ... 'red' 'green' 'blue' 'xor'}; p1_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',text_color_pos, ... 'UserData',ud, ... 'String',s, ... 'Style','popupmenu'); set(p1_h,'units','normalized'); set( ... uicontrol( ... %% Text size 'Units','pixels', ... 'Position',text_size_text_pos, ... 'HorizontalAlignment','left', ... 'String','Text size', ... 'Style','text'),'units','normalized'); ed3_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',text_size_pos, ... 'String','3', ... 'FontSize',12, ... 'Style','edit'); set(ed3_h,'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame5_pos, ... 'Style','frame'),'units','normalized'); s = ['vis_show_gui_tool(' mat2str(h) ',''hit'',' mat2str(fig_h) ')']; set( ... uicontrol( ... %% OK 'Units','pixels', ... 'Position',ok_pos, ... 'String','OK', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% Cancel 'Units','pixels', ... 'Position',cancel_pos, ... 'String','Cancel', ... 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized'); watchoff(old_fig_n); tmp_udata = [ed1_h ed2_h p1_h ed3_h p2_h p3_h ed4_h p4_h p5_h p6_h]; set(fig_h,'units','normalized', ... 'Visible','on', ... 'UserData',tmp_udata, ... 'handlevisibility','off'); %%%%%%%%%%% add_traj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%elseif strcmp(action,'add_traj') old_fig_n = watchon; W = 424.3; H = 337.642; o34 = zeros(1,4); o34(1) = (W-f_fr(3))/2; f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14]; hint_txt = [W 18.45]; % hint text width and height units = get(h,'units'); set(h,'units','pixels'); fp = get(h,'Position'); fig_pos = [(fp(1)+fp(3)) ... (fp(2)+fp(2)+fp(4)/2-H/2) ... W ... H]; o1 = sum(f_fr([2 4]))+frames_dist; o2 = o1+dist1; o6 = max([title_txt(2),var_pop(2)]); o7 = max([title_txt(2),title_edit_h]); o8 = max([title_txt(2),title_edit_h,var_pop(2)]); o38 = max([title_txt(2),title_edit_h,selvar_pb(2)]); o20 = ok_pb(1)+title_txt(1); o10 = o20+var_pop(1)+2*dist1; o11 = o10+title_txt(1); o3 = 2*o6+o8+4*dist1; o4 = o1+dist1+0.5*o6-title_txt(2)/2; o5 = o1+dist1+0.5*o6-var_pop(2)/2; o9 = o1+2*dist1+o6+0.5*o8-title_txt(2)/2; o12 = o1+2*dist1+o6+0.5*o8-title_edit_h/2; o13 = o1+2*dist1+o6+0.5*o8-var_pop(2)/2; o14 = o1+3*dist1+o6+o8+0.5*o6-title_edit_h/2; o15 = o1+3*dist1+o6+o8+0.5*o6-var_pop(2)/2; o16 = o1+o3+frames_dist2; o17 = o8+o6+3*dist1; o18 = o16+dist1+0.5*o8-title_txt(2)/2; o19 = o16+dist1+0.5*o8-title_edit_h/2; o21 = o16+dist1+0.5*o8-var_pop(2)/2; o22 = o16+2*dist1+o8+0.5*o6-title_txt(2)/2; o23 = o16+2*dist1+o8+0.5*o6-var_pop(2)/2; o24 = o16+o17+frames_dist2; o25 = o38+2*dist1; o26 = o24+dist1+0.5*o38-title_txt(2)/2; o27 = o24+dist1+0.5*o38-title_edit_h/2; o28 = o24+dist1+0.5*o38-selvar_pb(2)/2; o29 = o24+o25+frames_dist2; o30 = o7+2*dist1; o31 = o29+dist1+0.5*o7-title_txt(2)/2; o32 = o29+dist1+0.5*o7-title_edit_h/2; o33 = o29+o30+hint_dist1; hint_text_pos = [1 o33 hint_txt]; frame1_pos = [f_fr(1) o29 f_fr(3) o30]; subplots_text_pos = [ok_pb(1) o31 title_txt]; subplots_pos = [o20 o32 strd_ed]; frame2_pos = [f_fr(1) o24 f_fr(3) o25]; trace_vect_text_pos = [ok_pb(1) o26 title_txt]; trace_vect_pos = [o20 o27 strd_ed]; sel_vect_pos = [o10 o28 selvar_pb]; frame3_pos = [f_fr(1) o16 f_fr(3) o17]; line_color_text_pos = [ok_pb(1) o22 title_txt]; line_color_pos = [o20 o23 var_pop]; line_width_text_pos = [ok_pb(1) o18 title_txt]; line_width_pos = [o20 o19 strd_ed]; width_factor_text_pos = [o10 o18 title_txt]; width_factor_pos = [o11 o19 var_pop]; frame4_pos = [f_fr(1) o1 f_fr(3) o3]; marker_text_pos = [ok_pb(1) o14 title_txt]; marker_pos = [o20 o15 var_pop]; marker_size_text_pos = [ok_pb(1) o9 title_txt]; marker_size_pos = [o20 o12 strd_ed]; size_factor_text_pos = [o10 o9 title_txt]; size_factor_pos = [o11 o13 var_pop]; marker_color_text_pos = [ok_pb(1) o4 title_txt]; marker_color_pos = [o20 o5 var_pop]; edge_color_text_pos = [o10 o4 title_txt]; edge_color_pos = [o11 o5 var_pop]; f_fr = [7.9 8.38 216.2 36.9]; % final frame cancel_pb = [139 15.76 75.9 22.14]; frame5_pos = f_fr+o34; ok_pos = ok_pb+o34; cancel_pos = cancel_pb+o34; fig_h = figure( ... 'Units','pixels', ... 'Position', fig_pos, ... 'Color',fig_color, ... 'NumberTitle','off', ... 'Name','add trajectory', ... 'MenuBar','none', ... 'Visible','off'); set( ... uicontrol( ... %% hint 'Units','pixels', ... 'BackgroundColor',fig_color, ... 'HorizontalAlignment','center', ... 'Position',hint_text_pos, ... 'String','Options for adding trajectory', ... 'Style','text'),'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame1_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... 'Units','pixels', ... %% To subplot(s) 'Position',subplots_text_pos, ... 'HorizontalAlignment','left', ... 'String','To subplot(s)', ... 'Style','text'),'units','normalized'); ed1_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',subplots_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed1_h,'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame2_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% Trace vector 'Units','pixels', ... 'Position',trace_vect_text_pos, ... 'HorizontalAlignment','left', ... 'String','Trajectory', ... 'Style','text'),'units','normalized'); ed2_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',trace_vect_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed2_h,'units','normalized'); s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ... 'vis_show_gui_tool(tmp(2),''select'')']; set( ... uicontrol( ... %% Select variable 'Units','pixels', ... 'Position',sel_vect_pos, ... 'String','Select variable', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame3_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% Line color 'Units','pixels', ... 'Position',line_color_text_pos, ... 'HorizontalAlignment','left', ... 'String','Line color', ... 'Style','text'),'units','normalized'); ud = {'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b' 'xor'}; s = {'white' 'black' 'yellow' 'magenta' 'cyan' ... 'red' 'green' 'blue' 'xor'}; p1_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',line_color_pos, ... 'UserData',ud, ... 'String',s, ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -