乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: CadFrank

[编程交流] DCL - Popup_list

[复制链接]

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 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.
回复

使用道具 举报

56

主题

259

帖子

213

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
270
发表于 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!
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 20:51:04 | 显示全部楼层
You're welcome Frank, happy to help.
回复

使用道具 举报

56

主题

259

帖子

213

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
270
发表于 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
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 20:57:35 | 显示全部楼层
In the action_tile statement for the radio_button, include:
  1. (mode_tile "your-edit-box-key" 2)
回复

使用道具 举报

56

主题

259

帖子

213

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
270
发表于 2022-7-5 21:01:22 | 显示全部楼层
 
  1. (defun c:test ( / i id lst )  (setq lst      '(           ("rb1" "- Choisir -" "[m] Mètre" "[km] Kilomètre" "[pi] Pied" "[po] Pouce")           ("rb2" "- Choisir -" "[km²] Kilomètre carrée" "[m²] Mètre carrée" "[pi²] Pied carrée" "[po²] Pouce carrée")    ("rb3" "- Choisir -" "[km³] Kilomètre cube" "[m³] Mètre cube" "[pi³] Pied cube" "[po³] Pouce cube")    ("rb4" "- Choisir -" "[kg] Kilogramme" "[g] Gramme" "[t] Tonne" "[lb] Livre")              ("rb5" "- Choisir -" "[kN] Kilonewton" "[N] Newton" "[kips] Kilolivre force" "[lbf] Livre force")            ("rb6" "- Choisir -" "[kN/m²] Kilonewton par mètre carrée" "[Nm] Newton par mètre carrée" "[kips/pi²] Kilolivre par pied carrée" "[lbf/pi] Livre par pied carrée")    ("rb7" "- Choisir -" "[kNm] Kilonewton mètre" "[Nm] Newton mètre" "[kips*pi] Kilolivre force pied" "[lbf*pi] 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 :
 
  1. (if (= (get_tile (strcat "rb" (itoa i)) "1") "1")      (progn(mode_tile "Edit_1" 2))     )
 
Not sure but i think i'm close
回复

使用道具 举报

56

主题

259

帖子

213

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
270
发表于 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
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 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 .
 
  1. (action_tile "Edit_1" "(set_tile "Edit_2" (get_tile "Edit_1"))")
回复

使用道具 举报

56

主题

259

帖子

213

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
270
发表于 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 !
回复

使用道具 举报

56

主题

259

帖子

213

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
270
发表于 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 !
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 08:54 , Processed in 0.524998 second(s), 70 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表