Custom File Dialog Box

Started by LemanK, November 24, 2008, 03:57:26 PM

Previous topic - Next topic

LemanK

Hi All -

I am trying to work with OpenDCL and am having problems with the File Dialog Box. I have a project with (1) Modal dialog (Form2), (1) modeless dialog(Form1), and (1) file dialog(Form3). Initially, I was not able to get the File Dialog to display using (Setq rValue (dcl_Form_Show LispFiles_Form3)) but was able to get it to load using (Setq rValue (dcl_Form_Show "LispFiles" "Form3")). When I try to use one of the functions such as (Setq rValue (dcl_FileDlg_GetFileNameList LispFiles_Form3_CustFileDlg)) I get an error message saying "The control argument passed to FileDlg_GetFileNameList was NIL.". I did not find much on File Dialogs in the Help File and was hoping that someone might point me in the right direction. I am using A2006 and 4.1.2.2 of OpenDCL.

Thanks
Leman

BazzaCAD

Hi Leman,
Welcome to the team.
I haven't played with the File Dialog lately, so I'm not sure if there's a bug or not. I'll try to test it out late if I get time.
You might also wont to try it out in the latest Beta build, 5.0.1.3, if there was a bug, maybe it's been fixed in the newer version.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

owenwengerd

Quote from: LemanK on November 24, 2008, 03:57:26 PM
...I get an error message saying "The control argument passed to FileDlg_GetFileNameList was NIL.".

This error indicates that the lisp symbol you are using is incorrect. Check the value of the (VarName) property of your file dialog to get the correct symbol name, or use the ControlBrowser to see the correct name in the function syntax.
Owen Wengerd (Outside The Box) / ManuSoft

LemanK

Mr. Wengerd -

As far as I can tell, the variable names are correct but my knowledge is so limited that it is just a guess. I have attached the ODCL and lisp files hoping that you could look at them. I had very limited exposure to the old ObjectDCL from several years ago and you have done a marvelous job in preserving this great tool.

Thanks
Leman

owenwengerd

Your call to (dcl_FileDlg_GetFileName LispFiles_Form3_MyOpen) occurs after the file dialog is closed.  Once the dialog is closed, LispFiles_Form3_MyOpen is NIL, which triggers the exception you mentioned.

If you want to strip the path and use only the filename, you'll need to do that with AutoLISP by processing the return value from (dcl_Form_Show LispFiles_Form3).

Also, you should modify your *error* function so that it only closes the form if it is open:
(if LispFiles_Form1 (dcl_Form_Close LispFiles_Form1))
Owen Wengerd (Outside The Box) / ManuSoft

LemanK

Mr. Wengerd -

Thank you so much for your help. I deeply appreciate it!!!

Leman