Maybe there is a better way to do it, but here goes.
;; ;
;; Action_Focus by ymg ;
;; ;
;; Given a list of "Tile Key" will create necessaries "action-tile" ;
;; be able to use "ENTER" key in "edit-box" of a dialogue. ;
;; ;
;; The Dialogue file must not contain any "is_default = true;" ;
;; ;
" (mode_tile \"" b
"\" " (itoa 2) ")" " (setq a $val)"
)
)
I find it somewhat perplexing that we cannot use the "ENTER" key to enter
simple data in "edit-box"
The only solution I could find was a suggestion by MSasu at CadTutor to use
something like the following:
(mode_tile "EditBox1st" 2) ;set initial focus to first edit box (action_tile "EditBox1st" "(mode_tile \"EditBox2nd\" 2)") ;switch focus from first to second (action_tile "EditBox2nd" "(mode_tile \"EditBox3rd\" 2)") ;switch focus from second to third (action_tile "EditBox3rd" "(mode_tile \"accept\" 2)") ;set final focus from third to OK
The problem with this method is that you must go through all the boxes in order to
even be able to cancel or accept the dialogue, as the "action-tile" gets fired before
"cancel" or "accept" and focus is tranfered to the next tile.
The proposed "action-focus" routine get rid of this problem, by testing the value
of $reason. If value is equal to "1", we either pressed "ENTER" or Selected another
tile. All we do at this point is to accept anything that was entered and do not change
focus.
Seems to work OK, but maybe somebody knows a better way.
ymg