Skip to content
Snippets Groups Projects
Verified Commit b732a77f authored by Houtan Bastani's avatar Houtan Bastani
Browse files

clean up file

parent 4a85ce57
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ gui_size = gui_tools.get_gui_elements_size(tabId);
do_not_check_all_results = 0;
% --- PANELS -------------------------------------
% Panels
handles.uipanelResults = uipanel( ...
'Parent', tabId, ...
'Tag', 'uipanelVars', 'BackgroundColor', special_color,...
......@@ -62,7 +62,7 @@ handles.uipanelComm = uipanel( ...
'Units', 'normalized', 'Position', [0.01 0.09 0.98 0.09], ...
'Title', 'Current command options:');
% --- STATIC TEXT -------------------------------------
% Text
uicontrol( ...
'Parent', tabId, 'Tag', 'text7', ...
'Style', 'text', 'BackgroundColor', bg_color,...
......@@ -79,7 +79,6 @@ uicontrol( ...
'String', 'Select endogenous variables that will be used in estimation:', ...
'HorizontalAlignment', 'left');
if ~isfield(model_settings, 'estimation')
model_settings.estimation = struct();
end
......@@ -102,8 +101,7 @@ handles.estimation = uicontrol( ...
'TooltipString', comm_str, ...
'HorizontalAlignment', 'left');
% --- PUSHBUTTONS -------------------------------------
% Buttons
handles.pushbuttonEstimation = uicontrol( ...
'Parent', tabId, ...
'Tag', 'pushbuttonSimulation', ...
......@@ -157,7 +155,6 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
function uipanelResults_CreateFcn()
results = dynare_gui_.est_results;
names = fieldnames(results);
num_groups = size(names,1);
current_result = 1;
......@@ -186,10 +183,13 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
% Create slider
if numTabResults > maxDisplayed
sld = uicontrol('Style', 'slider',...
uicontrol('Style', 'slider',...
'Parent', tabs_panel, ...
'Min',0,'Max',numTabResults - maxDisplayed,'Value',numTabResults - maxDisplayed ,...
'Units','normalized','Position',[0.968 0 .03 1],...
'Min', 0, ...
'Max', numTabResults - maxDisplayed, ...
'Value', numTabResults - maxDisplayed , ...
'Units', 'normalized', ...
'Position', [0.968 0 .03 1], ...
'Callback', {@scrollPanel_Callback,num,numTabResults});
end
......@@ -214,18 +214,17 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
handles.num_results=current_result-1;
function checkbox_Callback(hObject, callbackdata, comm_option)
function checkbox_Callback(hObject, ~, comm_option)
if isempty(comm_option)
return
end
value = get(hObject, 'Value');
num_options = size(comm_option, 2);
if isfield(model_settings, 'estimation')
user_options = model_settings.estimation;
else
user_options = struct();
end
if value
if hObject.Value
for i = 1:num_options
option_value = comm_option(i).option;
indx = findstr(comm_option(i).option, '.');
......@@ -267,9 +266,8 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
model_settings.estimation = user_options;
comm_str = gui_tools.command_string('estimation', user_options);
set(handles.estimation, 'String', comm_str);
set(handles.estimation, 'TooltipString', comm_str);
handles.estimation.String = comm_str;
handles.estimation.TooltipString = comm_str;
if ~do_not_check_all_results
check_all_result_option();
......@@ -284,13 +282,13 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
end
function scrollPanel_Callback(hObject, ~, tab_index, num_results)
move = num_results - maxDisplayed - floor(get(hObject, 'Value'));
move = num_results - maxDisplayed - floor(hObject.Value);
for iiii = 1:num_results
if iiii <= move || iiii > move+maxDisplayed
set(handles.tab_results(tab_index, iiii), 'Visible', 'off');
handles.tab_results(tab_index, iiii).Visible = 'off';
else
set(handles.tab_results(tab_index, iiii), 'Visible', 'on');
set(handles.tab_results(tab_index, iiii), 'Position', [3 top_position-(iiii-move)*2 60 2]);
handles.tab_results(tab_index, iiii).Visible = 'on';
handles.tab_results(tab_index, iiii).Position = [3 top_position-(iiii-move)*2 60 2];
end
end
end
......@@ -337,7 +335,7 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
end
jj = jj+1;
end
set(handles.tab_results(num,ii), 'Value', selected);
handles.tab_results(num,ii).Value = selected;
ii = ii+1;
end
end
......@@ -345,11 +343,6 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
end
function pushbuttonEstimation_Callback(hObject, ~)
if ~any([handles.endoTable.Data{:, 1}])
gui_tools.show_warning('Please select variables');
uicontrol(hObject);
return
end
handles.pushbuttonResults.Enable = 'off';
old_options = options_;
old_oo = oo_;
......@@ -394,12 +387,12 @@ handles.pushbuttonCommandDefinition = uicontrol( ...
function pushbuttonReset_Callback(~, ~)
handles.endoTable.Data(:, 1) = {false};
for ii = 1:handles.num_results
set(handles.results(ii),'Value',0);
handles.results(ii).Value = 0;
end
model_settings.estimation = struct();
comm_str = gui_tools.command_string('estimation', model_settings.estimation);
set(handles.estimation, 'String', comm_str);
set(handles.estimation, 'TooltipString', comm_str);
handles.estimation.String = comm_str;
handles.estimation.TooltipString = comm_str;
end
function pushbuttonCommandDefinition_Callback(~, ~)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment