我嘗試在按住並釋放除輸入和麪板按鈕之外的其他位置的鼠標按鈕的同時,使uipanel更改邊框顏色。Matlab GUI回調問題
function [oldpropvalues,varargout]=DisableFigure(handlearray,prop,propvalue,varargin);
oldpropvalues=get(handlearray,prop);
%this IF is used to highlight the "modal" panel when anywhere outside it is pressed
if length(varargin)==2
%these two are the old windowbutton functions which will be put back when the window is put back to normal.
varargout{1}=get(varargin{1},'windowbuttondownfcn');
varargout{2}=get(varargin{1},'windowbuttonupfcn');
set(varargin{1},'windowbuttondownfcn',['set(varargin{2},''bordertype'',''line'',''borderwidth'',2,''highlightcolor'',[0 0 0])']);
set(varargin{1},'windowbuttonupfcn',['set(varargin{2},''bordertype'',''beveledout'',''borderwidth'',1,''highlightcolor'',[1 1 1])']);
end
set(handlearray,prop,propvalue);
錯誤顯示 未定義變量 「varargin」 或類 「varargin」。
在評估圖WindowButtonDownFcn
未定義變量 「varargin」 或類 「varargin」 錯誤。
錯誤而評估圖WindowButtonUpFcn
非常感謝!它完美的作品。 –