how to reset odcl project

Started by jromkes, April 14, 2009, 03:30:44 AM

Previous topic - Next topic

jromkes

How do I reset an odcl project.

I have a poject with a form. On the form I placed a button Reset to reset the form.
I tried al kinds of different things, like unloading, reloading etc. to reset the form to the initial values.
But I can't get any results.

Can anyone help me?

Slavko Ivanovic

#1
Hi there.
I'm no sure what you want to do in general.
You didn't provide any screen shot or code segment.


If you want to set some values to form elements, why not use function with multiple
set functions.

Project_Load with argument T always load initial values, but U probably know that.
If not read about Project_Load in Control Browser.

But anyway i don't know exactly where you facing with problems.
Send some code or screen shot. 


***  siCAD Solutions for AutoCAD  ***
ArchiTools l ToolsPlus l LandTools l LBE

Fred Tomke

Hello, jromkes,

welcome to OpenDCL. Unfortunately, there is no reset method to reset the form as known from HTML forms.
You can either call the Project_Load method as Slavko meant or you have to keep initial values which are set and placed when the user presses the reset button.

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

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

Slavko Ivanovic


Quote from: Slavko.Ivanovic on April 14, 2009, 04:29:31 AM
... If you want to set some values to form elements, why not use function with multiple
set functions.

Quote from: Fred Tomke on April 14, 2009, 06:53:33 AM
.... or you have to keep initial values which are set and placed when the user presses the reset button.
Fred
Fred
We are talking about the same thing, and when i read are posts again, i myself get confused.

  :D  ;D

jromkes, don't get confused with the way me and Fred trying to tell U what is all about.

Its simple:

1. If U creating forms in studio, and testing it in AutoCAD, and U want to see changes instantly,
   then instead (DCL_PROJECT_LOAD "My_Project") in your code put (DCL_PROJECT_LOAD "My_Project" T)

2. If you really need a button to reset form values, then you must write functions to set properties (values),
   for each control in form separately (in this case to set them to wanted "initial" values), and add them in
   button_OnClicked event function.
   (or u can make more intelligent function with arguments to call that function button_OnClicked event)


***  siCAD Solutions for AutoCAD  ***
ArchiTools l ToolsPlus l LandTools l LBE

jromkes

Thanks for the solutions.

I now added a little bit of code that changes all the changed properties to their initial values.

Jaco