OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: khann on April 20, 2010, 07:05:10 PM

Title: Can I write some text on the Control before form_show ?
Post by: khann on April 20, 2010, 07:05:10 PM
Hi.

Just After
(setq *ODCL_Proj_Name (dcl_project_import  *Temp_ODCL_Form nil nil))

Before (dcl_Form_Show *Temp_Form )

Can I do some action on the Control in the Form?
Like writing text on the textbox?

Any help will be appreciate.
Thanks.
Title: Re: Can I write some text on the Control before form_show ?
Post by: owenwengerd on April 20, 2010, 09:28:21 PM
You can do that in the form's OnInitialize event handler function.
Title: Re: Can I write some text on the Control before form_show ?
Post by: khann on April 20, 2010, 09:34:25 PM
 :)
Thanks. I just got it.
Title: Re: Can I write some text on the Control before form_show ?
Post by: khann on April 20, 2010, 11:20:59 PM
And there,

I think the form is ready to show but it still waiting.

Before showing the form I'm getting number with (getreal  ).

But the form keeps its focus then I need click the CAD Screen to come back.

I'm loading a Modaless form and before showing the form need user input number value.

The form designed has Keep Focus Ture property. Does this matter?

Thanks.

Title: Re: Can I write some text on the Control before form_show ?
Post by: Fred Tomke on April 21, 2010, 01:20:30 AM
Yes, it may. You can cange the status of the property for the time of getreal. Another idea would be to use dcl_setcmdbarfocus to change the focus to the command-line.

Code (autolisp) Select
(dcl_control_setkeepfocus MyProj_MyForm nil)
(dcl_setcmdbarfocus)
(setq reaNumber (getreal "\nNew value: "))
(dcl_control_setkeepfocus MyProj_MyForm T)
(dcl_controlsetfocus MyProj_MyForm_MyControl)


BTW: why don't you create a textbox for input the needed value?

Fred
Title: Re: Can I write some text on the Control before form_show ?
Post by: Fred Tomke on April 21, 2010, 01:27:43 AM
I've just read your post once again. My first answer depends on the case the form is already visible and the user shall input something.
But did I understand you right, that you want to let the user input a number value between (dcl_form_show ) and before the form appears after finishing OnInitialize? It may be that it wouldn't work properly.
I'd either prefer to let the user input a number before (dcl_form_show ) or set a default number and let the user change the value in the form in a textbox with NumberStyle.

Fred
Title: Re: Can I write some text on the Control before form_show ?
Post by: khann on April 21, 2010, 07:31:28 PM
Thanks Fred, for your reply.

I make it out like this way.
Before get in "form_OnInitialize" routine , I've packed up user input values on a List Var of global variable.
At end of this sub function I call the (dcl_form_show).

Then in the "form_OnInitialize" routine, I set values in the TextBox Control.