function handles=h_29_section_module(handles,module_x,module_y)

%-----------------------------------------------------------
%   Copyright(c) 2015
%	Center for Cognition and Brain Disorders, Hangzhou Normal University, Hangzhou 310015, China
%	Written by JIA Xi-Ze 201507
%	http://www.restfmri.net/
% 	Mail to Authors: jxz.rest@gmail.com, jiaxize@foxmail.com


handles=init_uicontrol(handles,module_x,module_y);
init_callback(handles);
end

function handles=init_uicontrol(handles,module_x,module_y)
ui_property_cell={  {'h_name','h_section_text',...
                    'tag','tag_section_text',...
                    'style','text',...
                    'position_xy',[module_x module_y],...
                    'string','Section:'},...
                    {'h_name','h_i_radiobtn',...
                    'tag','tag_i_radiobtn',...
                    'style','radiobutton',...
                    'position_xy',[100+module_x module_y],...
                    'string','I'},...
                    {'h_name','h_j_radiobtn',...
                    'tag','tag_j_radiobtn',...
                    'style','radiobutton',...
                    'position_xy',[150+module_x module_y],...
                    'string','J'},...
                    {'h_name','h_k_radiobtn',...
                    'tag','tag_k_radiobtn',...
                    'style','radiobutton',...
                    'position_xy',[200+module_x module_y],...
                    'string','K',...
                    'value',1},...
                    {'h_name','h_section_edit',...
                    'tag','tag_section_edit',...
                    'style','edit',...
                    'backgroundcolor',[1 1 1],...
                    'position',[250+module_x module_y-3 65 29]},...
                    };
                
 handles.h_section_ui_struct=draw_uicontrol_cell_h2x(handles.h_fig,ui_property_cell);    
               
end


function init_callback(handles)
h_fieldname_list=fieldnames(handles.h_section_ui_struct);
for i=1:length(h_fieldname_list)
    set(handles.h_section_ui_struct.(h_fieldname_list{i}),...
        'callback',{@the_uicontrol_callback}); 
end
end



function the_uicontrol_callback(hObject,eventdata)
handles=guidata(hObject);
section_radiobtn_list=[handles.h_section_ui_struct.h_i_radiobtn;
                       handles.h_section_ui_struct.h_j_radiobtn;
                       handles.h_section_ui_struct.h_k_radiobtn];

if strcmp(get(hObject,'style'),'radiobutton')
         RadioBtnSet(section_radiobtn_list,hObject);
end

end
