Edit_box update problem

Edit_box update problem

CSM_MAI
Advocate Advocate
951 Views
2 Replies
Message 1 of 3

Edit_box update problem

CSM_MAI
Advocate
Advocate
I have a lisp with dcl I am working on. I'm picking away at each problem as I come across them. It utilizes a browse button so the user can navigate to a folder and then a list box will populate the drawings within the folder. Next to the browse button is an edit_box "cdir" that I hope to display the folder path in. I used Lee Mac's browse to directory lisp and that works great, but once I "(setq userfilepath" from what the routine finds, it will not display in the edit box. The tricky part is I can setq userfilepath (getvar degprefix) as the default and it will display the current folder location. Once I run the routine, userfilepath is changes. I type !userfilepath into the command line. But it will not update the edit_box with the new value. I don't have the code with me at the moment to paste in here, but it's pretty consistent with most dcl and lisp. I want the edit_box key "cdir" to display "userfilepath" and update when that value changes. Do I need to convert the value to a string? I've searched multiple threads in here but I can't find an answer. I appreciate any information.
0 Likes
Accepted solutions (1)
952 Views
2 Replies
Replies (2)
Message 2 of 3

Ajilal.Vijayan
Advisor
Advisor
Accepted solution

Try this sample.

LISP

(prompt "\nType TestPath to run...")

(defun C:TestPath ()
(setq dcl_id (load_dialog "hello.dcl"))
 
     (if (not (new_dialog "hello" dcl_id))
	 (exit )
     );if
 
(action_tile "accept" "(done_dialog)" );action_tile

;Function to get the Folder Path
;returns the path selected
(defun getFolder( / path)
	(setq path (LM:browseforfolder "Select a folder" "C:\\Test" 0))
	(if (/= nil path)
		(set_tile "name" path )
		(set_tile "name" "Path Not Selected")
	)
	(princ path)
);defun getFolder


(action_tile "btn_browse"
    "(setq userfilepath(getFolder))
	(princ userfilepath)"
);action_tile

(start_dialog)
(unload_dialog dcl_id)
 
(princ)
 
);defun
(princ)

DCL

hello : dialog
{
label = "Test";
		
	: edit_box
	{
	label = "File Path";
	mnemonic = "N";
	key = "name";
	alignment = centered;
	edit_width = 30;
	}
 
	: button	
	{
	key = "btn_browse";
	label = "Browse Folder";
	fixed_width = true;
	alignment = centered;
	}
 
	: button	
	{
	key = "accept";
	label = "OK";
	is_default = true;
	fixed_width = true;
	alignment = centered;
	}
 
	: errtile
	{
	width = 34;
	}
}
Message 3 of 3

CSM_MAI
Advocate
Advocate

Your example worked great. I think I had too many copy and paste lines in there with ;; in front of them. I went through yours line by line and verified that mine was consistent with it. It works great now. Thanks again. 

0 Likes