WR Mouse to selection

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

version 6.5 (Modified)


WR Mouse to selection (area; posHoriz; posVert; beginSel; endSel) Integer

ParameterTypeDescription
areaLongint4D Write area
posHorizIntegerHorizontal position of mouse in area
posVertIntegerVertical position of mouse in area
beginSelLongintReturns beginning of selection
endSelLongintReturns end of selection
Function resultIntegerSelection matching the position of the cursor

Description

The WR Mouse to selection command returns the selection matching the position of the cursor. The command returns 0 if the cursor points to text and returns 1 if it points to a picture.

WR Mouse to selection is used in conjunction with the Drag and Drop manager to find the location of the cursor when the mouse was released and an object was pasted.

beginSel and endSel return different values when you release the mouse button on a reference. Warning: In 4D Write version 6.0 or earlier, the endSel - beginSel expression returns the number of characters contained in the reference after computing. Effective version 6.5, endSel = beginSel +1. In other words, a reference = 1 character regardless of the number of characters contained in the reference, after computing.

The posHoriz and posVert parameters return 0000 by default. In order for them to return a value, you must use the 4th Dimension GET MOUSE command or the AP PICT DRAGGER 4D_Pack routine beforehand. For more information, please refer to these products' documentation.

Example

Consider a 4D Write area that contains a button with a background picture. The button's object method allows you to simulate the drag and drop of the background picture to a location "B" (knowing that the cursor is placed at a location "A").

   AP PICT DRAGGER ([Letters]Picture;PosH;PosV)
   NPictureNot:=WR Mouse to selection(Field6;PosH;PosV;StartSel;EndSel)
   WR SET SELECTION(Field6;StartSel;FiEndSelnSel)
   im:=[Letters]Picture*0,5
   WR INSERT PICTURE(Field6;Im)

See Also

AP PICT DRAGGER, GET MOUSE.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next