2

I'd like to create a Manipulate with custom objects in the control area (like a circuit diagram) that reacts to the user interacting with the manipulate controls (e.g. highlighting the component being manipulated by the user).

Are there other functions/symbols besides $ControlActiveSetting (which does not discern which symbol is being manipulated) and ControlActive (which only evaluates to one of two things depending on wether the act in ControlActive[act, norm] is currently manipulated or not)? Ideally I'd like to have something like $ControlActiveSetting for individual symbols so that I can query those and change my display accordingly.

Sascha
  • 8,459
  • 2
  • 32
  • 66
  • The second argument of Dynamic or TrackingFunction can be used to achieve such behavior. – Karsten7 Jun 15 '16 at 20:39
  • @Kuba I tied EventHandler already but it seems to interfere with the behavior of Slider. Try DynamicModule[{col = White, z}, EventHandler[ Slider[Dynamic@z, {0, 1}, Background -> Dynamic@col], {"MouseDragged" :> (col = Red), "MouseUp" :> (col = White)}]]. If you remove the "MouseUp"-event the slider behaves as it should. – Sascha Jun 15 '16 at 20:44
  • Add PassEventsDown -> True and it's fine. You can also use the second argument of Dynamic. – Kuba Jun 15 '16 at 20:50
  • Cloud you prepare a code samples with desired effects you struggle to achieve? – Kuba Jun 15 '16 at 20:51
  • I had a look at the second argument of Dynamic and the variant Dynamic[expr, {f, fEnd}] works like a charm once I looked it up. Even though this all is listed in the documentation and there are useful examples, I think it is easy to miss. – Sascha Jun 15 '16 at 20:56
  • @Sascha Sure, documentation is huge. Do you want to provide an example, or maybe we can find a duplicate about synchornizing dynamic elements. Like here: 30354 – Kuba Jun 15 '16 at 21:01
  • @Kuba Once I finish my work I'd gladly post it as an answer. I think it might be instructive to other users and seems not to be covered yet by other questions/answers about the second argument to Dynamic – Sascha Jun 15 '16 at 21:05
  • Hard to say without examples but it's not new: http://mathematica.stackexchange.com/search?q=second+argument+of+dynamic – Kuba Jun 15 '16 at 21:06

0 Answers0