Author Topic: DCL radiobutton alignment  (Read 15459 times)

0 Members and 1 Guest are viewing this topic.

Ron Heigh

  • Guest
DCL radiobutton alignment
« on: December 01, 2004, 11:16:07 AM »
Is there a way to have 2 columns of radio buttons that are linked?
Such that if I check the button on column 2 the radio button on column 1 is unchecked?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
DCL radiobutton alignment
« Reply #1 on: December 01, 2004, 11:36:05 AM »
Have not tried it but this mught work:

Code: [Select]
: boxed_radio_column { //define boxed radio column
       label = "Pick a color";
  : row {
    : radio_button { //define radio button
       label = "White"; //give it a label
       key = "rb1"; //give it a name
    }
    : radio_button {
       label = "Green";
       key = "rb2";
    }
  }
  : row {
    : radio_button { //define radio button
       label = "Red"; //give it a label
       key = "rb3"; //give it a name
    }
    : radio_button {
       label = "Yellow";
       key = "rb4";
    }
  }
}
I've reached the age where the happy hour is a nap. (░┐░)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Crank

  • Swamp Rat
  • Posts: 1484
DCL radiobutton alignment
« Reply #2 on: December 01, 2004, 12:57:13 PM »
Here is 1 example:
Code: [Select]

// TEST.DCL

// Profiel-insertroutine  Copyright (c) '94/'04 J.J.Damstra
// For demonstration only (published on 'the Swamp' on 11-31-'04

dcl_settings : default_dcl_settings { audit_level = 3; }

profiel : dialog {
    label = "PROFIEL DEMO";

    : row {
: column {
: boxed_row {
   label = "Profieltype:";
   key = "type";
   : radio_column {
: radio_button {
label = "Buis-profielen (CHS)";
key = "buis";
}
spacer_1;
: radio_button {
label = "Damwanden (diverse typen)";
key = "damwand";
}
spacer_1;
: radio_button {
label = "DIE; DIL; DIN; DIR en DIH";
key = "dix";
}
spacer_1;
: radio_button {
label = "Ge´ntergreerde ligger, type: ASB";
key = "asb";
}
: radio_button {
label = "Ge´ntergreerde ligger, type: IFB";
key = "ifb";
}
: radio_button {
label = "Ge´ntergreerde ligger, type: SFB";
key = "sfb";
}
: radio_button {
label = "Ge´ntergreerde ligger, type: THQ";
key = "thq";
}
spacer_1;
: radio_button {
label = "HEAA-profiel";
key = "heaa";
}
: radio_button {
label = "HEA-profiel";
key = "hea";
}
: radio_button {
label = "HEB-profiel";
key = "heb";
}
: radio_button {
label = "HEC-profiel";
key = "hec";
}
: radio_button {
label = "HEM-profiel";
key = "hem";
}
spacer_1;
: radio_button {
label = "HD-profiel";
key = "hd";
}
: radio_button {
label = "HL-profiel";
key = "hl";
}
spacer_1;
: radio_button {
label = "IPE-profiel";
key = "ipe";
}
: radio_button {
label = "IPE A;  IPE O;  IPE V en IPE 750";
key = "ipe-a";
}
}
   : radio_column {
: radio_button {
label = "INP-profiel";
key = "inp";
}
spacer_1;
: radio_button {
label = "Hoeklijn gelijkzijdig";
key = "hoek1";
}
: radio_button {
label = "Hoeklijn ongelijkzijdig";
key = "hoek2";
}
spacer_1;
: radio_button {
label = "Koker gelijkzijdig     (RHS)";
key = "koker1";
}
: radio_button {
label = "Koker ongelijkzijdig (RHS)";
key = "koker2";
}
spacer_1;
: radio_button {
label = "MONTAN-profiel";
key = "montan";
}
spacer_1;
: radio_button {
label = "Platstaal/Strip";
key = "strip";
}
spacer_1;
: radio_button {
label = "Raatligger";
key = "raat";
}
spacer_1;
: radio_button {
label = "Rails";
key = "rails";
}
spacer_1;
: radio_button {
label = "T-staal   (1:1)";
key = "T-staal1";
}
: radio_button {
label = "TB-staal (2:1)";
key = "T-staal2";
}
spacer_1;
: radio_button {
label = "UAP-profiel";
key = "uap";
}
: radio_button {
label = "UPE-profiel";
key = "upe";
}
spacer_1;
: radio_button {
label = "UNP-profiel";
key = "unp";
}
spacer_1;
: radio_button {
label = "Z-profiel";
key = "z";
}
   }
}
}
    }

    spacer_1;
    ok_cancel_err;
}


