Change positions of specific compoent based on conditions
1 回表示 (過去 30 日間)
古いコメントを表示
Hey Guys,
So I want change the position of component such as list box and edit text. I already know how to change the positions but I want to change it based on conditions like if a certain item is selected from a different list box then it will go up y units and then it could go up another y units when an item is selected from another list box. But not allowing each selection from each list box to interfere with each other.
Since I am using GUIDE.... I am think of setting up like
if (conditions met)
set(handles.listbox,'Position',[(current) (current + y) (current) (current)]);
elseif (opposite conditions met)
set(handles.listbox,'Position',[(prev/origin) (prev/origin) (prev/origin) (prev/origin)]);
some where else in the code for a different list box
if (conditions met)
set(handles.listbox,'Position',[(current) (current + y) (current) (current)]);
elseif (opposite conditions met)
set(handles.listbox,'Position',[(prev/origin) (prev/origin) (prev/origin) (prev/origin)]);
%prev - previous value
%origin - original value
%current - current value
Now the only problem is I do not know how to set these numbers to be as dynamics as I want it to be.
0 件のコメント
採用された回答
Sara
2014 年 12 月 23 日
Use the handles variable to carry around your values. In the opening function, do:
handles.origin = .....
handles.prev = handles.origin
Then, every time you change position, you'll have to set:
handles.current = ...
handles.prev = handles.current
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!