Home > Community > Forums > Custom IC SKILL > triggering the done procedure for enterPoints()

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: *

 triggering the done procedure for enterPoints() 

Last post Fri, Feb 14 2014 5:54 AM by Andrew Beckett. 8 replies.
Started by jaleco 12 Sep 2013 01:43 PM. Topic has 8 replies and 3560 views
Page 1 of 1 (9 items)
Sort Posts:
  • Thu, Sep 12 2013 1:43 PM

    • jaleco
    • Top 100 Contributor
    • Joined on Wed, Mar 21 2012
    • Albuquerque, NM
    • Posts 74
    • Points 1,060
    triggering the done procedure for enterPoints() Reply
    I am using an enterPoints function that does not seem to recognize use of the Enter key, or a double click (typical done trigger for enterPath) as triggers for its done procedure.  How does one trigger the done procedure for enterPoints?  The esc key is recognized as a cancel function.  The form contains a cancel button, but no done button.
    • Post Points: 5
  • Thu, Sep 12 2013 2:47 PM

    • jaleco
    • Top 100 Contributor
    • Joined on Wed, Mar 21 2012
    • Albuquerque, NM
    • Posts 74
    • Points 1,060
    Re: triggering the done procedure for enterPoints() Reply
    PS - I can use the ?wantPoints parameter, but was looking for something in the user interface to trigger the done procedure...
    • Post Points: 20
  • Fri, Sep 13 2013 3:26 AM

    Re: triggering the done procedure for enterPoints() Reply

    Well, first thing to check is that the bindkeys for Enter and double click left mouse are set, but assuming they are, I suspect it's probably because you're not using a ?doneProc with enterPoints and have "Repeat Commands" set in the Options->Editor form.

    If Repeat Commands is enabled, then the enterPoints() function does not return after you've hit the return key or double-clicked - instead, it goes back to the "first" prompt again and asks again. Since the expected use model with an enterFunction is to use the ?doneProc callback to do the action, this makes sense - as it allows you to repeatedly do the same thing over and over again.

    You can observe this by doing:

    procedure(MyDoneProc(win ok points)  printf("FINISHED: %L %L\n" ok points))
    enterPoints(?prompts '("first" "next") ?doneProc "MyDoneProc")

    You should see the "FINISHED" message when you hit return or double click. Is that happening? Also, the prompt will go back to "first" rather than "next". Then also try turning off Repeat Commands and see what happens.

    Kind Regards,

    Andrew.

    • Post Points: 20
  • Thu, Jan 30 2014 1:56 PM

    • jaleco
    • Top 100 Contributor
    • Joined on Wed, Mar 21 2012
    • Albuquerque, NM
    • Posts 74
    • Points 1,060
    Re: triggering the done procedure for enterPoints() Reply

    Andrew,

    very sorry for the embarrassing long time that has passed while this issue got buried on my end.  My problem with the ?doneProc turned out to be a dumb code typo.  However, I am still looking into how to manipulate the ?wantPoints and ?points parameters if possible.

    Due to the time that has passed since looking at this, I will create a new post if necessary.

    Thank you again.

    • Post Points: 20
  • Thu, Jan 30 2014 3:26 PM

    Re: triggering the done procedure for enterPoints() Reply

    I'm not sure what you're trying to do - the ?wantPoints and ?points are fairly clear in the documentation, so I'm not sure what your issue is.

    No problem with continuing through this topic thread, because it's related (and you're the same person!)

    Regards,

    Andrew.

    • Post Points: 20
  • Tue, Feb 4 2014 9:53 AM

    • jaleco
    • Top 100 Contributor
    • Joined on Wed, Mar 21 2012
    • Albuquerque, NM
    • Posts 74
    • Points 1,060
    Re: triggering the done procedure for enterPoints() Reply

    Hi Andrew,

    I am trying to use a form field to pass a value to ?wantPoints, and to make this dynamic such that if the field value is changed, that ?wantPoints would be updated, but this does not seem to be possible.  Once I have begun the enterPoints() function, ?wantPoints is fixed. So the solution to this is to de-couple the form from enterPoints(), using a button to launch enterPoints() once the form field values have been defined (user has a chance to change them).  If you know of a better way, please share.

    I also got a solution for deleting duplicate points in the points list within the ?addPointsProc, using (surprise) deletePoint(), where I had been trying to manipulate the points list and re-assign it to the form.  Reassigning the points list was not working for me.  The code below works as the callback for ?addPointProc to delete duplicate points:

    procedure(CCSdelPt(win ptList)
     println(ptList)
     ptList=reverse(ptList)
     when(member(car(ptList) cdr(ptList))
      deletePoint()
      ); when
    ); procedure CCSdelPt

    Filed under: ,
    • Post Points: 20
  • Tue, Feb 4 2014 9:56 AM

    Re: triggering the done procedure for enterPoints() Reply

     I think you'd probably need to use changeEnterFun() to do that (the first thing). But I've not tried...

    Andrew.

    • Post Points: 20
  • Thu, Feb 13 2014 6:50 PM

    • jaleco
    • Top 100 Contributor
    • Joined on Wed, Mar 21 2012
    • Albuquerque, NM
    • Posts 74
    • Points 1,060
    Re: triggering the done procedure for enterPoints() Reply

    Andrew,

    you were right, I was able to reset ?wantPoints using changeEnterFun().

    Could you offer any advice about the ?delPointProc portion of enterPoints()?  I don't see how to actually delete, or undo a point while enterPoints is collecting keyboard/mouse entries....I've tried testing with the Escape and Delete keys, and the bindkey for "undo".  None seem to trigger the ?delPointProc...

    Filed under:
    • Post Points: 20
  • Fri, Feb 14 2014 5:54 AM

    Re: triggering the done procedure for enterPoints() Reply

    Hit backspace - this is the key normally used to delete a point already entered - and that would delete the last point and trigger the delPointProc.

    It corresponds to the deletePoint() function.

    Andrew.

    • Post Points: 5
Page 1 of 1 (9 items)
Sort Posts:
Started by jaleco at 12 Sep 2013 01:43 PM. Topic has 8 replies.