Code: [Select]

(defun c:test (/ profiel)
(setq dcl_id (load_dialog "test.dcl"))
(if (not (new_dialog "profiel" dcl_id)) (exit))

(action_tile "buis" "(wis2)(buis)")
(action_tile "damwand" "(wis2)(damwand)")
(action_tile "dix" "(wis2)(dix)")
(action_tile "heaa" "(wis2)(heaa)")
(action_tile "hea" "(wis2)(hea)")
(action_tile "heb" "(wis2)(heb)")
(action_tile "hec" "(wis2)(hec)")
(action_tile "hem" "(wis2)(hem)")
(action_tile "hd" "(wis2)(hd)")
(action_tile "hl" "(wis2)(hl)")
(action_tile "asb" "(wis2)(asb)")
(action_tile "ifb" "(wis2)(ifb)")
(action_tile "sfb" "(wis2)(sfb)")
(action_tile "thq" "(wis2)(thq)")
(action_tile "ipe" "(wis2)(ipe)")
(action_tile "ipe-a" "(wis2)(ipe-a)")
(action_tile "inp" "(wis1)(inp)")
(action_tile "hoek1" "(wis1)(hoek1)")
(action_tile "hoek2" "(wis1)(hoek2)")
(action_tile "koker1" "(wis1)(koker1)")
(action_tile "koker2" "(wis1)(koker2)")
(action_tile "montan" "(wis1)(montan)")
(action_tile "raat" "(wis1)(raat)")
(action_tile "rails" "(wis1)(rails)")
(action_tile "strip" "(wis1)(strip)")
(action_tile "T-staal1" "(wis1)(t1)")
(action_tile "T-staal2" "(wis1)(t2)")
(action_tile "uap" "(wis1)(uap)")
(action_tile "upe" "(wis1)(upe)")
(action_tile "unp" "(wis1)(unp)")
(action_tile "z" "(wis1)(z-prof)")

(action_tile "accept" "(done_dialog 1)(setq profiel 1")
(action_tile "cancel" "(done_dialog 0)(setq profiel 0)")

  (while (not profiel)(start_dialog))
  (alert "Your program starts here")
  (princ)
)

(defun message (bericht)
(set_tile "error" bericht)
)
(defun asb ()
(message "ASB-ge´ntergreerde ligger")
)
(defun buis ()
(message "Buisprofielen")
)
(defun damwand ()
(message "Diverse stalen damwandprofielen")
)
(defun dix ()
(message "Antieke profielen")
)
(defun heaa ()
(message "HEAA-profielen")
)
(defun hea ()
(message "HEA-profielen")
)
(defun heb ()
(message "HEB-profielen")
)
(defun hec ()
(message "HEC-profiel")
)
(defun hem ()
(message "HEM-profielen")
)
(defun hl ()
(message "HL-profielen")
)
(defun hd ()
(message "HD-profielen")
)
(defun ipe ()
(message "IPE-profielen")
)
(defun ipe-a ()
(message "IPE A;  IPE O;  IPE V en IPE 750")
)
(defun ifb ()
(message "IFB-ge´ntergreerde ligger")
)
(defun inp ()
(message "INP-profielen")
)
(defun hoek1 ()
(message "Gelijkzijdige hoeklijnen")
)
(defun hoek2 ()
(message "Ongelijkzijdige hoeklijnen")
)
(defun koker1 ()
(message "Gelijkzijdige kokerprofielen")
)
(defun koker2 ()
(message "Ongelijkzijdige kokerprofielen")
)
(defun montan ()
(message "MONTAN-profiel")
)
(defun raat ()
(message "Raatliggers")
)
(defun rails ()
(message "Kraanbaanliggers en spoorrails")
)
(defun sfb ()
(message "SFB-ge´ntergreerde ligger")
)
(defun strip ()
(message "Platstaal en strippen")
)
(defun t1 ()
(message "T-staal (gelijkzijdig)")
)
(defun t2 ()
(message "TB-staal (ongelijkzijdig)")
)
(defun thq ()
(message "THQ-ge´ntergreerde ligger")
)
(defun uap ()
(message "UAP-profielen")
)
(defun upe ()
(message "UPE-profielen")
)
(defun unp ()
(message "UNP-profielen")
)
(defun z-prof ()
(message "Z-profielen")
)

