value of dcl edit-box

Discussion in 'AutoCAD' started by StefVdM, Sep 18, 2003.

  1. StefVdM

    StefVdM Guest

    Hi,

    I have a dialog-box with various "edit_box"es. In the dcl-file I set the initial value of these boxes using the attribute "value".

    In my lisp-file I then write (action_tile "Namebox" "(setq VAR $value)").

    I was thinking that if the user did not change the preset value of the edit_box, that preset value would be assigned to the variable "VAR". Now it seems that values are not assigned unless the user explicitly enters something in the edit-box. So what's the use of the attribute "value" then? Or did I forget something?

    Thanks in advance for your help,

    Stef
     
    StefVdM, Sep 18, 2003
    #1
  2. StefVdM

    John Uhden Guest

    You should associate one variable with each input tile, then before you set the
    tile's value, set the default symbol value, or do them both at the same time...

    (set_tile "Tile1" (setq Tile1 "default"))
    ....
    (action_tile "Tile1" "(setq Tile1 $value)")

    I use the value attribute in a DCL only for testing appearances.




    initial value of these boxes using the attribute "value".
    edit_box, that preset value would be assigned to the variable "VAR". Now it
    seems that values are not assigned unless the user explicitly enters something
    in the edit-box. So what's the use of the attribute "value" then? Or did I
    forget something?
     
    John Uhden, Sep 18, 2003
    #2
  3. StefVdM

    BillZ Guest

    StefVdM,
    You are on target as to what happens.
    Before you initially set value to the edit boxes, just (setq VAR "attribute_value"). Then (set_tile "Namebox" VAR) to initially set the editbox(es).
    Then your (action_tile "Namebox" "(setq VAR $value)") should show any changes made to VAR by the user.

    Bill
     
    BillZ, Sep 18, 2003
    #3
  4. I like to use an initialization function to set the vars. and tiles.
    It helps me keep things organized especially when dealing with several
    tiles.

    (defun edit_initialize (/ default_values)
    (setq default_values
    '(("ebox1" "default1")
    ("ebox2" "default2")))

    (mapcar '(lambda (x)
    (set_tile (car x)
    (set (read (car x))
    (cadr x))
    )
    )
    default_values
    )
    )

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein

    the initial value of these boxes using the attribute "value".
    the edit_box, that preset value would be assigned to the variable
    "VAR". Now it seems that values are not assigned unless the user
    explicitly enters something in the edit-box. So what's the use of the
    attribute "value" then? Or did I forget something?
     
    Ken Alexander, Sep 18, 2003
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.