光说这个工具包的代码多牛X,怎么行?必须的亮出来让大家惊艳一下,了解一下之后我们的学习内容。
function varargout = pvox(varargin)
% pvox M-file for pvox.fig
% pvox, by itself, creates a new pvox or raises the existing
% singleton*.
%
% H = pvox returns the handle to a new pvox or the handle to
% the existing singleton*.
%
% pvox('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in pvox.M with the given input arguments.
%
% pvox('Property','Value',...) creates a new pvox or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before pvox_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to pvox_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
%
Copyright 2002-2003 The MathWorks, Inc.
%
Edit the above text to modify the response to help pvox
%
Last Modified by GUIDE v2.5 20-Jun-2006 15:33:37
%
Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @pvox_OpeningFcn, ...
'gui_OutputFcn', @pvox_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
addpath(genpath(pwd));
%
End initialization code - DO NOT EDIT
%
--- Executes just before pvox is made visible.
function pvox_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 pvox (see VARARGIN)
%
Choose default command line output for pvox
handles.output = hObject;
%
Update handles structure
guidata(hObject, handles);
pvox_init(handles);
%
SPLASH
%close splash screen, opened on line 122
global splash
close(splash);
%END SPLASH
%
--- Outputs from this function are returned to the command line.
function varargout = pvox_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 slider movement.
function slider_v_Callback(hObject, eventdata, handles)
% hObject handle to slider_v (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global PguiData WFNData ParsecData;
set(hObject,'Enable','inactive');
drawnow;
val = get(hObject,'Value');
switch PguiData.mode
case 'M1d'
update_M1d('slider_level',val);
case 'M2d'
update_M2d('slider_z',val);
case 'Mslice'
update_Mslice('slider_level',val);
otherwise
set(hObject,'Visible','off');
end
set(hObject,'Enable','on');
drawnow;
%
--- Executes during object creation, after setting all properties.
function edit_top_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_top (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.
%
SPLASH
%open a splash picture, closed on line 68
global splash
splash_pic = imread('./splash.jpg');
splash = dialog;
set(splash,'Position',[500 500 340 190]);
uicontrol(splash,'Style','pushbutton','Cdata',splash_pic,'Position',[20 20 300 150],'Enable','inactive');
%END SPLASH
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
%
--- Executes during object creation, after setting all properties.
function edit_right_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_right (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
%
--- Executes during object creation, after setting all properties.
function edit_left_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_left (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
%
--- Executes during object creation, after setting all properties.
function slider_v_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_v (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%
--- Executes during object creation, after setting all properties.
function slider_h_top_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_h_top (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%
--- Executes during object creation, after setting all properties.
function slider_h_middle_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_h_middle (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%
--- Executes during object creation, after setting all properties.
function slider_h_bottom_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_h_bottom (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%
--------------------------------------------------------------------
function menu_open_Callback(hObject, eventdata, handles)
% hObject handle to menu_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open_file;
%
--------------------------------------------------------------------
function menu_open_recent_Callback(hObject, eventdata, handles)
% hObject handle to menu_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global PguiData
PguiData.recent_out = {};
PguiData.recent_dat = {};
PguiData.recent_list = {};
%
Read in recent file list
try
recent = fopen('pTemp/recent.dat','r');
i = 1;
file_name = fgetl(recent);
while (file_name ~= -1)
PguiData.recent_out{i} = file_name;
file_name = fgetl(recent);
PguiData.recent_dat{i} = file_name;
[pathstr, name, ext, versn] = fileparts(file_name);
file_name = fgetl(recent);
PguiData.recent_list{i} = [PguiData.recent_out{i} ' (' name ext ')'];
i = i 1;
end
if (i == 1)
errordlg('No recent files');
return;
end
catch
errordlg('No recent files');
return;
end
open_recent;
%
--------------------------------------------------------------------
function menu_print_Callback(hObject, eventdata, handles)
% hObject handle to menu_print (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
click_print;
%
--------------------------------------------------------------------
function menu_close_Callback(hObject, eventdata, handles)
% hObject handle to menu_close (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close;
%
--------------------------------------------------------------------
function menu_undo_Callback(hObject, eventdata, handles)
% hObject handle to menu_undo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function menu_preferences_Callback(hObject, eventdata, handles)
% hObject handle to menu_preferences (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
prefs(handles);
%
--------------------------------------------------------------------
function menu_1d_Callback(hObject, eventdata, handles)
% hObject handle to menu_1d (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
modeswitch_M1d(handles);
%
--------------------------------------------------------------------
function menu_2d_Callback(hObject, eventdata, handles)
% hObject handle to menu_2d (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
modeswitch_M2d(handles);
%
--------------------------------------------------------------------
function menu_3d_Callback(hObject, eventdata, handles)
% hObject handle to menu_3d (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
modeswitch_M3d(handles);
%
--------------------------------------------------------------------
function menu_dos_Callback(hObject, eventdata, handles)
% hObject handle to menu_dos (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
modeswitch_Mdos(handles);
%
--------------------------------------------------------------------
function menu_slice_Callback(hObject, eventdata, handles)
% hObject handle to menu_slice (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
modeswitch_Mslice(handles);
%
--------------------------------------------------------------------
function menu_pot_Callback(hObject, eventdata, handles)
% hObject handle to menu_pot (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
graphswitch_pot(handles);
%
--------------------------------------------------------------------
function menu_rho_Callback(hObject, eventdata, handles)
% hObject handle to menu_rho (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
graphswitch_rho(handles);
%
--------------------------------------------------------------------
function menu_wfn_Callback(hObject, eventdata, handles)
% hObject handle to menu_wfn (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
graphswitch_wfn(handles);
%
--------------------------------------------------------------------
function menu_atoms_Callback(hObject, eventdata, handles)
% hObject handle to menu_atoms (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global PguiData;
if strncmp( (get(hObject,'Checked')), 'on',2)
PguiData.atoms=0;
set(hObject,'Checked','off')
switch PguiData.mode
case 'M3d'
update_M3d('atoms',0);
case 'Mslice'
update_Mslice('atoms',0);
otherwise
set(hObject,'Enable','inactive');
end
else
PguiData.atoms=1;
set(hObject,'Checked','on')
switch PguiData.mode
case 'M3d'
update_M3d('atoms',1);
case 'Mslice'
update_Mslice('atoms',1);
otherwise
set(hObject,'Enable','inactive');
end
end
%
--------------------------------------------------------------------
function menu_about_Callback(hObject, eventdata, handles)
% hObject handle to menu_about (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
about;
%
--------------------------------------------------------------------
function menu_helpbrowser_Callback(hObject, eventdata, handles)
% hObject handle to menu_helpbrowser (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
new;
%
--------------------------------------------------------------------
function menu_file_Callback(hObject, eventdata, handles)
% hObject handle to menu_file (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function menu_edit_Callback(hObject, eventdata, handles)
% hObject handle to menu_edit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function menu_view_Callback(hObject, eventdata, handles)
% hObject handle to menu_view (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function menu_help_Callback(hObject, eventdata, handles)
% hObject handle to menu_help (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
--------------------------------------------------------------------
function menu_capture_Callback(hObject, eventdata, handles)
% hObject handle to menu_help (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
click_capture;
%
--- Executes on slider movement.
function slider_h_top_Callback(hObject, eventdata, handles)
% hObject handle to slider_h_top (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global PguiData WFNData ParsecData;
set(hObject,'Enable','inactive');
drawnow;
val=get(hObject,'Value');
switch PguiData.mode
case 'M2d'
update_M2d('slider_level',val);
case 'M3d'
update_M3d('slider_level',val);
case 'Mdos'
update_Mdos('slider_iter',val);
case 'Mslice'
update_Mslice('slider_x',val);
otherwise
set(hObject,'Visible','off');
end
set(hObject,'Enable','on');
drawnow;
%
--- Executes on slider movement.
function slider_h_middle_Callback(hObject, eventdata, handles)
% hObject handle to slider_h_middle (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global PguiData WFNData;
set(hObject,'Enable','inactive');
drawnow;
val=get(hObject,'Value');
switch PguiData.mode
case 'Mslice'
update_Mslice('slider_y',val);
otherwise
set(hObject,'Visible','off');
end
set(hObject,'Enable','on');
drawnow;
%
--- Executes on slider movement.
function slider_h_bottom_Callback(hObject, eventdata, handles)
% hObject handle to slider_h_bottom (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global PguiData WFNData;
set(hObject,'Enable','inactive');
drawnow;
val=get(hObject,'Value');
switch PguiData.mode
case 'Mslice'
update_Mslice('slider_z',val);
otherwise
set(hObject,'Visible','off');
end
set(hObject,'Enable','on');
drawnow;
%
--- Executes on button press in togglebutton_top.
function togglebutton_top_Callback(hObject, eventdata, handles)
% hObject handle to togglebutton_top (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 togglebutton_top
global PguiData;
switch PguiData.mode
case 'M1d'
update_M1d('atomview',1);
case 'M2d'
update_M2d('top_down',1);
case 'M3d'
update_M3d('color',0);
case 'Mdos'
update_Mdos('cumulative', get(hObject,'Value') );
case 'Mslice'
set(hObject,'Value', get(hObject,'Max') );
otherwise
set(hObject,'Visible','off');
end
%
--- Executes on button press in togglebutton_bottom.
function togglebutton_middle_Callback(hObject, eventdata, handles)
% hObject handle to togglebutton_bottom (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 togglebutton_bottom
global PguiData;
switch PguiData.mode
case 'M1d'
update_M1d('atomview',0);
case 'M2d'
update_M2d('top_down',0);
case 'M3d'
update_M3d('color',1);
case 'Mdos'
update_Mdos('occupied', get(hObject,'Value') );
case 'Mslice'
set(hObject,'Value', get(hObject,'Max') );
otherwise
set(hObject,'Visible','off');
end
%
--- Executes on button press in togglebutton_middle.
function togglebutton_bottom_Callback(hObject, eventdata, handles)
% hObject handle to togglebutton_middle (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 togglebutton_middle
set(hObject,'Visible','off');
function edit_top_Callback(hObject, eventdata, handles)
% hObject handle to edit_top (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 edit_top as text
% str2double(get(hObject,'String')) returns contents of edit_top as a double
global PguiData WFNData;
val = get(hObject,'String');
switch PguiData.mode
case 'M1d'
update_M1d('edit_level',val);
case 'M2d'
update_M2d('edit_z',val);
case 'M3d'
update_M3d('edit_num_slices',val);
case 'Mslice'
update_Mslice('edit_level',val);
otherwise
set(hObject,'Visible','off');
end
function edit_right_Callback(hObject, eventdata, handles)
% hObject handle to edit_right (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 edit_right as text
% str2double(get(hObject,'String')) returns contents of edit_right as a double
global PguiData WFNData ParsecData;
val = get(hObject,'String');
switch PguiData.mode
case 'M1d'
update_M1d('edit_2',val);
case 'M2d'
update_M2d('edit_level',val);
case 'M3d'
update_M3d('edit_level',val);
case 'Mdos'
update_Mdos('edit_iter',val);
otherwise
set(hObject,'Visible','off');
end
function edit_left_Callback(hObject, eventdata, handles)
% hObject handle to edit_left (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 edit_left as text
% str2double(get(hObject,'String')) returns contents of edit_left as a double
global PguiData WFNData;
val = get(hObject,'String');
switch PguiData.mode
case 'M1d'
update_M1d('edit_1',val);
case 'M2d'
set(hObject,'Enable','inactive');
case 'M3d'
set(hObject,'Enable','inactive');
case 'Mdos'
update_Mdos('edit_width',val);
otherwise
set(hObject,'Visible','off');
end
%
--- Executes during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: place code in OpeningFcn to populate axes1
%
--- Executes during object creation, after setting all properties.
function figure1_CreateFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function text_h_top_CreateFcn(hObject, eventdata, handles)
% hObject handle to text_h_top (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function text_h_middle_CreateFcn(hObject, eventdata, handles)
% hObject handle to text_h_middle (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function text_h_bottom_CreateFcn(hObject, eventdata, handles)
% hObject handle to text_h_bottom (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function text_left_CreateFcn(hObject, eventdata, handles)
% hObject handle to text_left (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function text_right_CreateFcn(hObject, eventdata, handles)
% hObject handle to text_right (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function text_top_CreateFcn(hObject, eventdata, handles)
% hObject handle to text_top (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function togglebutton_top_CreateFcn(hObject, eventdata, handles)
% hObject handle to togglebutton_top (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function togglebutton_middle_CreateFcn(hObject, eventdata, handles)
% hObject handle to togglebutton_middle (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes during object creation, after setting all properties.
function togglebutton_bottom_CreateFcn(hObject, eventdata, handles)
% hObject handle to togglebutton_bottom (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
--- Executes on selection change in pulldown_left.
function pulldown_left_Callback(hObject, eventdata, handles)
% hObject handle to pulldown_left (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
Hints: contents = get(hObject,'String') returns pulldown_left contents as cell array
% contents{get(hObject,'Value')} returns selected item from pulldown_left
global PguiData WFNData;
val = get(hObject,'Value');
switch PguiData.mode
case 'M1d'
update_M1d('pulldown_1',val);
otherwise
set(hObject,'Visible','off');
end
%
--- Executes during object creation, after setting all properties.
function pulldown_left_CreateFcn(hObject, eventdata, handles)
% hObject handle to pulldown_left (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: popupmenu 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
%
--- Executes on selection change in pulldown_right.
function pulldown_right_Callback(hObject, eventdata, handles)
% hObject handle to pulldown_right (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
Hints: contents = get(hObject,'String') returns pulldown_right contents as cell array
% contents{get(hObject,'Value')} returns selected item from pulldown_right
global PguiData WFNData;
val = get(hObject,'Value');
switch PguiData.mode
case 'M1d'
update_M1d('pulldown_2',val);
otherwise
set(hObject,'Visible','off');
end
%
--- Executes during object creation, after setting all properties.
function pulldown_right_CreateFcn(hObject, eventdata, handles)
% hObject handle to pulldown_right (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
%
Hint: popupmenu 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
%
--- Executes when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%
Hint: delete(hObject) closes the figure
global pvoxView
pvoxView.closed = 1;
try
fig = pvoxView.atom;
if isfield(fig,'figure1') && ishandle(fig.figure1) && ~close(fig.figure1)
delete(fig.figure1);
end
catch
out_atom = lasterr
end
try
fig = pvoxView.iter;
if isfield(fig,'figure1') && ishandle(fig.figure1) && ~close(fig.figure1)
delete(fig.figure1);
end
catch
out_iter = lasterr
end
try
fig = pvoxView.about;
if isfield(fig,'figure1') && ishandle(fig.figure1) && ~close(fig.figure1)
delete(fig.figure1);
end
catch
out_about = lasterr
end
try
fig = pvoxView.recent;
if isfield(fig,'figure1') && ishandle(fig.figure1) && ~close(fig.figure1)
delete(fig.figure1);
end
catch
out_recent = lasterr
end
try
fig = pvoxView.open;
if isfield(fig,'figure1') && ishandle(fig.figure1) && ~close(fig.figure1)
delete(fig.figure1);
end
catch
out_open = lasterr
end
try
fig = pvoxView.pref;
if isfield(fig,'prefs') && ishandle(fig.prefs) && ~close(fig.prefs)
delete(fig.prefs);
end
catch
out_pref = lasterr
end
try
global pref;
if isfield(pref,'message')
fig = pref.message;
if fig && ~close(fig)
delete(fig);
end
end
catch
out_message = lasterr
end
try
if ishandle(hObject) %&& ~close(hObject)
delete(hObject);
else
%out_pvox = 'pvox closed'
end
catch
out_pvox = lasterr
end
原创文章,过冷水,未经授权,禁止私自转载,转载请联系作者,如果您希望加入Matlab仿真秀官方交流群和资料下载可加群:927550334