(defun wis1 ()(set_tile "buis" "2")(set_tile "buis" "0"))
(defun wis2 ()(set_tile "unp" "2")(set_tile "unp" "0"))
(princ)
Vault Professional 2018     +     AEC Collection

Ron Heigh

  • Guest
DCL radiobutton alignment
« Reply #3 on: December 02, 2004, 07:48:12 AM »
Thanks guys.

Both of your responses result in me having 2 radio buttons with value=1 at the same time.

I need to have multiple columns of radio buttons, with only one "DOT" at any given time enabled.

Ron Heigh

  • Guest
DCL radiobutton alignment
« Reply #4 on: December 02, 2004, 08:39:08 AM »
I redid my dialog to use a list box instead of multiple columns.
I'd love to see this problem solved though.

Thanks for the help everyone.

Crank

  • Swamp Rat
  • Posts: 1484
DCL radiobutton alignment
« Reply #5 on: December 02, 2004, 02:39:38 PM »
Code: [Select]

....
(defun wis1 ()(set_tile "buis" "2")(set_tile "buis" "0"))
(defun wis2 ()(set_tile "unp" "2")(set_tile "unp" "0"))
....

When you select a button from column2, the program selects the first button of column1 and clears it inmedeally. And for every button of column1 it does the same in column2.

Quote from: Ron Heigh
...Both of your responses result in me having 2 radio buttons with value=1 at the same time.
...

You can set a flag in the action_tile function and use that later in your program.
Vault Professional 2018     +     AEC Collection

KeithÖ

  • Villiage Idiot
  • Seagull
  • Posts: 16872
  • Superior Stupidity at its best
DCL radiobutton alignment
« Reply #6 on: December 02, 2004, 11:20:08 PM »
Ok, Now that everyone has had their say....

A set of radio buttons can be grouped together without additional code by following this format:
Code: [Select]

      : radio_cluster {
              :row {
            : column {
             : radio_button {
              label = "R1";
              key = "R1";
              }
             : radio_button {
              label = "R2";
              key = "R2";
              }
             : radio_button {
              label = "R3";
              key = "R3";
              }
             }
            : column {
             : radio_button {
              label = "R4";
              key = "R4";
              }
             : radio_button {
              label = "R5";
              key = "R5";
              }
             : radio_button {
              label = "R6";
              key = "R6";
              }
             }
               }
              }



Note that what puts all of the radio_buttons in the same group is the :radio_cluster designation
This example has 2 columns with 3 buttons each. You could just as easily made 4 buttons or 4 columns.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
DCL radiobutton alignment
« Reply #7 on: December 03, 2004, 07:58:23 AM »
Keith
Here is the test.
Where did you find that reference to radio_cluster? :shock:
I've reached the age where the happy hour is a nap. (░┐░)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KeithÖ

  • Villiage Idiot
  • Seagull
  • Posts: 16872
  • Superior Stupidity at its best
DCL radiobutton alignment
« Reply #8 on: December 03, 2004, 09:07:15 AM »
Well, it certainly isn't in the documentation now is it ...  8)

Lets just say there are things not in the DCL tile catalog in the documentation.

