I want to create a new display type, especially for numbers or text, but potentially for arbitrary objects as well. I want a "drag box" where not all of the number (object) is visible, but dragging left and right on the object itself slides it left and right (or in a generalized form both x and y).
No scroll bars should be visible, and it should be tightly integrated much like
Framed so that it can be used in different places without difficulty.
In Chat Szabolcs showed how to get the basic functionality. However, there are problems with this implementation as he notes:
N[Pi,100]shouldn't be recalculated constantly
... Dynamic doesn't work inside the
when the mouse leaves the region, it stops working, and for good usability it shouldn't
I don't observe #3 on my system (Win7/mma7) but I do note another problem: Dragging the text left (looking at the least significant digits) it is possible to drag the object completely out of frame. Dragging it right does not move it out of frame but causes a memory of the drag such that it appears "stuck" when you start dragging left, though it eventually moves.
How can this function be implemented most efficiently and flexibly?
Can it be made to work inside a
Textobject the way