Double clicking on axes
13 ビュー (過去 30 日間)
古いコメントを表示
I am designing a GUI that requires toggles for axes equal, grid on/off, etc. These toggles work perfectly until the user double clicks on the axes, then they are overridden. Almost every other built-in function like this has some documentation available on how to control it, but I cannot find any documentation on this function.
If anybody could point me to a resource or tell me how to get into this function, it would be greatly appreciated! I do not necessarily want to stop the function, but rather control it to turn the toggles on/off or even read the status of the toggles and keep them consistent.
Any help is greatly appreciated! ~Josh
1 件のコメント
tasadduq hussain
2015 年 5 月 24 日
i need a code for signal value selection when i click on signal it give me selection part of signal in axes gui
回答 (4 件)
Matt Fig
2011 年 5 月 10 日
It works fine here. How are you doing things differently than this? I can double-click all I want on the axes and the toggles still work...
function [] = GUI_axes()
% Problem with double-clicking on axes de-activating toggle callbacks?
S.fh = figure('units','pixels',...
'position',[200 200 200 200],...
'menubar','none',...
'numbertitle','off',...
'name','GUI_axes',...
'resize','off');
S.ax = axes('units','pixels',...
'position',[30 70 160 120],...
'fontsize',8,...
'nextplot','replacechildren');
S.tb = uicontrol('style','toggle',...
'units','pixels',...
'position',[10 10 80 20],...
'call',{@tb_cb,S},...
'string','Square');
S.tb(2) = uicontrol('style','toggle',...
'units','pixels',...
'position',[100 10 80 20],...
'call',{@tb_cb,S},...
'string','Grid');
function [] = tb_cb(varargin)
% Callback for toggles.
if isequal(varargin{1},S.tb(1))
if get(S.tb(1),'value')
axis(S.ax,'square')
else
axis(S.ax,'normal')
end
else
if get(S.tb(2),'value')
grid(S.ax,'on')
else
grid(S.ax,'off')
end
end
end
end
9 件のコメント
Walter Roberson
2011 年 5 月 11 日
Double click of the axes is perhaps being handled by the axes ButtonDownFcn .
Double-click does not have a special handler, not at the MATLAB level: the button down function checks SelectionType .
Question: could you perhaps simply turn HitTest off on the axes ??
tasadduq hussain
2015 年 5 月 24 日
i need a code for axes gui... when i click on axes the signal that on axes, this show a part of selection where i click on signal
0 件のコメント
tasadduq hussain
2015 年 5 月 24 日
i need a code for axes mouse move over and selection of signals
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!