I'm trying to create an attached cell that can be mouse dragged. I'm envisioning mouse-dragging the blue header bar to bring the entire header and the graphic to a new location at which point both will be locked to that location. The graphic needs to be rotatable by mouse-drag.
This is what I have so far:
AttachCell[EvaluationNotebook[], DynamicModule[{pt = {0, 0}},
EventHandler[Graphics[Inset[Style[Grid[{
{Button["Close", NotebookDelete[EvaluationCell[]],
ImageSize -> All, Appearance -> Button]}, {Plot3D[
Sin[x y], {x, 1, 4}, {y, 1, 3}, ImageSize -> 300]}},
Frame -> True,
Background -> {None, {LightBlue, White}}],
Deployed -> False],
Dynamic[pt]],
PlotRange -> 10, ImageSize -> Scaled[1], Frame -> False],
{"MouseDragged" :> (pt = MousePosition["Graphics"])},
PassEventsDown -> True, PassEventsUp -> True]], Center, 0,
Center];
Notice in the video below I can drag the graphic anywhere using the header. However, a mouse-drag inside the graphic is both rotating the graphic and dragging the graphic causing the strange behavior. I want the grid draggable but only from the blue header as I still want to rotate the graphic. Any ideas?