Dialog Boxes - Mode_Tile Question

Windows XP, AutoCAD 14 & 2006
Is there any way on initialising a dialog box that, if a particular button is greyed out, the focus will shift to a list box and select and highlight
the first item in that list box?
I have no problem with greying out the button (mode_tile "b_key" 1) or shifting focus to the list box (mode_tile "lb_key" 2). There appears to be a kind of 'selection frame' around the first item in the list box, but I can't get the item to highlight and therefore be selected by default.
The list box in question has 'multiple_select = true;' set.
Thanks
--
Mike
-Please remove 'safetycatch' from e-mail address before firing off your
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
HiHo; Set the attribute "is_default = true".
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Jiro wrote:

Hi
I don't think this will work.
"is_default = true;" would have to be set in the dcl file, whilst I want to control the focus from the associated lisp file. Anyway, the standard 'OK_Button' defined in Base.dcl already has "is_default = true;" set, and you can only set it once.
With my routine, normally a button called 'Last' is the default, but sometimes this button has to be greyed out when the dialog box is initiated. When this button is greyed out, I want the focus will shift to a list box and select and highlight the first item in that list box.
I have tried the routine with the list box set "is_default = true;" and have removed "is_default = true;" from the OK retirement button definition. The list box now has focus, but the first item is still not selected and highlighted.
--
Mike
-Please remove 'safetycatch' from e-mail address before firing off your
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I'm also unable to highlight the listbox, only when clicked on. Solved it simple, make sure that the initial value is set: (SET_TILE "xxxx" "0") xxxx is the name of the listbox, 0 is the first value from the list on OK or selecting the listbox I retrieve the value clicked: (SETQ zxxxz (ATOI(GET_TILE "xxxx"))) <-what value is chosen when the listbox has not been chosen I use (just OK clicked): (IF(= zxxxz NIL)(SETQ zxxxz 0)) <- to make sure something is set
I use the above techniques trough all of my progs; users are lazy, no matter how you build the progs, they always 'forget' to push or click a button.
Hope it helps a little.
Regards, Jan

to
initiated.
have
The
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
JP wrote:

Thanks Jan, it worked fine.
--
Mike
-Please remove 'safetycatch' from e-mail address before firing off your
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Been doing some more experimenting. Finally succeeded in getting the focus to an edit-box or list-box !! The trick is: first assign values to the list and point to the first value as shown. now this: (MODE_TILE "xxxxx" 2) ; puts the focus to the list box or edit box (MODE_TILE "xxxxx" 3) ; activates the list box or edit box, ready for selecting/typing over (makes it blue)
You MUST use the mode_tile 2 and 3, omit one of them and it won't work.
Hope it solves your problem completely now.
Regards, Jan

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
JP wrote:

Interesting - I had tried:
(mode_tile "xxxxx" 2)
followed by:
(mode_tile "xxxxx" 3)
before I posted my question, and it didn't work. It worked OK for an Edit Box, but not for a List Box. I hadn't pointed to the first List Box item with (set_tile "xxxxx" "0") though.
With a List Box, if I use:
(mode_tile "xxxxx" 2)
followed by:
(set_tile "xxxxx" "0") ["0" selects the first List Box item.] then it works fine - the List Box receives focus and the first List Box item is highlighted. I don't need to use (mode_tile "xxxxx" 3).
IIRC, (mode_tile "xxxxx" 3) is platform dependent, and doesn't need to be called on some systems. I guess my system doesn't need it.
--
Mike
-Please remove 'safetycatch' from e-mail address before firing off your
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Fine that it works. Just bear in mind that someday your program should run on another computer where this mode 3 could be needed. Always try to make the program 'portable' to other systems (even your co-worker might have a different system).
Regards, jan

works
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
JP wrote:

Good point.
It certainly does no harm to call 'mode 3'.
--
Mike
-Please remove 'safetycatch' from e-mail address before firing off your
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.