Announcement

Collapse
No announcement yet.

non blocking code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • non blocking code

    Hi,

    I've been using the example for the listbox to display the files on my uSD card, however, if I try to add buttons or more functionalities, it gets blocked, I'm trying to achieve to add a dynamic functionality and interact with the files.

    Does somebody have an example of how to do it?

    Regards

  • #2
    Greetings,

    May I confirm which example are you referring to?

    With regards to this,

    “if I try to add buttons or more functionalities, it gets blocked”
    - It would be best if you can send us your project and a video containing the issue you have mentioned.

    Can you also add further details about what you want to achieve in your project?

    Thank you and Best Regards,
    Pearl
    Pearl

    Comment


    • #3
      Hi,

      I apologize for my late response,

      I think my problem comes more on this context, I added three buttons, and when I try to get which button was pressed using img_Touched(hndl,-1) method it doesn't work, however if I specify the index, the button works correctly, but just the button I specified.

      this is an example (on this case, only the button named "ibtnDown" works) sending the -1 as index on the img_Touched method doesn't work.

      Code:
      switch (touch)
          case TOUCH_PRESSED:
              imgtouch:=img_Touched(hndl,ibtnDown);
              switch (imgtouch)
                  case iWinbutton1:
                      img_SetWord(hndl, imgtouch, IMAGE_INDEX, 1); // where state is 0 for up and 1 for down
                      img_Show(hndl,imgtouch) ;
                      gfx_MoveTo(500,450);
                      putstr("XXXXXXXXXXXXXXXXXXXX");
                      break;
                  case ibtnUp:
                      img_SetWord(hndl, imgtouch, IMAGE_INDEX, 1); // where state is 0 for up and 1 for down
                      img_Show(hndl,imgtouch) ;
                      if(fileIndex<0)
                          fileIndex:=itemcnt;
                      endif
                      printitems(fileIndex--);
                      break;
                  case ibtnDown:
                      img_SetWord(hndl, imgtouch, IMAGE_INDEX, 1); // where state is 0 for up and 1 for down
                      img_Show(hndl,imgtouch) ;
                      if(fileIndex>itemcnt)
                          fileIndex:=0;
                      endif
                      printitems(fileIndex++);
                      break;
              endswitch
              break;
          case TOUCH_RELEASED:
              break;
      endswitch
      Last edited by Juniel Cruz; 2nd October 2018, 12:11 PM.

      Comment


      • #4
        Hi,

        I tried replicating the issue you have mentioned with regards in using the img_Touched(hndl, -1) however it works fine on my end.

        It would be best if you can send us your project for us to further analyse the problem.

        Also, it would be helpful if you can send us a video having the issue.

        Thank you and Best Regards,
        Pearl
        Pearl

        Comment


        • #5
          It seems all the problem was because I forgot to disable the touch property on the form.

          img_SetAttributes(hndl,iForm1,I_TOUCH_DISABLE);

          Sorry for being a waste of time.

          Comment

          Working...
          X