here is a list I have and what they do

Quote

boxed_column - A column of objects with a frame
boxed_radio_column - A column of radio_buttons with a frame
boxed_radio_row - A row of radio_buttons with a frame
boxed_row    - a row with a frame
button - a simple button
cancel_button - default cancel button
cluster - clustered widgets
color_palette_0_9 - default color dialog palette for the first 10 colors
color_palette_1_7 - default color dialog palette for the ACI colors 1-7
color_palette_1_9 - default color dialog palette for the ACI colors 1-9
color_palette_250_255 - default color dialog palette for the ACI colors 250-255
column - a column of widgets
concatenation - concatenation, used for multiple text widgets
default_button - the default button designation
dialog - The window containing the widgets
edit_box - an editbox
edit12_box    - an editbox 12 characters wide with a maximum of 148 characters
edit32_box    - an editbox 32 characters wide with a maximum of 2048 characters
errtile - a text tile with the key "error"
fcf_ebox - an edit_box 7 char wide typically used in the files dialog
fcf_ebox1 - an edit_box with a limit of 3 chars
fcf_ibut - image_button 3.5 wide X 1.2 high
fcf_ibut1 - image_button 5 wide aspect ratio of 0.66
files_bottomdf - file edit_box columned with ok_cancel and errtile key = "fedit"
files_topdf - specialty cluster for files dialog
help_button - help button key = help
icon_image - image_button 12 wide aspect ratio of 0.66
image - an image tile
image_block - image height of 1 width of 1
image_button - an image tile button
info_button - predefined button key = "info"
list_box - a list box
ok_button - OK button with key = "accept"
ok_cancel - button cluster
ok_cancel_err - button cluster
ok_cancel_help - button cluster
ok_cancel_help_errtile - button cluster
ok_cancel_help_info - button cluster
ok_only - OK button with key = "accept" but is also the cancel button
paragraph   a cluster of vertical text
popup_list - a popup list
radio_button - a radio button
radio_cluster - a cluster of radio buttons
radio_column - a column of radio buttons
radio_row - a row of radio buttons
retirement_button - predefined button with a fixed width of 8
row - a row of widgets
slider - a slider mechanism
spacer - a spacer
spacer_0 - a spacer
spacer_1 - a spacer
std_rq_color - standard complete color palette with controls
swatch - a colored image button 3X1.5
text - a label
text_25 - a label 25 chars long
text_part - a label without margins typically used for paragraphs
tile - the widget
toggle - a toggle button


I am not sure if there are more or not, but these are available on all 2000+ systems
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Ron Heigh

  • Guest
DCL radiobutton alignment
« Reply #9 on: December 03, 2004, 09:31:14 AM »
Now is when we need the ability to award points for useful posts.
Keith would be getting my vote.
Nice work.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10395
DCL radiobutton alignment
« Reply #10 on: December 03, 2004, 09:40:08 AM »
Thank You Keith!
You get my vote too. :)
I've reached the age where the happy hour is a nap. (░┐░)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KeithÖ

  • Villiage Idiot
  • Seagull
  • Posts: 16872
  • Superior Stupidity at its best
DCL radiobutton alignment
« Reply #11 on: December 03, 2004, 09:52:31 AM »
Glad to help ....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

SMadsen

  • Guest
DCL radiobutton alignment
« Reply #12 on: December 03, 2004, 10:44:04 AM »
Quote from: CAB
Where did you find that reference to radio_cluster?

Most of the controls can be found in the BASE.DCL file. It loads automatically and doesn't need the include directive to be referenced.

TheyCallMeJohn

  • Guest
Re: DCL radiobutton alignment
« Reply #13 on: January 02, 2014, 07:29:47 PM »
Has anyone been able to get this to work?

My code works with two radio columns but not with the radio cluster.

