Home AMX User Forum NetLinx Studio

X + Y Coordinates ??

Ok so i have manged to find commands how to set x and y coordinates for Pop up Show effect and Pop up Hide Effect, but is there a way to actually move a button or pop up from code directly ? ... also can i reference the last "Cursor" Value pushed on the panel to store it in a variable, so i can know exactly where a user last pushed location wise on the panel?...

Thanks Guys.

Comments

  • jjamesjjames Posts: 2,908
    Use BMF-<address>,<state>,%R<left>,<top>,<right>,<bottom>

    The right and bottom kind of threw me off at first, but keep in mind that right = left + width of button, and bottom = top + height of button, you'll be good to go. I'm starting to use this now instead of making several popups display custom navigation of each room.
  • jjames wrote: »
    Use BMF-<address>,<state>,%R<left>,<top>,<right>,<bottom>

    The right and bottom kind of threw me off at first, but keep in mind that right = left + width of button, and bottom = top + height of button, you'll be good to go. I'm starting to use this now instead of making several popups display custom navigation of each room.

    AWSOME.. thanks man, you wouldn't happen to know if there is a way to store cursor value of a finger press???
  • jjamesjjames Posts: 2,908
    send_command dvTP, '^TOP-1' // use 0 to disable

    This will return the press coordinates and the release via the string event for your TP, but no real-time dragging updates.
  • jjames wrote: »
    send_command dvTP, '^TOP-1' // use 0 to disable

    This will return the press coordinates and the release via the string event for your TP, but no real-time dragging updates.

    WICKED ! LOL.. you are making my day great .. I cant get the BMF command to work though, does the address portion of that command reference an address code or channel code of a button? or can you only reference a pop-up address?
  • jjamesjjames Posts: 2,908
    Good question! I know for a fact BMF (along with TXT, BMP, etc.) works with buttons with a channel address / variable text address. I've never tried it on a popup before however, though I would imagine it would work as well.
  • jjames wrote: »
    Good question! I know for a fact BMF (along with TXT, BMP, etc.) works with buttons with a channel address / variable text address. I've never tried it on a popup before however, though I would imagine it would work as well.

    Yep cant seem to get that command to work with a pop-up... but for some reason i cant even get it to move a button, does this actually move a button? or does this command only move absolute text in a button ?

    Can you write me an example. of you you write it. cause im doing this.

    "'^BMF-200,0,%R20,28,43,23'"

    and its a no go for me.. 200 would be my address and 0 my state.
  • jjamesjjames Posts: 2,908
    send_command dv_tp[i_panel],"'^BMF-1011,0,%R121,109,227,157'";
    send_command dv_tp[i_panel],"'^BMF-1012,0,%R13,109,119,157'";

    Button 1 (top image): 121 pix from left, 109 pix from top, 121 + 106 = 227, 109 + 48 = 157

    Button 2 (bottom image): 13 pix from left, 109 pix from top, 13 + 106 = 119, 109 + 48 = 157

    So . . . in ^BMF-1011,0,%Ra,b,c,d
    a = left
    b = top
    c = a + width
    d = b + height
  • svTechsvTech Posts: 44
    Reference the coordinates to the 0,0 point on the TP not on the pop-up. I had that issue for a long time until I realized that the buttons were just off to the side of the panel where I couldn't see them.

    And yes, the command definitely works for buttons. Can't comment on pop-ups.
  • jjames wrote: »
    send_command dv_tp[i_panel],"'^BMF-1011,0,%R121,109,227,157'";
    send_command dv_tp[i_panel],"'^BMF-1012,0,%R13,109,119,157'";

    Button 1 (top image): 121 pix from left, 109 pix from top, 121 + 106 = 227, 109 + 48 = 157

    Button 2 (bottom image): 13 pix from left, 109 pix from top, 13 + 106 = 119, 109 + 48 = 157

    So . . . in ^BMF-1011,0,%Ra,b,c,d
    a = left
    b = top
    c = a + width
    d = b + height

    Thank you soooo much man !! appreciate it.
  • jjamesjjames Posts: 2,908
    Glad I could help! Be sure to read svTech's post after mine.

    This is the kind of stuff AMX needs to teach in classes: The power of using the built-in functions as opposed to Visual Architect and pushing AMXhome. The two greatest tools in any AMX project is TPD4 and NetLinx Studio. Custom will ALWAYS be better than the canned crap.
  • Agreed ! it is barely covered in the AMX PI for the products as well... Im working on a project where it is imperative i can move these on the fly. Thanks man.
Sign In or Register to comment.