PDA

View Full Version : Disabling a radio button



rmoore
2004-10-21, 04:18 PM
Hi all,

I am writing a lisp routine, with a dialog box, for inserting a border into a drawing. The selectable items in the box are size, type, and scale of the border. The problem I have is that there are no Assembly or Interface Control drawing borders in "A" size. I would like the dialog box to grey out the "A" size button when either of those border types are selected. (See Attached for view of Dialog box & lisp routine)

How can this be accomplished?

Here is the DCL file information


bordins_2004 : dialog {
label = "Deublin Borders";
:radio_row {
label = "Border Style";
alignment = center;
:radio_button{
label = "Detail";
value = 1;
key = "bord_detail";
}
:radio_button{
label = "Assy";
key = "bord_assy";
}
:radio_button{
label = "IC";
key = "bord_IC";
}
}
spacer;
:row{
:radio_column{
label = "Size";
:radio_button{
label = "A Size";
key = "asize";
}
:radio_button{
label = "B Size";
value = 1;
key = "bsize";
}
:radio_button{
label = "C Size";
key = "csize";
}
:radio_button{
label = "D Size";
key = "dsize";
}
}
spacer;
:row {
label = "Scales";
:radio_column{
height = 7;
:radio_button{
label = "Full";
key = "1";
value = 1;
}
:radio_button{
label = "1.66:1";
key = "1.66";
}
:radio_button{
label = "2:1";
key = "2";
}
:radio_button{
label = "2.5:1";
key = "2.5";
}
:radio_button{
label = "3:1";
key = "3";
}
:radio_button{
label = "4:1";
key = "4";
}
:radio_button{
label = "5:1";
key = "5";
}
}
:radio_column{
height = 7;
:radio_button{
label = "10:1";
key = "10";
}
:radio_button{
label = "3:4";
key = "3/4";
}
:radio_button{
label = "1:2";
key = "1/2";
}
:radio_button{
label = "1:3";
key = "1/3";
}
:radio_button{
label = "1:4";
key = "1/4";
}
:radio_button{
label = "1:10";
key = "1/10";
}
}
}
}
spacer;
ok_cancel;
}

stig.madsen
2004-10-21, 04:46 PM
Check out the MODE_TILE function

rmoore
2004-10-21, 07:09 PM
Thank you for the response. I was looking at the Mode_tile function and saw that it can disable a tile, but frankly I haven't seen a good example of it's use. Can you lead me in the right direction?

peter
2004-10-21, 07:24 PM
(mode_tile "bord_assy" 1)

rmoore
2004-10-21, 08:04 PM
Thanks guys,

I figured out the mode_tile part and have the box behaving as I would expect by adding these lines to my Lisp routine:

(new_dialog "bordins_2004" border_dcl).......

(action_tile "bord_assy" "(mode_tile \"asize\" 1)")
(action_tile "bord_IC" "(mode_tile \"asize\" 1)")
(action_tile "bord_detail" "(mode_tile \"asize\" 0)")

.......(action_tile "accept" "(do_border_type)(do_border_size)(do_borderscale)(done_dialog)")


I discovered one more issue.

If I already have "A" size drawing selected and then select the "Assy" or "IC" button, then the "A" size grays out but stays selected. How can I move the selected button to "B" size as well as disabling the "A" size button? In other words, if I chose "Assy" or "IC" then "B" size becomes the default.

Thanks for all your help!!