Lee Mac 发表于 2022-7-5 20:46:20

 
My apologies, the (setq i (1+ i)) should have been (setq i (1- i)) - please try the updated code above.

CadFrank 发表于 2022-7-5 20:49:04

Well that was exactly it. No need for an excuse. Your taking your own time to answer to my questions.
 
Many thanks!

Lee Mac 发表于 2022-7-5 20:51:04

You're welcome Frank, happy to help.

CadFrank 发表于 2022-7-5 20:53:13

Hi again,
 
I've been looking all day on how to activate a Edit_box when you select a radio button.
 
I think I need some guidence...
 
Anyone

Lee Mac 发表于 2022-7-5 20:57:35

In the action_tile statement for the radio_button, include:
(mode_tile "your-edit-box-key" 2)

CadFrank 发表于 2022-7-5 21:01:22

 

(defun c:test ( / i id lst )(setq lst      '(         ("rb1" "- Choisir -" " Mètre" " Kilomètre" " Pied" " Pouce")         ("rb2" "- Choisir -" " Kilomètre carrée" " Mètre carrée" " Pied carrée" " Pouce carrée")    ("rb3" "- Choisir -" " Kilomètre cube" " Mètre cube" " Pied cube" " Pouce cube")    ("rb4" "- Choisir -" " Kilogramme" " Gramme" " Tonne" " Livre")          ("rb5" "- Choisir -" " Kilonewton" " Newton" " Kilolivre force" " Livre force")          ("rb6" "- Choisir -" " Kilonewton par mètre carrée" " Newton par mètre carrée" " Kilolivre par pied carrée" " Livre par pied carrée")    ("rb7" "- Choisir -" " Kilonewton mètre" " Newton mètre" " Kilolivre force pied" " Livre force pied")       )   );setq      (if        (and (< 0 (setq id (load_dialog "test.dcl")))   (new_dialog "Convertisseur" id));and   (progn(repeat        (setq i 7)(action_tile    (strcat "rb" (itoa i))    (strcat      "(addlist \"list_1\" (cdr (assoc $key lst)))"      "(addlist \"list_2\" (cdr (assoc $key lst)))"      "(mode_tile \"Edit_1\" 0)"    ))                                ;action_tile(setq i (1- i)))                                ;repeat(action_tile"Edit_1"(strcat    "(setq Val1 (get_tile \"Edit_1\"))"    "(setq Unit1 (get_tile \"list_1\"))"    "(setq Unit2 (get_tile \"list_2\"))"      "(set_tile \"Edit_2\" (CalVal Val1 Val2))"    "(mode_tile \"Edit_2\" 0)"    "(mode_tile \"Edit_2\" 2)"   )                                ;strcat)                                ;action_tile         (start_dialog)   )                                        ; progn   );if      (if (< 0 id) (unload_dialog id))   (princ)   )(defun addlist ( key lst )   (start_list key)   (foreach x lst (add_list x))   (end_list)   lst)
 
I tried it like this to :
 

(if (= (get_tile (strcat "rb" (itoa i)) "1") "1")      (progn(mode_tile "Edit_1" 2))   )
 
Not sure but i think i'm close

CadFrank 发表于 2022-7-5 21:02:41

Ok so I've found the way to make it so it work. I've modified my code above to what I have now.
 
But I have more questions. Since I'm new to DCL.
 
I want my Edit_1 to send a new value to my Edit_2
 
How should I proceed I tried a few thing. But it won't work.
 
It's all about the Set_tile and Action_tile. What should I do!
 
Here's the DCL file : TEST.dcl

Tharwat 发表于 2022-7-5 21:06:26

 
Unfortunately your modification is wrong .
 
 
You will not see the changes unless you make any action in the dialog box to allow the action tile to run .
 

(action_tile "Edit_1" "(set_tile \"Edit_2\" (get_tile \"Edit_1\"))")

CadFrank 发表于 2022-7-5 21:10:13

 
Thanks for the help, In the end I found it but my code was longuer hehe!
 
Now I need to make Edit_2 work with Popup_list 1 and 2.
 
I think ill need help, ill let you know later when my head is about to explode
 
Cheers !

CadFrank 发表于 2022-7-5 21:14:10

Hi again,
 
I need help with the popup_list.
 
Need to communicate "Edit_1" to "Edit_2" conditionnelly from the values of "list_1" and "list_2".
I found out how to make them communicate but linking them to the popup_list if more complicated then I though.
 
So I'm asking for help again.
 
I've modified my code above to what it is now.
 
Thank you !
页: 1 [2]
查看完整版本: DCL - Popup_list