Home > Community > Forums > PCB SKILL > blocking of Forms

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 blocking of Forms 

Last post Tue, May 22 2012 7:04 PM by SkilSiao. 5 replies.
Started by SkilSiao 03 May 2012 01:30 AM. Topic has 5 replies and 2697 views
Page 1 of 1 (6 items)
Sort Posts:
  • Thu, May 3 2012 1:30 AM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Tue, Oct 11 2011
    • Posts 38
    • Points 565
    blocking of Forms Reply

    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.

    • Post Points: 20
  • Thu, May 3 2012 4:44 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 296
    • Points 4,710
    Re: blocking of Forms Reply

    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.

    • Post Points: 20
  • Thu, May 3 2012 5:52 PM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Tue, Oct 11 2011
    • Posts 38
    • Points 565
    Re: blocking of Forms Reply

    Hi fxffxf, Thank you very much for the help.

    The function  axlUIWBlock(form_handle) works well.

    • Post Points: 5
  • Tue, May 22 2012 2:34 AM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Tue, Oct 11 2011
    • Posts 38
    • Points 565
    Re: blocking of Forms Reply

    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)

    axlFormDisplay(temp_form)   axlUIWBlock(temp_form)

     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.

    • Post Points: 20
  • Tue, May 22 2012 4:40 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 296
    • Points 4,710
    Re: blocking of Forms Reply

    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.

    • Post Points: 20
  • Tue, May 22 2012 7:04 PM

    • SkilSiao
    • Top 200 Contributor
    • Joined on Tue, Oct 11 2011
    • Posts 38
    • Points 565
    Re: blocking of Forms Reply

    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.

    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by SkilSiao at 03 May 2012 01:30 AM. Topic has 5 replies.