Mercurial > hg > ltpda
view m-toolbox/m/gui/ltpdv/callbacks/ltpdv_properties_build_props.m @ 10:75007001cbfe database-connection-manager
Check for binary only objects
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function ltpdv_properties_build_props(obj, mainfig) % Object class cl = class(obj); % Get setter methods ms = methods(cl); setters = ms(strmatch('set', ms)); % Draw properties panel panh = findobj(mainfig, 'Tag', 'LTPDVobjectProperties'); delete(get(panh, 'Children')) pmarg = 0.025; keyl = pmarg; keyh = 0.055; keyw = 0.3; keyb = 1-pmarg-keyh; vall = pmarg*2 + keyw; valw = 0.5; oldVals = {}; for kk=1:numel(setters) sfcn = setters{kk}; prop = lower(strrep(sfcn, 'set', '')); val = []; try val = obj.(prop); end if isa(val, 'ltpda_obj') val = char(val); end if isa(val, 'sym') val = char(val); end if ~isnumeric(val) oldVals = [oldVals {val}]; % Draw label sth = uicontrol(panh,'Style','text',... 'String', sfcn,... 'Units', 'normalized', ... 'BackgroundColor', 'w', ... 'Fontsize', 12, ... 'Position',[keyl keyb keyw keyh]); % Draw edit box eh = uicontrol(panh,'Style','edit',... 'String', val,... 'units', 'normalized', ... 'BackgroundColor', 'w', ... 'Fontsize', 12, ... 'Enable', 'on', ... 'Position',[vall keyb valw keyh]); keyb = keyb - pmarg - keyh; end end % Draw apply button pbh = uicontrol(panh,'Style','pushbutton',... 'String','Apply',... 'Callback', {@ltpdv_properties_apply, oldVals, obj, mainfig}, ... 'Units', 'normalized', ... 'Fontsize', 12, ... 'Position',[pmarg pmarg 0.15 0.05]); end