Hi, I want to create a form (my_form) that after it is displayed, the background functions or other opened forms cannot be activated again until this form (my_form) is closed. (Just like PackStack Editor, once it is opened, the rest of the functions are only available again when PackStack Editor is CLOSED).
my approach (to create) is like this,
my_form = axlFormCreate((gensym) "my_form.form" '("CENTER" "msglines" 1) 'my_form_Action nil nil)
the my_form comes with an "Ok" button to close the form and another action button for some updating tasks, and that is why i need a Callback function 'my_form_Action. The g_nonBlock i leave it as nil as per the description of the function, but this doesnt not seem working... Things are still able to be run with the my_form opened.
How shall go around with this? is there a way to pause everything first until my_form is closed? Thx in advance.
see example @ <cdsroot>/share/pcb/examples/skill/form/basic/axlform.il
In this file look for the procedure blockTest.
The key to blocking a window is axlUIWBlock.
The 'block option to axlFormCreate indicates to the user via a title bar change that the dialog is blocking.
Hi fxffxf, Thank you very much for the help.
The function axlUIWBlock(form_handle) works well.
Hi, just an extension from this question. i create a form and display it with axlUIWBlock in the main function:
temp_form = axlFormCreate((gensym) "form_file1.form" position '_form_file1_action t nil)
now in the _form_file1_action, i want to return a value once the temp_form is closed. (from an "ok" button)
which is shown below:
("done" ... ...
; say, i wan to return a varA to the main function.
axlClearSelSet() axlFinishEnterFun() axlFormClose(temp_form) )
how shall i achieve this? such that the main function can receive the varA...
Thx in advance.
For a blocking form you typically don't need to use axlFinishEnterFun()
In your callback handler, _form_file1_action, on a done or cancel event assign a user attribute to the form handler. For example do:
temp_form->MyFormIsDone = <my_value>
In your main function (after the axlUIWBlock), you will be able to fetch the the value from temp_form->MyFormIsDone and return it.
When assigning user attributes to the form handler (temp_form), capitalize the first letter to avoid any conflicts with pre-defined Cadence attributes.
Hi fxffxf, thanks for the help and advice. Yes, just continue in the main function to capture the form handle attribute can do, because i am thinking that the form handle may have "gone" once it is close, and usually we execute the "action" with the attributes when users are having interaction with the forms.
thanks again, you have always been very helpful.