Brick_top Posted January 5, 2012 Share Posted January 5, 2012 Hi i'm new to dcl and would like to know how can I set a getstring variable using a DCL input box. I thought it would be easy but I haven't figured it out. thanks Quote Link to comment Share on other sites More sharing options...
pBe Posted January 5, 2012 Share Posted January 5, 2012 edit_box An edit box is a field that enables the user to enter or edit a single line of text. An optional label can appear to the left of the box. If the entered text is longer than the length of the edit box, the edit box scrolls horizontally. Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 Hi there I searched edit_box It seems it limits the input text to 132 characters. Anyway to avoid that? Quote Link to comment Share on other sites More sharing options...
pBe Posted January 5, 2012 Share Posted January 5, 2012 Really? I never noticed that. Can you post your code here for us to looked at? Maybe we can suggest a different approach. Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 I just copied a tutorial from a web page and was trying to adapt it to my code. here is the dcl part SAMPLE2 : dialog { label = "Pesquisa de Projetos"; : column { : boxed_column { : edit_box { key = "username"; label = "Informação a pesquisar:"; edit_width = 50; value = ""; initial_focus = true; } // : edit_box { // key = "userage"; // label = "Enter your Age:"; // edit_width = 15; // value = ""; // } } : boxed_row { : button { key = "accept"; label = " Ok "; is_default = true; } : button { key = "cancel"; label = " Cancel "; is_default = false; is_cancel = true; } } } } here is the lisp part (defun saveVars() (setq userName(get_tile "username")) ;(setq userAge(atoi(get_tile "userage"))) ) (defun C:SAMPLE2() ;;;--- Load the dcl file (setq dcl_id (load_dialog "SAMPLE2.dcl")) ;;;--- Load the dialog definition if it is not already loaded (if (not (new_dialog "SAMPLE2" dcl_id)) (progn (alert "The SAMPLE2.DCL file could not be loaded!") (exit) ) ) ;;;--- If an action event occurs, do this function (action_tile "accept" "(setq ddiag 2)(saveVars)(done_dialog)") (action_tile "cancel" "(setq ddiag 1)(done_dialog)") ;;;--- Display the dialog box (start_dialog) ;;;--- Unload the dialog box (unload_dialog dcl_id) ;;;--- If the user pressed the Cancel button (if(= ddiag 1) (princ "\n Sample2 cancelled!") ) ;;;--- If the user pressed the Okay button (if(= ddiag 2) (progn (princ "\n The user pressed Okay!") ) ) ;;;--- Suppress the last echo for a clean exit (princ) ) I can post my code but it is very specific to a drawing file, don't know if that helps. Anyway in both this code and in this example. The resulting string length is 132 characters. Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 I'm going to try this http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/DCL-Edit-Box-Maximum-Characters-Limit/td-p/1115925 Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 Nice... I can' set a limit with edit_limit = (number); withouth "()" Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 I tried it with edit_limit = 512; and it works fine Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 But now there is something that bothers me. Anyway I could increase the edit box size so that all of the characters were visible while i type? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 5, 2012 Share Posted January 5, 2012 Use edit_width Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 sorry for not being clear, but as it seems it only scrools horizontally? I would like it to scrool vertically? sorry if my english sounds weird.. I don't know if all the words I write exist Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 5, 2012 Share Posted January 5, 2012 Not possible using a standard DCL edit_box - you can change the height, but the text will not move onto the next line. Unfortunately standard DCL doesn't offer a "text_area" tile, the closest you can get (in appearance) is a list_box, but this of course cannot accept text input. Quote Link to comment Share on other sites More sharing options...
Brick_top Posted January 5, 2012 Author Share Posted January 5, 2012 ok, thanks a lot for your info. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.