⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f_pushbutton.asv

📁 digital signal processing常用工具箱
💻 ASV
字号:
function hc_push = f_pushbutton (pos,nrow,ncol,row,col,label,fcolor,bcolor,cback,tipstr,wbox,hbox,fsize);

%F_PUSHBUTTON: Create pushbutton control
%
% Usage: hc_push = f_pushbutton (pos,nrow,ncol,row,col,label,fcolor,bcolor,cback,tipstr,wbox,hbox,fsize);
%
% Inputs: 
%           pos    = position vector of axes
%           nrow   = number of rows of buttons
%           ncol   = number of columns of buttons
%           row    = row number (1 to nbut)
%           col    = column number (1 to 2) 
%           label  = string containing check box label
%           fcolor = foreground color
%           bcolor = background color
%           cback  = callback string when button is pushed
%           tipstr = tool tip string
%           wbox   = optional width of box as a fraction of
%                    pos(3).  Default: 0.42
%           hbox   = optional height of box as a fraction of
%                    pos(4).  Default: 0.16
% Outputs: 
%           hc_push = handle of push button control

% Initialize

if (nargin < 11) | isempty(wbox)
    wbox = 0.42*pos(3);
end
if (nargin < 12) | isempty(hbox)
    hbox = 0.16*pos(4);
end
waxis = pos(3);
haxis = pos(4);
dw = (waxis - ncol*wbox)/(ncol+1);
dh = (haxis - nrow*hbox)/(nrow+1);
pos0 = [pos(1)+dw+(col-1)*(wbox+dw), pos(2)+haxis-row*(dh+hbox), wbox, hbox];

% Create pushbutton

hc_push = uicontrol(gcf,...
   'Style','pushbutton',...
   'Units','normalized',...
   'Position',pos0,...
   'String',label,...
   'ForeGroundColor',fcolor,...
   'BackGroundColor',bcolor,...
   'Tooltipstring',tipstr,...
   'Visible','on',...
   'Callback',cback);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -