我想复制GUI实现的here:
这是到目前为止我得到的:
// first create the GUI panel
figw = 220;
figh = 160;
close(1)
f = figure(1, "position", [0 0 figw figh]);
//PUSH TO STOP
hstop = uicontrol(f, "style", "pushbutton", "Min", 0, "Max", 1, "string", " STOP",..
"position", [10 10 61 50], "callback", "infiniteloop=%F");
// TRIGGERED MODE
htrig = uicontrol(f, "style", "radiobutton", "Min", 0, "Max", 1, "string", "free/trig", "value", 0,..
"position", [80 10 20 20]);
//httrig=uititle(htrig,"free/trig","r")
// BINNING x2
hbin = uicontrol(f, "style", "radiobutton", "Min", 0, "Max", 1, "value", 0,..
"position", [80 40 20 20]);
//htbin=uititle(hbin,"bin x2","r")
// GREYSCALE
hbri = uicontrol("style", "slider", "Min", 1, "Max", 255, "value", 128,..
"position", [10 70 200 20]);
//htbri=uititle(hbri,"greyscale")
// EXPOSURE (only for untriggered)
hexp = uicontrol("style", "slider", "Min", 1, "Max", 1200, "value", 40,..
"position", [10 120 200 20]);
//htexp=uititle(hexp,"exposure time")
我目前的主要问题是我找不到与已弃用的uicontrol
方法相对应的uititle
对象的等效属性/属性。
我确实可以使用文本框并找到解决方法,但是鉴于所有定位难题,这不是理想的解决方案。我想知道是否还有这样的属性可以接受英镑,并且像上述r
,t
,l
和b
那样放置在所描述的位置?感谢您的提前帮助。
答案 0 :(得分:1)
由于uicontrols的新布局功能,来自Enrico Segre(著名的Scilab贡献者)的著名uititle
可能会这样重生:
function t=uititle(h,text)
pos = h.Position;
pos(4)=pos(4)*2;
f = uicontrol("style","frame","position",pos,"layout","grid")
lay_opt = createLayoutOptions("grid", [2,1])
set(f,"layout_options",lay_opt);
c = createConstraints("grid");
h.parent = f;
t=uicontrol(f,"style","text","string",text,"horizontalalignment","center",...
"constraints",c);
endfunction
clf
sl=uicontrol("style","slider","position",[10 10 200 20])
uititle(sl,"a slider")