Home AMX User Forum AMXForums Archive Threads Tips and Tricks

dynamically move a button

I've been searching the forum for a bit looking up an old thread where someone took the touch position and moved a button with the touch location.

I am trying to make a button have a drag and drop effect, but using the "^top-1" only gives me the press and release location, I want the active location as I drag my finger across the screen.

Am I making up seeing someones example of this or do I just suck at seaching for the right keywords?


Thanks in advance.. also maybe someone has a good tip for this next part:

I have a row of inputs that the user can select from to view, they have the option to view a multiviewer with multiple inputs displayed at once; I have a multiviewer edit page, which has buttons on it that match their onscreen location. Currently when you go into this edit mode, if you click on an input then on the screen location button, you set that input to that portion of the screen of the multiviewer. I want to allow the user to drag that input button image over the button for that part of the multiviewer and that sets its location when they drop (release) the input button.

See attached images for this:

Comments

  • HARMAN_ChrisHARMAN_Chris Posts: 597
    Have you looked through the custom event options in the programming guide?
    pdf page 138: http://amx.com//assets/manuals/ModeroXSeries.ProgrammingGuide.pdf

    The release coordinates are generally what most people use here. Is there a reason you need real time x,y location as opposed to the release location?

    As a point of clarification, are you trying to move a button based on a user press in open space? i.e. have a button relocate to a part of the screen in response to a user touch?
  • rrdbstudiosrrdbstudios Posts: 160
    AMX_Chris wrote: »
    Have you looked through the custom event options in the programming guide?
    pdf page 138: http://amx.com//assets/manuals/ModeroXSeries.ProgrammingGuide.pdf

    The release coordinates are generally what most people use here. Is there a reason you need real time x,y location as opposed to the release location?

    Im specifically going for the active drag and drop.. so the user can see where the icon is being dragged. Once dropped the icon will disapear and the text that follows that icon will show up in the multiviewers window location in the editor pane.

    Im running out of time to get this option to work though, I have too much other stuff to do to clean up this system before it goes into testing; I really hope to make this option work, as Im doing it because the users were wowed by cre$trons ability to do this easily with their new smart objects. This system is already half Cre$tron.. the multiviewers are DVPHD's .. along with the video switcher being a DM 32x32 lol
  • HARMAN_ChrisHARMAN_Chris Posts: 597
    The attached code (and panel) is a crazy simple block I wrote to test a reported issue with this feature. Documentation indicated the event would happen on a particular custom event port and it was really happening on another port. This code simply tells you via telnet send string the custom event data flowing into the master. I wrote it for a huge range of custom events that could come from the panel. My initial prognosis was that the event number was documented incorrectly and not the port number - hence why I gave it such a large test range.

    A good number of dealers are using this approach to achieve the drop-and-drag effect.
  • rrdbstudiosrrdbstudios Posts: 160
    AMX_Chris wrote: »
    The attached code (and panel) is a crazy simple block I wrote to test a reported issue with this feature. Documentation indicated the event would happen on a particular custom event port and it was really happening on another port. This code simply tells you via telnet send string the custom event data flowing into the master. I wrote it for a huge range of custom events that could come from the panel. My initial prognosis was that the event number was documented incorrectly and not the port number - hence why I gave it such a large test range.

    A good number of dealers are using this approach to achieve the drop-and-drag effect.

    Great! Thank you Chris, Ill check this option out.
  • rrdbstudiosrrdbstudios Posts: 160
    AMX_Chris wrote: »
    The attached code (and panel) is a crazy simple block I wrote to test a reported issue with this feature. Documentation indicated the event would happen on a particular custom event port and it was really happening on another port. This code simply tells you via telnet send string the custom event data flowing into the master. I wrote it for a huge range of custom events that could come from the panel. My initial prognosis was that the event number was documented incorrectly and not the port number - hence why I gave it such a large test range.

    A good number of dealers are using this approach to achieve the drop-and-drag effect.

    Panel was not attached btw
  • HARMAN_ChrisHARMAN_Chris Posts: 597
    My apologies. Your panel file should work with the code block, but the attached is what I made to go along with the axw. Again, the code simply tells you what came in with the custom event because this visibility is not currently available within NS diagnostic messaging.
  • Posted this in another thread a few years ago. Think I prefer the term deceptively simple aot crazy simple.

    http://www.youtube.com/watch?v=fYdyPN6HmvA
  • PhreaKPhreaK Posts: 966
    '^TOP-3' is the command you are after.

    I've just popped a demo project with some of my multitouch experiments up on GitHub - TouchTracker.axs shows it in use. For the guys who were at AMX13 in Australia this was the precursor to the multitouch demo there. That one was actually powered by a Duet multitouch UI library I've been working on. It needs a bit of cleaning up and commenting (which I'm trying to get time to do) but uses the same principal - just implemented a little neater.
  • rrdbstudiosrrdbstudios Posts: 160
    icraigie wrote: »
    Posted this in another thread a few years ago. Think I prefer the term deceptively simple aot crazy simple.

    http://www.youtube.com/watch?v=fYdyPN6HmvA

    This is the exact video I remember seeing, I believe it was embedded into a thread.. Thank you icraigie!
  • rrdbstudiosrrdbstudios Posts: 160
    PhreaK wrote: »
    '^TOP-3' is the command you are after.

    I've just popped a demo project with some of my multitouch experiments up on GitHub - TouchTracker.axs shows it in use. For the guys who were at AMX13 in Australia this was the precursor to the multitouch demo there. That one was actually powered by a Duet multitouch UI library I've been working on. It needs a bit of cleaning up and commenting (which I'm trying to get time to do) but uses the same principal - just implemented a little neater.

    This is EXACTLY what I needed Kim! Thank you so much
  • a_riot42a_riot42 Posts: 1,624
    What does the command ^PUN-1 do? I can't find any documentation about it.
    Paul
  • rrdbstudiosrrdbstudios Posts: 160
    a_riot42 wrote: »
    What does the command ^PUN-1 do? I can't find any documentation about it.
    Paul

    pdf page 138: http://amx.com//assets/manuals/Moder...mmingGuide.pdf

    Custom Events for Popups
    ^PUN
    Notifies when a
    popup custom
    event has been
    sent to the Master.
    When a popup is attached, detached, or moved on a page, a custom event is sent to the
    master from port 1 of the device to indicate the popup's location. On a move, the custom
    event is sent when the move is complete but not when the moves starts or is in progress.
    Notifications happen via a custom event (1323) sent to the master. The same event type
    (132) is used for ?PUL responses.
    Syntax:
    '^PUN-<enable>'
    Variable:
    enable: 0 = disable, 1 = user pages only, and 2 = all pages (user + system)
    Custom Event fields:
    ID = 0
    Type = 1323
    Flag = operation (0=location query, 10=attach, 20=drag, 30=detach)
    Value1 = x coordinate of popup
    Value2 = y coordinate of popup
    Value3 = 0
    Text = popup name
    Text = popup name
Sign In or Register to comment.