looking for suggestion to restore dialog status

Started by Kelie, June 06, 2009, 03:54:59 AM

Previous topic - Next topic

Kelie

wow, it has been almost a year since i wrote something with OpenDCL... but it sure looks great. hats off to all those involved in the development, particularly Owen.

the image below is a little program i'm writing to search for xdata from selected objects. i first tried using a modeless dialog, and it wasn't stable, probably because i did something wrong. so i decided to use a modal dialog. but within the same autocad session, same drawing, i'd like to restore the dialog to its previous state when used multiple times. i mean settings such as the dialog position on the screen, the status of a check box, the current selection of a combo box, etc.. what i'm doing now is saving such settings to global variables when the dialog is closed, and restore these setting when the dialog is initialized again. it seems to be labor intensive. is this the correct way of doing it?

thanks for your comment/suggestion.


Fred Tomke

Hi, Kelie,

normally, OpenDCL saves the dialog state within an AutoCAD session. That means if you close the form and reopens it, then it should be shown at the same place in the same size - but only if you do not call (dcl_project_load "MyProject" T) before.

The most dialog content should also be saved within an AutoCAD session (textbox content, listbox content ...). But I must say that I prefer to collect the data within a function which calls a modal form or I keep all data in global variables or in the blackboard (via vl-bb-set) if I use modeless forms. Then I will set all the data within OnInitialize to its controls.

If you like, I can help you create this tool with a palette.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Kelie

Thanks Fred.

Quote from: Fred Tomke on June 06, 2009, 04:11:34 AM
but only if you do not call (dcl_project_load "MyProject" T) before.

That must be it. I'll try (dcl_project_load "MyProject" nil) later.

Quote from: Fred Tomke on June 06, 2009, 04:11:34 AM
If you like, I can help you create this tool with a palette.

Learning to use palette (not particularly for this program) is definitely on my to do list. Thanks for offering your help. I'll post questions here when I have.