Permanently close a Modeless Dialog

Started by Emiliano, April 13, 2016, 09:43:48 AM

Previous topic - Next topic

Emiliano

Hello,
I have realized a Modeless Dialog.
During its use, according to the user settings dialog changes in width and height dimension.
Subsequently, the user presses OK.
At the end of the lisp function connected to Ok there is the following code

(dcl-Form-Close NomeApp_Form/NomeForm)

However, if the user opens the Dialogue it is the old size and settings, while I would like that the Dialog is reset to the initial settings.
How can I do?

roy_043

Code (autolisp) Select
(dcl-Control-SetHeight <CONTROL> NewValue [as Long])
(dcl-Control-SetWidth <CONTROL> NewValue [as Long])

Emiliano

Maybe I have explained badly.
I wish that after closing the dialog, when I open it again, it must be found with the default settings.
Currently after reopening I find all compiled textbox, and I do not want this

roy_043

I don't understand what you mean by 'compile textbox' or the settings you are referring to.

Emiliano

Quote from: roy_043 on April 15, 2016, 12:52:13 AM
I don't understand what you mean by 'compile textbox' or the settings you are referring to.

To reproduce the problem:
1. Close AutoCAD
2. Open AutoCAD
3. Open the Modeless Dialog
4. Fill in some TextBox: thanks to the code that I put in the event OnEditChanged, filling these TextBox the Dialog width changes
5. Close the dialog (eg. With the "X" or a button with (dcl-Form-Close NomeApp_Form/NomeForm)
6. Reopen the Modeless Dialog


I wish that the open dialogue with the passage 6, was equal to the dialog opened with the step 3, before the compilation of the TextBox.
I achieved this by code, however I think there is a way (that I do not know) to reset everything to the initial state.

I hope I was clear this time.

roy_043

ODCL stores the Height, Width, TopLeftX and TopLeftY of each dialog in the registry.
As far as I know the only alternative to my first answer is deleting that information from the registry before relaunching the dialog.

Emiliano

Quote from: roy_043 on April 15, 2016, 03:34:37 AM
ODCL stores the Height, Width, TopLeftX and TopLeftY of each dialog in the registry.
As far as I know the only alternative to my first answer is deleting that information from the registry before relaunching the dialog.

I did as you suggested in the first answer and it works.
However it seemed more logical if there was something to do this automatically.

Thanks anyway