Skip to content
This repository was archived by the owner on Nov 25, 2018. It is now read-only.

Commit fe8902c

Browse files
committed
Set up initial UI objects and properties to save
1 parent 913c473 commit fe8902c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

saveGUIstate.m

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
function saveGUIstate(handles)
2+
3+
propertystruct = initializeproperties();
4+
end
5+
6+
function [propertystruct] = initializeproperties()
7+
% Initialize structure containing the default properties to save.
8+
% Fieldnames of propertystruct should match the 'Type' property of the UI
9+
% object to save. If the object has multiple types (e.g. uicontrol), then
10+
% nest the types under their overall object type (e.g. uicontrol.edit).
11+
% Strings (single or cell array) must match the property name(s).
12+
13+
propertystruct.figure = 'Position';
14+
propertystruct.axes = ''; % Nothing to save currently
15+
propertystruct.uipanel = ''; % Nothing to save currently
16+
propertystruct.uitabgroup = ''; % Nothing to save currently, introduced in R2014b
17+
propertystruct.uitab = ''; % Nothing to save currently, introduced in R2014b
18+
propertystruct.uitable = ''; % Nothing to save currently
19+
propertystruct.actxcontrol = ''; % Nothing to save currently
20+
propertystruct.uicontrol.togglebutton = 'Value';
21+
propertystruct.uicontrol.radiobutton = 'Value';
22+
propertystruct.uicontrol.checkbox = 'Value';
23+
propertystruct.uicontrol.edit = 'String';
24+
propertystruct.uicontrol.slider = {'Value', 'Min', 'Max', 'SliderStep'};
25+
propertystruct.uicontrol.listbox = {'String', 'Value', 'Min', 'Max'};
26+
propertystruct.uicontrol.popupmenu = {'String', 'Value'};
27+
propertystruct.uicontrol.text = ''; % Nothing to save currently
28+
end

0 commit comments

Comments
 (0)