IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
reportdlg.m
Go to the documentation of this file.
1 %> @ingroup gruigroup
2 %> @file
3 %> @brief Report Dialog Box
4 %> @image html Screenshot-reportdlg.png
5 %> Visualization of object report. Called when the user chooses <em>Visualize->Report</em>
6 
7 %> @cond
8 function varargout = reportdlg(varargin)
9 
10 % Edit the above text to modify the response to help reportdlg
11 
12 % Last Modified by GUIDE v2.5 09-Feb-2011 17:03:12
13 
14 % Begin initialization code - DO NOT EDIT
15 gui_Singleton = 1;
16 gui_State = struct('gui_Name', mfilename, ...
17  'gui_Singleton', gui_Singleton, ...
18  'gui_OpeningFcn', @reportdlg_OpeningFcn, ...
19  'gui_OutputFcn', @reportdlg_OutputFcn, ...
20  'gui_LayoutFcn', [] , ...
21  'gui_Callback', []);
22 if nargin && ischar(varargin{1})
23  gui_State.gui_Callback = str2func(varargin{1});
24 end
25 
26 if nargout
27  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
28 else
29  gui_mainfcn(gui_State, varargin{:});
30 end
31 % End initialization code - DO NOT EDIT
32 
33 
34 % --- Executes just before reportdlg is made visible.
35 function reportdlg_OpeningFcn(hObject, eventdata, handles, varargin)
36 
37 % Choose default command line output for reportdlg
38 handles.output = hObject;
39 % Update handles structure
40 guidata(hObject, handles);
41 
42 if numel(varargin) > 0
43  set(handles.editText, 'String', varargin{1});
44 else
45  set(handles.editText, 'String', '?');
46 end;
47 gui_set_position(hObject);
48 
49 
50 
51 % --- Outputs from this function are returned to the command line.
52 function varargout = reportdlg_OutputFcn(hObject, eventdata, handles)
53 varargout{1} = handles.output;
54 
55 
56 % --- Executes on button press in pushbutton_save.
57 function pushbutton_save_Callback(hObject, eventdata, handles)
58 try
59  [name, path, filterindex] = uiputfile({'*.txt', 'MATLAB source file(*.m)'; '*.*', 'All files'}, 'Save as', 'log.txt');
60  if name > 0
61  filename = fullfile(path, name);
62  h = fopen(filename, 'w');
63  fwrite(h, get(handles.editText, 'string'));
64  fclose(h);
65  irverbose(['File ''' filename ''' saved successfully!'], 1);
66  end;
67 catch ME
68  irerrordlg(ME.message, 'Error saving file!');
69 end;
70 
71 function editText_Callback(hObject, eventdata, handles)
72 % hObject handle to editText (see GCBO)
73 % eventdata reserved - to be defined in a future version of MATLAB
74 % handles structure with handles and user data (see GUIDATA)
75 
76 % Hints: get(hObject,'String') returns contents of editText as text
77 % str2double(get(hObject,'String')) returns contents of editText as a double
78 
79 
80 % --- Executes during object creation, after setting all properties.
81 function editText_CreateFcn(hObject, eventdata, handles)
82 % hObject handle to editText (see GCBO)
83 % eventdata reserved - to be defined in a future version of MATLAB
84 % handles empty - handles not created until after all CreateFcns called
85 
86 % Hint: edit controls usually have a white background on Windows.
87 % See ISPC and COMPUTER.
88 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
89  set(hObject,'BackgroundColor','white');
90 end
91 %> @endcond
92 
function irverbose(in s, in level)
function gui_set_position(in hObject)