Code: [Select]
dcl_settings : default_dcl_settings {audit_level=3;}
tcluster : dialog { label = "2007 OPA - Mechancical Pipe - SCD 40  STD";

: radio_cluster {
: row {
: column {
: radio_button {
key = "eb0";
label = "1/2 in";
}
: radio_button {
key = "eb1";
label = "3/4 in";
}
: radio_button {
key = "eb2";
label = "1 in";
}
: radio_button {
key = "eb3";
label = "1-1/2 in";
}

}
: column {
: radio_button {
key = "eb11";
label = "10 in";
}
: radio_button {
key = "eb12";
label = "12 in";
}
: radio_button {
key = "eb13";
label = "14 in";
}
: radio_button {
key = "eb14";
label = "16 in";
}
}
}
}
: boxed_row {
: button {
key = "accept";
label = " OKAY ";
is_default = true;
}
: button {
key = "cancel";
label = " Cancel ";
is_default = false;
is_cancel = true;
}
}
}

Code: [Select]
(defun c:templsp ()
(if (= PL_WEIGHT nil)(setq PL_WEIGHT 0.0))
(if(not (setq dcl_id (load_dialog "testcluster.dcl")))
(progn
(alert "The file could not be loaded.")
(exit)
)
(progn
(if (not (new_dialog "tcluster" dcl_id))
(progn
(alert "The DCL definition could not be found inside the DCL file.")
(exit))
(progn


(action_tile "eb0" "(setq PL_WEIGHT \"1.45\")(setq PL_UTILITY \"Single Hung 1/2 in\")")
(action_tile "eb1" "(setq PL_WEIGHT \"1.79\")(setq PL_UTILITY \"Single Hung 3/4 in\")")
(action_tile "eb2" "(setq PL_WEIGHT \"2.67\")(setq PL_UTILITY \"Single Hung 1 in\")")
(action_tile "eb3" "(setq PL_WEIGHT \"4.24\")(setq PL_UTILITY \"Single Hung 1-1/2 in\")")
(action_tile "eb11" "(setq PL_WEIGHT \"80.95\")(setq PL_UTILITY \"Single Hung 10 in\")")
(action_tile "eb12" "(setq PL_WEIGHT \"105.53\")(setq PL_UTILITY \"Single Hung 12 in\")")
(action_tile "eb13" "(setq PL_WEIGHT \"120.62\")(setq PL_UTILITY \"Single Hung 14 in\")")
(action_tile "eb14" "(setq PL_WEIGHT \"147.54\")(setq PL_UTILITY \"Single Hung 16 in\")")

(action_tile "accept" "(done_dialog 2)")
(action_tile "cancel" "(done_dialog 1)")

(setq ddiag(start_dialog))

(unload_dialog dcl_id)

(if (= ddiag 1)(princ "\n \n ...DCL_LSP Cancelled. \n "))
(if (= ddiag 2)
(progn
(princ "\n You test ")
)
)

)
)
))
(princ))


The error...
Quote
====== DCL semantic audit of testcluster.dcl ======

Warning in "tcluster". (widget type = cluster, key = "")
    Only radio buttons and spacers can be in radio clusters.

Warning in "tcluster". (widget type = radio_button, key = "eb0")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb1")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb2")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb3")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb11")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb12")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb13")
    A radio button\'s parent must be a radio cluster.

Warning in "tcluster". (widget type = radio_button, key = "eb14")
    A radio button\'s parent must be a radio cluster.

ymg

  • Swamp Rat
  • Posts: 725
Re: DCL radiobutton alignment
« Reply #14 on: January 02, 2014, 09:08:14 PM »
Remove the dcl setting at the head of your dcl file.

Then everything works fine.

Why?  Haven't got a cue.

I've done many test with the radio_clusters to no avail.
The error message that we see in your post is telling
that a radio button must have a cluster as a parent.

This implies that you cannot separate in 2 columns
unless you are ready to do some trick in the controlling Lisp.

For a good example of this see http://autodesk.lithium.com/t5/Visual-LISP-AutoLISP-and-General/DCL-Radio-Buttons-Divide-one-Radio-Column-into-Two-Radio-Columns/td-p/4696997

ymg
« Last Edit: January 03, 2014, 12:10:17 AM by ymg »