Jump to content

Question about "Edit_box"


cadfan

Recommended Posts

Hey,guys.

 

(action_tile "th" "(setq scl (distof $value))")

What does this mean ?

"th" is a key of "Edit_box",

 

I want "Edit_box" can only enter Numbers, can't enter character. How to do ?

 

I want "Edit_box" can memory , when dialog exit--->start again, the value in the edit box is the last , not default value . How to do ?

 

Thanks for any help.

Link to comment
Share on other sites

Distof "Converts string which contains a real, display format by mode".

 

(setq scl $value) will now accept alpha or 0-9 but it will be a string not a number in case of 0-9.

 

You can pass a default value to be used in your DCL.

 

No code posted so no idea how to show example.

Link to comment
Share on other sites

Distof "Converts string which contains a real, display format by mode".

 

(setq scl $value) will now accept alpha or 0-9 but it will be a string not a number in case of 0-9.

 

You can pass a default value to be used in your DCL.

 

No code posted so no idea how to show example.

 

 

Tks, but I need a sample.:( :cry:

Link to comment
Share on other sites

if

is your dialog file

editbox is dcl ID

"number" is the key for edit_box, or "th" of yours.

*memory* is global default value

 

(setq *memory* (if (and *memory* (= (type *memory*) 'STR))  *memory* "[b]0.000[/b]"))
(defun c:test (/ dcl_id dd)
 
 (setq dcl_id (load_dialog [b][color="red"]<editbox.dcl>[/color][/b] ) dd 1)
 (while
   (or (not (numberp (read *memory*)))(= dd 1))
   (new_dialog "[color="red"]editbox[/color]" dcl_id)
   (set_tile "[color="red"]number"[/color] *memory*)
   (action_tile "accept" "(setq *memory* (get_tile \"number\"))(done_dialog 0)")
   (setq dd (start_dialog))
   ) ;_ end of while
 (unload_dialog dcl_id)
 (princ)
 ) ;_ end of defun

Link to comment
Share on other sites

if

is your dialog file

editbox is dcl ID

"number" is the key for edit_box, or "th" of yours.

*memory* is global default value

 

(setq *memory* (if (and *memory* (= (type *memory*) 'STR))  *memory* "[b]0.000[/b]"))
(defun c:test (/ dcl_id dd)
 
 (setq dcl_id (load_dialog [b][color="red"]<editbox.dcl>[/color][/b] ) dd 1)
 (while
   (or (not (numberp (read *memory*)))(= dd 1))
   (new_dialog "[color="red"]editbox[/color]" dcl_id)
   (set_tile "[color="red"]number"[/color] *memory*)
   (action_tile "accept" "(setq *memory* (get_tile \"number\"))(done_dialog 0)")
   (setq dd (start_dialog))
   ) ;_ end of while
 (unload_dialog dcl_id)
 (princ)
 ) ;_ end of defun

 

Thank you very much , hanhphuc , I will study carefully!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...