フィルターのクリア

Can I resize ALL my interface using 'Pixel' as 'Units'?

3 ビュー (過去 30 日間)
André
André 2013 年 8 月 27 日
We've made all the interface in Matlab code not using the GUIDE tool. Everything (distances and sizes) is parametrized and all the units are setted as 'Pixel'.
When make the 'Resize' 'On', just the main interface is able to be changed. Is there any command or function to make able the resize of all the interface without changing everything to 'Normalized'?
Thank you!

回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 8 月 27 日
Yes. See http://www.mathworks.com/help/matlab/ref/figure_props.html and look for ResizeFcn . When the window is resized, that function will be called. You can then have that function set() new sizes for whatever you want. Nothing has to have been defined as Normalized.
You might want to create your GUI in two stages. Start with a routine that creates all of the controls and axes, but does not worry about sizing each of them. Then, have a routine that checks the current window size and goes through and sizes all of the items as appropriate for the screen real-estate available. This second routine would also become your ResizeFcn callback.
  1 件のコメント
André
André 2013 年 8 月 28 日
That's a good way but I think I will keep changing to Normalized.
Thank you!

サインインしてコメントする。


Jan
Jan 2013 年 8 月 27 日
編集済み: Jan 2013 年 8 月 28 日
No, setting all units to 'normalized' is fine and efficient. Why do you want to avoid this?
Btw., the resulting resized GUI will look ridiculous, because characters will be much too bold and large for a good readability. Therefore smarter resize functions are recommended, such that comments, buttons, checkboxes keeps their size and mutual distance, while the data sections as axes and listboxes grow accordingly.
[EDITED] There are some tools in the FileExchange for creating GUIs, whose sections resize automatically, e.g. http://www.mathworks.com/matlabcentral/fileexchange/27758-gui-layout-toolbox.
  1 件のコメント
André
André 2013 年 8 月 28 日
I wanted to avoid it because it is easier to visualize when you parametrize distances and sizes, i.e. setting a variable equal 20 pixels and using it everywhere.
I think the best way now (unfortunately) is change everything manually.
Thank you for the answer!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by