function varargout = kalkulacka(varargin)
% KALKULACKA MATLAB code for kalkulacka.fig
%      KALKULACKA, by itself, creates a new KALKULACKA or raises the existing
%      singleton*.
%
%      H = KALKULACKA returns the handle to a new KALKULACKA or the handle to
%      the existing singleton*.
%
%      KALKULACKA('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in KALKULACKA.M with the given input arguments.
%
%      KALKULACKA('Property','Value',...) creates a new KALKULACKA or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before kalkulacka_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to kalkulacka_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help kalkulacka

% Last Modified by GUIDE v2.5 31-Dec-2018 21:56:10

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @kalkulacka_OpeningFcn, ...
                   'gui_OutputFcn',  @kalkulacka_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before kalkulacka is made visible.
function kalkulacka_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to kalkulacka (see VARARGIN)

% Choose default command line output for kalkulacka
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes kalkulacka wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = kalkulacka_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in plus.
function plus_Callback(hObject, eventdata, handles)
% hObject    handle to plus (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
vysl = str2num (get(handles.cisloA,'String')) + str2num (get(handles.cisloB,'String'));
set(handles.vysl,'String',vysl);
% --- Executes on button press in minus.

function minus_Callback(hObject, eventdata, handles)
% hObject    handle to minus (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
vys = str2num (get(handles.cisloA,'String')) - str2num (get(handles.cisloB,'String'));
set(handles.vys,'String',vys);

% --- Executes on button press in krat.
function krat_Callback(hObject, eventdata, handles)
% hObject    handle to krat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
vysl = str2num (get(handles.cisloA,'String')) * str2num (get(handles.cisloB,'String'));
set(handles.vysl,'String',vysl);

% --- Executes on button press in deleno.
function deleno_Callback(hObject, eventdata, handles)
% hObject    handle to deleno (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
vysl = str2num (get(handles.cisloA,'String')) / str2num (get(handles.cisloB,'String'));
if str2num (get(handles.cisloB,'String'))== 0
    set(handles.vysl,'String','Nelze');
else
    set(handles.vysl,'String',vysl);
end

function cisloA_Callback(hObject, eventdata, handles)
% hObject    handle to cisloA (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of cisloA as text
%        str2double(get(hObject,'String')) returns contents of cisloA as a double


% --- Executes during object creation, after setting all properties.
function cisloA_CreateFcn(hObject, eventdata, handles)
% hObject    handle to cisloA (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function cisloB_Callback(hObject, eventdata, handles)
% hObject    handle to cisloB (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of cisloB as text
%        str2double(get(hObject,'String')) returns contents of cisloB as a double


% --- Executes during object creation, after setting all properties.
function cisloB_CreateFcn(hObject, eventdata, handles)
% hObject    handle to cisloB (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
