function varargout = choosedeck(varargin)
% CHOOSEDECK M-file for choosedeck.fig
% CHOOSEDECK by itself, creates a new CHOOSEDECK or raises the
% existing singleton*.
%
% H = CHOOSEDECK returns the handle to a new CHOOSEDECK or the handle to
% the existing singleton*.
%
% CHOOSEDECK('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CHOOSEDECK.M with the given input arguments.
%
% CHOOSEDECK('Property','Value',...) creates a new CHOOSEDECK or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before choosedeck_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to choosedeck_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 choosedeck
% Last Modified by GUIDE v2.5 28-Oct-2004 13:19:06
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @choosedeck_OpeningFcn, ...
'gui_OutputFcn', @choosedeck_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(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 choosedeck is made visible.
function choosedeck_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 choosedeck (see VARARGIN)
% Choose default command line output for choosedeck
handles.output = 'Yes';
set(hObject,'Color',[0.5020 0.5020 0.2510]);
% Update handles structure
guidata(hObject, handles);
showdecks(handles)
% Insert custom Title and Text if specified by the user
% Hint: when choosing keywords, be sure they are not easily confused
% with existing figure properties. See the output of set(figure) for
% a list of figure properties.
if(nargin > 3)
for index = 1:2:(nargin-3),
if nargin-3==index break, end
switch lower(varargin{index})
case 'title'
set(hObject, 'Name', varargin{index+1});
case 'string'
set(handles.text1, 'String', varargin{index+1});
end
end
end
% Determine the position of the dialog - centered on the callback figure
% if available, else, centered on the screen
FigPos=get(0,'DefaultFigurePosition');
OldUnits = get(hObject, 'Units');
set(hObject, 'Units', 'pixels');
OldPos = get(hObject,'Position');
FigWidth = OldPos(3);
FigHeight = OldPos(4);
if isempty(gcbf)
ScreenUnits=get(0,'Units');
set(0,'Units','pixels');
ScreenSize=get(0,'ScreenSize');
set(0,'Units',ScreenUnits);
FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
else
GCBFOldUnits = get(gcbf,'Units');
set(gcbf,'Units','pixels');
GCBFPos = get(gcbf,'Position');
set(gcbf,'Units',GCBFOldUnits);
FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
(GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
end
FigPos(3:4)=[FigWidth FigHeight];
set(hObject, 'Position', FigPos);
set(hObject, 'Units', OldUnits);
% Make the GUI modal
set(handles.CDS,'WindowStyle','modal')
% UIWAIT makes choosedeck wait for user response (see UIRESUME)
uiwait(handles.CDS);
% --- Outputs from this function are returned to the command line.
function varargout = choosedeck_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;
% The figure can be deleted now
delete(handles.CDS);
% --- Executes when user attempts to close CDS.
function CDS_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to CDS (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isequal(get(handles.CDS, 'waitstatus'), 'waiting')
% The GUI is still in UIWAIT, us UIRESUME
uiresume(handles.CDS);
else
% The GUI is no longer waiting, just close it
delete(handles.CDS);
end
% --- Executes on button press in style1.
function style1_Callback(hObject, eventdata, handles)
% hObject handle to style1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style1
handles.output=1;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style5.
function style5_Callback(hObject, eventdata, handles)
% hObject handle to style5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style5
handles.output=5;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style9.
function style9_Callback(hObject, eventdata, handles)
% hObject handle to style9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style9
handles.output=9;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style2.
function style2_Callback(hObject, eventdata, handles)
% hObject handle to style2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style2
handles.output=2;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style6.
function style6_Callback(hObject, eventdata, handles)
% hObject handle to style6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style6
handles.output=6;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style10.
function style10_Callback(hObject, eventdata, handles)
% hObject handle to style10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style10
handles.output=10;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style3.
function style3_Callback(hObject, eventdata, handles)
% hObject handle to style3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style3
handles.output=3;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style7.
function style7_Callback(hObject, eventdata, handles)
% hObject handle to style7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style7
handles.output=7;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style11.
function style11_Callback(hObject, eventdata, handles)
% hObject handle to style11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style11
handles.output=11;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style4.
function style4_Callback(hObject, eventdata, handles)
% hObject handle to style4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style4
handles.output=4;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style8.
function style8_Callback(hObject, eventdata, handles)
% hObject handle to style8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style8
handles.output=8;
guidata(hObject, handles);
uiresume(handles.CDS);
% --- Executes on button press in style12.
function style12_Callback(hObject, eventdata, handles)
% hObject handle to style12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of style12
handles.output=12;
guidata(hObject, handles);
uiresume(handles.CDS);
function showdecks(handles)
for i=1:12
crdimg=imread(['cards/Xx' int2str(i) '.jpg']);
axes(eval(['handles.dt' int2str(i)]))
image(crdimg);
axis off
end