DCL edit_box...

Discussion in 'AutoCAD' started by aaron weissner, Apr 27, 2004.

  1. is there a way to make an edit box jump to the another edit box when the
    character limit is reached...
     
    aaron weissner, Apr 27, 2004
    #1
  2. In DCL, if there is, I don't know how to do it. It can be done when the
    user presses "Enter" but to capture other key presses inside a DCL, I
    suspect it's not possible. VB/VBA it can be done so I'd assume that
    perhaps ObjectDCL might let you but in native DCL, I doubt it.

    --
    Darren J. Young
    CAD/CAM Systems Developer

    Cold Spring Granite Company
    202 South Third Avenue
    Cold Spring, Minnesota 56320

    Email:
    Phone: (320) 685-5045
    Fax: (320) 685-5052
     
    Darren J. Young, Apr 27, 2004
    #2
  3. aaron weissner

    cwanless Guest

    Hi ObjectDCL from www.objectdcl.com gives you far more control than DCL. In ObjectDCL to do this you would use the OnChange event (an ObjectDCL equivilent to DCL's action_tile). Then use strlen to test the length of the text. Then if it meets you length requirement use the function Odcl_Control_SetFocus to set the focus to the control you wish to change it to.

    I hope this helps, Chad Wanless
     
    cwanless, Apr 27, 2004
    #3
  4. how do you get it to move to the next box by hitting enter???
     
    aaron weissner, Apr 27, 2004
    #4
  5. how do you get it to move to the next box by hitting enter???

    It's been a number of years since I did this and I don't know that I
    have any sample code here (perhaps at home) that demonstrates this.

    But as I recall, I used the $reason variable in the callback.

    $reason lets you know when you "leave" an edit box with tab, by picking
    another editbox, etc. I believe what I did was have the OK button set
    as an "Allow Accept" & "Is Default" so pressing "Enter" would activate
    the "Ok" button. However, the Callback for the "Ok" button then checked
    the "$reason" variable to see if I just left an edit box or not. If I
    did, I didn't exit the dialog, instead moved to the next edit box with a
    mode_tile function. If I didn't just leave an editbox, I closed the
    dialog or did whatever else I needed to do.

    Because this only tells you that you did leave an edit box, and not
    which one you left, I believe I also setup callback functions for each
    editbox where I set/monitored a variable that I'd check later so I knew
    where I was and hence, where I needed to go.

    Anyway, this might not be completely accurate because it's been so long.
    But with a little creativity I know it can be done because I remember
    doing it in the past.

    --
    Darren J. Young
    CAD/CAM Systems Developer

    Cold Spring Granite Company
    202 South Third Avenue
    Cold Spring, Minnesota 56320

    Email:
    Phone: (320) 685-5045
    Fax: (320) 685-5052
     
    Darren J. Young, Apr 27, 2004
    #5
  6. aaron weissner

    BillZ Guest

    how do you get it to move to the next box by hitting enter???
    <<
    Use:
    (action_tile "nextile" "(mode_tile \"nextile\" 2)")

    Also in your DCL file, use edit_limit attribute to prevent more characters than you want in the first box.

    :edit_box {
    key = "pthn" ;
    label = "Enter Search Path:" ;
    edit_width = 30 ;
    edit_limit = 8 ;
    fixed_width = true ;
    alignment = centered ;
    allow_accept = false ;
    }

    Bill
     
    BillZ, Apr 28, 2004
    #6
  7. thanks...

    than you want in the first box.
     
    aaron weissner, Apr 28, 2004
    #7
  8. i could not get it to work... if i changed the nextile to one of my keys it
    "locked-up" the dialog box... what am i doing wrong...


    than you want in the first box.
     
    aaron weissner, Apr 28, 2004
    #8
  9. aaron weissner

    BillZ Guest

    You're welcome!

    I made a mistake on the action tile.
    (action_tile "nextile" "(mode_tile \"nextile\" 2)")

    Should be:

    (action_tile "firstile" "(mode_tile \"nextile\" 2)")

    Bill
     
    BillZ, Apr 28, 2004
    #9
  10. you da man...
     
    aaron weissner, Apr 28, 2004
    #10
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.