RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

The Window Manager Dragging

Programmer's Reference Manuals
» Part 7 - The Desktop
» The Window Manager
» Technical Details
» Dragging

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.

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 event code
3 Application responds to mouse click event code and initiates 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

Mouse Clicks

Window work-areas and icons can easily be configured to respond to dragging. This is achieved by the 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 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.

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.

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 event code, and start again on a Pointer_Entering_Window.

See also

  • Mouse_Click
  • Wimp_DragBox
  • User_Drag_Box?
  • Window Button Types
  • Wimp_Poll
  • Pointer_Entering_Window
  • Pointer_Leaving_Window
  • Wimp_UpdateWindow
Revised on January 29, 2010 16:39:19 by GavinWraith (26)? (127.0.0.1)
Edit | Back in time (4 revisions) | See changes | History | Views: Print | Source | Linked from: The Window Manager Technical Details

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys