[[!redirects The Window Manager Dragging]] h6. [[WindowManager]] h6(. » [[WindowManager Technical Details|Technical Details]] h6((. » Dragging h2(#overview). Overview RISC OS uses dragging in a consistent way throughout the Desktop. There are two main types of drag operations: |_<^. # |_<^. Operation |_<^. Description | |<^. 1 |<^. System |<^. For dragging a window’s position, size or scroll offsets. This is mostly used with windows that have no title bar, or those with no Adjust Size icon. | |<^. 2 |<^. User |<^. For moving or re-sizing objects within a window. | h2(#basic_dragging_methodology). Basic Dragging Methodology The Wimp and the application must work together to implement dragging. A brief summary of how the Wimp and the application work together are shown below. |<^. 1 |<^. User starts a drag using the mouse button (Select or Adjust mouse buttons only) | |<^. 2 |<^. Wimp issues the [[Mouse_Click|Mouse_Click]] event code | |<^. 3 |<^. Application responds to mouse click event code and initiates [[Wimp_DragBox|Wimp_DragBox]] to start the drag process | |<^. 4 |<^. User ends the drag | |<^. 5 |<^. Wimp issues a [[User_Drag_Box]] to signal the end of a drag | |<^. 6 |<^. Application handles the drag, ensuring the all related windows are updated correctly | h2(#mouse_clicks). Mouse Clicks Window work-areas and icons can easily be configured to respond to dragging. This is achieved by the [[Window Button Types|Window Button Types]] within the window definition. The Button Flag tells the Wimp which (if any) button clicks and drags it should respond to. Although a window or icon can be set to respond to drags, it does not exclude other mouse clicks. The result of this, is that the Wimp will still issue a [[Mouse_Click|Mouse_Click]] event code specifying a single mouse click. Likewise, upon the end of drag the Wimp may issue a Mouse_Click event code specifying a Double Click. The Button flag specifies this. h2(#miscellaneous_information). Miscellaneous Information Applications must ensure that windows are updated correctly during a drag. An object could be re-sized or moved within a window, or it could also be moved between windows themselves. Updating of a window should use [[Wimp_UpdateWindow|Wimp_UpdateWindow]]. Applications that require a drag to be confined to a window must handle the situation when the mouse pointer nears the edge of the window. Then it scrolls the window in the chosen direction or remain unmoved. If a scroll has been initiated and the mouse button has been released afterwards, it leaves the possibility for further mouse clicks during a drag, for opening a menu etc.. . Applications should be written to take into account this possibility. To keep track of the drag, the application should stop following the drag on a [[Pointer_Leaving_Window|Pointer_Leaving_Window]] event code, and start again on a [[Pointer_Entering_Window|Pointer_Entering_Window]]. h4. See also * [[Mouse_Click|Mouse_Click]] * [[Wimp_DragBox|Wimp_DragBox]] * [[User_Drag_Box]] * [[Window Button Types|Window Button Types]] * [[Wimp_Poll|Wimp_Poll]] * [[Pointer_Entering_Window|Pointer_Entering_Window]] * [[Pointer_Leaving_Window|Pointer_Leaving_Window]] * [[Wimp_UpdateWindow|Wimp_UpdateWindow]] [linkStyle]Style+Guide