基本 MaxScript GUI 操作:如何获取 Enter 键?如何使控件变灰?
对于其中一种不相关的问题,我深表歉意,但我想让我的 MaxScript 推出/工具更加直观,使其表现得像任何其他 GUI 所期望的那样。
熟悉 MaxScript 的人可以告诉我:
如何“禁用”(灰显)按钮?
如何获取 Enter 键按下事件? (即我有一个 EditText 控件。当在此表单中的任何位置按下 Enter 时,我想关闭该对话框(它不是多行控件))
如何将焦点赋予控件? (即,我希望使用 CreateDialog 打开卷展栏以将焦点赋予 EditText 控件,以便用户可以立即开始键入)
Apologies for the kind-of unrelated questions in one, but I would like to make my MaxScript rollout/tool more intuitive by making it behave like any other GUI would be expected to.
Could anyone familiar with MaxScript tell me:
How do I 'disable' (grey out) a button?
How do I get the Enter key pressed event? (I.e. I have an EditText control. When enter is pressed anywhere in this form I would like to close the dialog (it is not a multiline control))
How do I give focus to a control? (I.e. I would like my rollout opened with CreateDialog to give focus to the EditText control so the user can start typing immediately)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
第一个是将其 .enabled 属性设置为 false。第二个取决于您使用的控件类型,如果是常用的卷展控件,只需使用
on editTextName 输入的 do ...
事件处理程序即可。对于 dotnet ,您必须使用至于第三个,请在 rollout open 事件处理程序中使用 setFocus 方法:
希望这就是您正在寻找的。
the first one would be setting its .enabled property to false. The second one depends on the type of control you are using, if it's the usual rollout control, just use
on editTextName entered do ...
event handler. For a dotnet one you'd have to useAs for the third one, use setFocus method in your rollout open event handler:
Hope this is what you were looking for.
或者
因为 off 是 false 的别名
or
since off is an alias for false
1.如何“禁用”(灰显)按钮?
在向浮动框添加按钮或其他组件的地方,您添加enabled:false作为方法,就像height:buttonheight一样
样本:
按钮 btnviewdistline “查看距离线” 宽度:btnWidth 高度:btnHeight 启用:false
1.How do I 'disable' (grey out) a button?
Where you add a button or another component to the floater you add enabled:false as method just like height:buttonheight
sample:
button btnviewdistline "View distance line" width:btnWidth height:btnHeight enabled:false