DCL's and the Enter Key

Discussion in 'AutoCAD' started by mnash, Jul 20, 2004.

  1. mnash

    mnash Guest

    I have a working DCL file that has radio buttons. When I select a button and strike the enter key, it acts just like a regualr window, it initiates the "OK" button at the bottom. But I also a few DCL's that have a text field that user must enter. There is a defualt and the user may or may not make changes to the field. But when you're done to hit enter (to say "OK") nothing happens. What can I do to mae the enter key strike the "OK" button?
     
    mnash, Jul 20, 2004
    #1
  2. mnash

    ECCAD Guest

    In the DCL file, for the "OK" key, do:
    allow_accept = true;

    Bob
     
    ECCAD, Jul 20, 2004
    #2
  3. mnash

    dblaha Guest

    Try defining the OK button as the default one:

    : button {
    label = "OK";
    key = "accept";
    width = 12;
    fixed_width = true;
    is_default = true;
    }
     
    dblaha, Jul 20, 2004
    #3
  4. mnash

    mnash Guest

    Here is my code.
    I've tried both of your suggestions, but none seems to work

    dcl_settings : default_dcl_settings { audit_level = 0; }
    id_DETAIL : dialog { label = "Detail Requirments";

    : boxed_column {
    // aspect_ratio = 0;
    label = "Detail Identity";
    key = "BB";
    // fixed_height = true;
    // fixed_width = true;

    :edit_box {
    label = "Detail Number";
    key = "DETAIL1";
    edit_width = 1;
    }
    : row {

    : button {
    label = "&OK";
    key = "accept";
    alignment = centered;
    width = 12;
    is_default = true ;
    }

    : button {
    label = "&Cancel";
    key = "cancel";
    alignment = centered;
    width = 12;
    }
    }
    }
    }

    Like I said, it has to do with the text field being activated, and I want that. thoughts?
     
    mnash, Jul 20, 2004
    #4
  5. mnash

    dblaha Guest

    You can set the initial focus to the OK button with the MODE_TILE function in your lsp file:

    (mode_tile "accept" 2)
     
    dblaha, Jul 20, 2004
    #5
  6. mnash

    mnash Guest

    I would rather have the initial focus on the text field.
    Like most window in other programs, and even in AutoCAD, a text field is highlighted. You may accept the default and hit enter, or make changes to the field and hit enter, and the command or function continues. Personnaly I use my keyboard as much as possible, because it is much more efficient. If it can be done I'd love to do it, I'm willing to accept if it can't though. Thanks for the suggestion.
     
    mnash, Jul 20, 2004
    #6
  7. mnash

    mnash Guest

    that IS nifty, but as soon as you want to change the text from the default, the enter key again, will not work.
     
    mnash, Jul 20, 2004
    #7
  8. mnash

    ECCAD Guest

    Put the allow_accept = true;
    in the Edit_box

    Bob
     
    ECCAD, Jul 20, 2004
    #8
  9. mnash

    mnash Guest

    Bob, I know you mentioned that earlier, I wasn't sure on where to put it. Initially, I was putting that string of text with the "OK" button. My apologies. Sometime I feel like I'm in over my head with this stuff.
    dblaha, thank you too
    It works like a charm now
     
    mnash, Jul 20, 2004
    #9
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.