Tag Info

New answers tagged

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}, ...


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]


0

The following code is usable and does the trick, except it does not permit constraining entry points to specific values, for example even numbers on the horizontal axis (like years for example). Still, it does everything else, and also permits very flexible adjustment of the size and shape of the input space, so I think it is worth sharing. Instructions ...


0

The principal question seems to be how to format matrix input in matrix form. The rest is not explained clearly enough for me to address and seems extraneous. The OP's approach: Manipulate[value[a, b, c, d, e, f, g, h, i], Style["Matrix values", 12, Bold], Grid[{ {Control@{{a, 0}, InputField, ImageSize -> Small}, Control@{{b, 0}, InputField, ...



Top 50 recent answers are included