function finflag=chkwtsett(handles,WTval,Wnameval,Order,Shift)

if strcmp(WTval,'Select...')
    msgbox('Please select a wavelet transform!','Error #023');
    flagWT=0;
else
    flagWT=1;
end
if strcmp(Wnameval,'Select...')
    msgbox('Please select a wavelet!','Error #024');
    flagWname=0;
else
    flagWname=1;
end
if iscell(WTval)
    WT2val = WTval{get(handles.popupmenu2,'Value')};
    if ~(strcmp(WT2val,'1D Complex Wavelet Transform') || strcmp(WT2val,'2D Complex Wavelet Transform') || strcmp(WT2val,'3D Complex Wavelet Transform'))
        W2nameval = Wnameval{get(handles.popupmenu3,'Value')};
        if ~(strcmp(W2nameval,'Haar') || strcmp(W2nameval,'Meyer') || strcmp(W2nameval,'Pseudo-discrete Meyer') || strcmp(W2nameval,'Mexican Hat') || strcmp(W2nameval,'Morlet') || strcmp(W2nameval,'Chui-Lian 2') ...
                || strcmp(W2nameval,'Lebrun-Vetterli') || strcmp(W2nameval,'Donovan-Geronimo-Hardin-Massopust') || strcmp(W2nameval,'Farras'))
            if isempty(Order)
                msgbox('Please input a wavelet order!','Error #025');
                flagEmptyOrder=0;
            else
                flagEmptyOrder=1;
            end
        else
            flagEmptyOrder=1;
        end
    else
        flagEmptyOrder=1;
    end
else
    flagEmptyOrder=0;
end
if iscell(WTval)
    WT2val = WTval{get(handles.popupmenu2,'Value')};
    if (strcmp(WT2val,'1D Discrete Fractional Wavelet Transform') || strcmp(WT2val,'2D Discrete Fractional Wavelet Transform'))
        if isempty(Shift)
            msgbox('Please input a shift parameter!','Error #026');
            flagEmptyShift=0;
        else
            flagEmptyShift=1;
        end
    elseif strcmp(WT2val,'1D Continuous Wavelet Transform')
        if isempty(Shift)
            msgbox('Please input scale parameter(s)!','Error #027');
            flagEmptyShift=0;
        else
            flagEmptyShift=1;
        end
    else
        flagEmptyShift=1;
    end
else
    flagEmptyShift=0;
end
if iscell(WTval)
    WT2val = WTval{get(handles.popupmenu2,'Value')};
    if (strcmp(WT2val,'1D Discrete Fractional Wavelet Transform') || strcmp(WT2val,'2D Discrete Fractional Wavelet Transform') || strcmp(WT2val,'1D Discrete Fractional Wavelet Transform (causal)') || strcmp(WT2val,'2D Discrete Fractional Wavelet Transform (causal)') || strcmp(WT2val,'2D Quincunx Wavelet Transform'))
        if ~all(ismember(Order,'.1234567890-'))
            msgbox('Input of wavelet order is incorrect!','Error #028');
            flagBadOrder=0;
        elseif str2num(Order)<-0.5
            msgbox('Too small value of the wavelet order!','Error #029');
            flagBadOrder=0;
        else
            flagBadOrder=1;
            if (strcmp(WT2val,'1D Discrete Fractional Wavelet Transform (causal)') || strcmp(WT2val,'2D Discrete Fractional Wavelet Transform (causal)'))
                set(handles.edit17,'String',num2str((str2num(Order)+1)/2));
            end
        end
    else
        if ~all(ismember(Order,'.1234567890-'))
            msgbox('Input of the wavelet order is incorrect!','Error #030');
            flagBadOrder=0;
        elseif str2num(Order)<1
            if (strcmp(W2nameval,'Complex Gaussian') ||strcmp(W2nameval,'Complex Morlet') ||strcmp(W2nameval,'Shannon') ||strcmp(W2nameval,'Frequency B-spline'))
                flagBadOrder=1;
            else
                msgbox('Too small value of the wavelet order!','Error #031');
                flagBadOrder=0;
            end
        else
            flagBadOrder=1;
        end
    end
else
    flagBadOrder=0;
end
if iscell(WTval)
    WT2val = WTval{get(handles.popupmenu2,'Value')};
    if (strcmp(WT2val,'1D Discrete Fractional Wavelet Transform') || strcmp(WT2val,'2D Discrete Fractional Wavelet Transform') || strcmp(WT2val,'1D Discrete Fractional Wavelet Transform (causal)') || strcmp(WT2val,'2D Discrete Fractional Wavelet Transform (causal)'))
        if ~all(ismember(Shift,'.1234567890-'))
            msgbox('Input of the shift parameter is incorrect!','Error #032');
            flagBadShift=0;
        else
            flagBadShift=1;
        end
    elseif strcmp(WT2val,'1D Continuous Wavelet Transform')
        scalechk=strfind(Shift,':');
        if ~all(ismember(Shift,'.1234567890:'))
            msgbox('Input of scale parameter(s) is incorrect!','Error #033');
            flagBadShift=0;
        elseif ~isempty(scalechk)
            scalerang=sscanf(Shift,'%f:%f',[1,inf]);
            if scalerang(1)>scalerang(2)
                msgbox('Input of scale parameters is incorrect!','Error #034');
                flagBadShift=0;
            else
                flagBadShift=1;
            end
        else
            flagBadShift=1;
        end
    else
        flagBadShift=1;
    end
else
    flagBadShift=0;
end

if (flagWT+flagWname+flagEmptyOrder+flagEmptyShift+flagBadOrder+flagBadShift==6)
    finflag=1;
else
    finflag=0;
end

end