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

Reply to
mlv
Loading thread data ...

HiHo; Set the attribute "is_default = true".

Reply to
Jiro

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.

Reply to
mlv

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"))) >

Reply to
JP

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 "mlv" schreef > >

Reply to
JP

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.

Reply to
mlv

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

"mlv" schreef > >

Reply to
JP

Good point.

It certainly does no harm to call 'mode 3'.

Reply to
mlv

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.