Tag Info

Hot answers tagged

6

rulf[x_] := Function[{y}, If[EvenQ[x - y], Style[y, Red, Bold], y]] DynamicModule[{rul = Identity}, Column[EventHandler[Dynamic[rul@#], {"MouseMoved" :> (rul = rulf@#)}] & /@ Range@5]


2

For example: sol = First@ NDSolve[{Θ'[t] == 2 Θ[t] + .1, ϕ'[t] == 1, ϕ[0] == 0, Θ[0] == .1}, {Θ, ϕ}, {t, 0, 1}] f[t_] := {Cos[ϕ[t]] Sin[Θ[t]], Sin[ϕ[t]] Sin[Θ[t]], -Cos[Θ[t]]} Manipulate[Show[ ParametricPlot3D[f[t] /. sol, {t, 0, 1}, PlotStyle -> Transparent], ParametricPlot3D[f[t] /. sol, {t, 0, T}, PlotStyle -> {Thick, ...


2

Since this has gone unanswered for so long and I can add one clarification to the comments under the question, I'll fill out an answer. In the comments, it has been observed that the following work (with the appropriate definition of customControl): {{x, 0}, customControl[#1, y] &} {{x, 0}, customControl[Dynamic[x]] &} {{x, 0}, ...


2

The text is stored (upon releasing the mouse button) in the variable val with this code: EventHandler[ InputField[], {"MouseUp" :> (val = CurrentValue["SelectionData"])}, PassEventsDown -> True ] It should work in other contexts as well besides InputField, as I noted in my comment it is not clear from your question what the context is.


2

The following copies the selected text to the clipboard DynamicModule[{}, EventHandler[Dynamic@InputField[x], {"MouseUp" :> FrontEndExecute[FrontEndToken[FrontEnd`SelectedNotebook[], "Copy"]]}, PassEventsDown -> True]]


2

Use the function: "EventHandler", just like follows: reportDate = Today; a = Dynamic[ With[{date = Interpreter["Date"][reportDateInput]}, If[DateObjectQ@date, reportDate = date, reportDate]], TrackedSymbols :> {reportDateInput}]; b = InputField[ Dynamic[reportDateInput, {None, With[{date = Interpreter["Date"][#]}, ...


2

Manipulate[{ m = {{a, b}, {c, d}}; Column[{r = Thread[m.{x, y} == {f, g}], s = LinearSolve[m, {f, g}]}], ContourPlot[Evaluate@r, {x, -5, 5}, {y, -5, 5}, PlotLabel -> s]}, {{b, 3}, 0, 3}]


2

Expanding on Kuba's answers, if you use Dynamic for both controls I believe you can fully accomplish your goal. When you set filter it will both gray out the elements less than the filter in list and if the element in list is less than the filter it will reset it to the filter value. Manipulate[ {filter, list}, (* Manipulate Controls *) {{filter, 1}, ...



Only top voted, non community-wiki answers of a minimum length are eligible