From 1bd08bd07b41bb6e6a7430bd7afcff6056e62ead Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Mon, 22 Jul 2019 16:09:45 -0600 Subject: [PATCH] plot_shock_decomposition: support shock_groups --- src/gui_plot_shock_decomposition.m | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/gui_plot_shock_decomposition.m b/src/gui_plot_shock_decomposition.m index 1a51d2d..50b3a7a 100644 --- a/src/gui_plot_shock_decomposition.m +++ b/src/gui_plot_shock_decomposition.m @@ -405,12 +405,26 @@ handles.pushbuttonClose = uicontrol( ... 'Value', 0); num = num + 1; - handles.use_shock_groups = uicontrol(... + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'use_shock_groups', ... + 'Style', 'text', ... + 'Units', 'normalized', ... + 'Position', [spc*3 top-num*dheight dwidth*1.5 dheight/2], ... + 'String', 'use_shock_groups:', ... + 'HorizontalAlignment', 'left'); + + shock_group_options = {''}; + if isfield(M_, 'shock_groups') + shock_group_options = [shock_group_options; fieldnames(M_.shock_groups)]; + end + handles.use_shock_groups = uicontrol( ... 'Parent', handles.uipanelResults, ... - 'Style', 'checkbox',... + 'Tag', 'use_shock_groups', ... + 'Style', 'popupmenu', ... 'Units', 'normalized', ... - 'Position', [spc top-num*dheight 1-spc*4 dheight/2], ... - 'String', 'use_shock_groups'); + 'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ... + 'String', shock_group_options); end function pushbuttonPlotShockDecomposition_Callback(hObject, ~) @@ -497,7 +511,8 @@ handles.pushbuttonClose = uicontrol( ... if handles.write_xls.Value options_.plot_shock_decomp.write_xls = true; end - + + options_.plot_shock_decomp.use_shock_groups = handles.use_shock_groups.String{handles.use_shock_groups.Value}; options_.plot_shock_decomp.realtime = handles.realtime.Value - 1; gui_tools.project_log_entry('Running plot shock decomposition', '...'); -- GitLab