www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregGui/@rbgroup/doSetup.m

    function doSetup(obj)
%DOSETUP Create internal listeners

%  Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc.


obj.list=[ ...
    handle.listener(obj,obj.findprop('Position'),'PropertyPostSet',@i_setpos);...
    handle.listener(obj,obj.findprop('Parent'),'PropertyPostSet',@i_setparent);...
    handle.listener(obj,obj.findprop('Visible'),'PropertyPostSet',@i_setvisible);...
    handle.listener(obj,obj.findprop('nx'),'PropertyPostSet',@i_setdims);...
    handle.listener(obj,obj.findprop('ny'),'PropertyPostSet',@i_setdims);...
    handle.listener(obj,obj.findprop('gapx'),'PropertyPostSet',@i_setgap);...
    handle.listener(obj,obj.findprop('gapy'),'PropertyPostSet',@i_setgap);...
    handle.listener(obj,obj.findprop('enable'),'PropertyPostSet',@i_setenable);...
    handle.listener(obj,obj.findprop('enablearray'),'PropertyPostSet',@i_setenable);...
    handle.listener(obj,obj.findprop('value'),'PropertyPostSet',@i_setvalue);...
    handle.listener(obj,obj.findprop('string'),'PropertyPostSet',@i_setstring);...
    handle.listener(obj,obj.findprop('selected'),'PropertyPostSet',@i_setsel);...
    handle.listener(obj,obj.findprop('callback'),'PropertyPostSet',@i_setcallback);...
    handle.listener(obj,obj.findprop('foregroundcolor'),'PropertyPostSet',@i_setfgcol);...
    handle.listener(obj,obj.findprop('backgroundcolor'),'PropertyPostSet',@i_setbgcol);...
    ];
obj.cblist = handle.listener(obj,'SelectionChange','');
obj.connect(xregfigurehook(obj.parent),'up');


function i_setfgcol(srcobj,evt)
obj=evt.AffectedObject;
obj.doGridSet('foregroundcolor',obj.foregroundcolor);

function i_setbgcol(srcobj,evt)
obj=evt.AffectedObject;
obj.doGridSet('backgroundcolor',obj.backgroundcolor);

function i_setpos(srcobj,evt)
evt.AffectedObject.doPosition;

function i_setparent(srcobj,evt)
evt.AffectedObject.doParent;

function i_setvisible(srcobj,evt)
evt.AffectedObject.doVisible;

function i_setenable(srcobj,evt)
evt.AffectedObject.doEnable;

function i_setdims(srcobj,evt)
obj=evt.AffectedObject;
obj.doGridSet('dimension',[obj.ny obj.nx]);
obj.doCreateRBs;
obj.doString;
obj.doValue;

function i_setgap(srcobj,evt)
obj=evt.AffectedObject;
obj.doGridSet('gapx',obj.gapx, 'gapy',obj.gapy);

function i_setstring(srcobj,evt)
evt.AffectedObject.doString;

function i_setvalue(srcobj,evt)
evt.AffectedObject.doValue;

function i_setsel(srcobj,evt)
sel=evt.NewValue;
obj=evt.AffectedObject;
vals=zeros(obj.ny,obj.nx);
if sel
    vals(sel)=1;
end
obj.Value=vals;

function i_setcallback(srcobj,evt)
evt.AffectedObject.doCallback;