Mouse drag change dynamic panel states

I am working on a prototype that has several dynamic panels and I need multiple things… on click change panel state (Got that working fine) button to select all (Working fine) clear all (working fine) but I need the user to drag their mouse over several of the dynamic panels and have the state change. Not really mouseover but a select area with the mouse. can anyone help with this?KBM_help.rp (110.7 KB)

Might help if you could post your .rp file so we can understand just what you mean… Also, some detailed questions I have for you:

  • When you say “drag their mouse”, is it a true drag (click down, move mouse, release) or is it a “hover and move mouse” action over your “select area”?
  • When you say “over several of the dynamic panels” do you mean user should drag from one panel across another panel? Or is it drag over Panel-1 to change states of Panel-1, and a separate action where user could drag over Panel-2 to change states of Panel-2?
  • By “select area” do you mean “a specific area” or “a widget/group which is selected” (versus unselected)?

Some general tips…

  • You can use the OnDrag event to trigger a change of dynamic panel state. Or, if it is more of a “hover and move” user action, you can use the OnMouseMove event (find this under the “More Events” droplist).
  • You’ll want to add a condition to test if the mouse cursor is over your “select area” and if the mouse has moved a certain amount (how far should user drag before a state changes? Probably something like 10-20 px, depending on how big the area is and how many states to change.) There are built-in conditions and variables you can use for this, such as “If cursor is over area of widget MyArea” and “if [[TotalDragY]] is greater than 10” …something like this:

…and if so, perform an action like, “Set This Widget to Next” (or some specific state). You could also add another condition to test “if [[TotalDragY]] is less than 10” to change state to Previous.

  • If you have many states and want to change the state with every 10 px of mouse movement, use an algorithm with the modulus operator, such as “If [[TotalDragY % 10]] equals 0”.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.