App Designer text box vs GUIDE

4 次查看(过去 30 天)
Carl Banks
Carl Banks 2019-1-30
评论: Carl Banks 2019-1-31
If I create a GUI with GUIDE that has text boxes (really uicontrols with the 'edit' style), the behavior of the text box when you click it is that all the text in the box is immediately selected, so that if you start typing you'll replace the value. If you want to place the cursor to edit the existing value, you need to double-click it.
In App Designer text boxes, the situation is reversed: clicking places the cursor and double-clicking selects the whole box. This is pretty much a deal breaker for us. Our analysts need to enter values into maybe 20 text boxes, and having to double click every time pretty much kills the flow. (Keep in mind that these are numbers boxes, which means there is a zero or some other number in the box by default; it would be not as bad if boxes started out empty.)
So, my question is, is there a workaround. We find App Designer superior to GUIDE in just about every other way.
This is R2017a BTW. App Designer is pretty new so maybe they fixed some newbie issues by now.

回答(1 个)

Cris LaPierre
Cris LaPierre 2019-1-30
In 2018b you still have the same behavior. The best work around I can think of is if you tab between edit fields, it selects the current contents in the edit field (numeric). Setting the tab order is not straightforward, but this answer might help.
  2 个评论
Cris LaPierre
Cris LaPierre 2019-1-30
Following up on the other option you mentioned, you could use an edit field (text), which does allow for it to be empty to begin with, and just do a str2double on the value.
function EditFieldValueChanged(app, event)
value = str2double(app.EditField.Value);
end
Carl Banks
Carl Banks 2019-1-31
Typical Mathworks, blustering out great ideas without giving two seconds of thought about usability issues.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by