GDDM V3R2 Base Application Programming Guide
|
Previous topic |
Next topic |
Contents |
Index |
Contact z/OS |
Library |
PDF |
BOOK
Dragging segments GDDM V3R2 Base Application Programming Guide SC33-0867-01 |
|
If a segment is to be repositioned, you can often help the end user by enabling a copy of it to be dragged around the screen before its final position is determined. You do this by making the segment the locator echo. The program in Figure 65 shows you how. The locator is initialized at A with a type 6 echo, that is, a segment. The segment is a square. The last parameter of the GSIDVI call, at B , specifies that the segment containing the square, namely segment 9, is the one to be used as the echo. The GSIDVF calls at C and D offset the echo from the locator position by 0.2 window units in the x and y directions. The reason is explained in "How the 3270-PC/G and GX draw echoes" in topic 11.12.1. The GSREAD, E , displays the square onto the screen. The end user can then drag a copy of it around with the mouse, puck, stylus, or cursor keys. The GSREAD waits for an interrupt from the terminal. Any locator-trigger key can be used to send this interrupt; a mouse or puck button or the stylus tip-switch is probably the most convenient. When the interrupt is received, execution of the program resumes. The position of the locator is queried and a GSSPOS issued to move the segment to that position. This example shows a very simple case. In less straightforward cases, you may get unexpected results if you do not pay particular attention to the segment origin. More information is given in "Local origin when dragging a segment" in topic 11.12.2.
If you want to return to the default cursor as the locator echo after dragging a segment, you must disable and then reinitialize the locator before reenabling it:
CALL GSENAB(2,1,0); /* Disable the locator */
CALL GSILOC(1,2,X,Y); /* Reinitialize with cursor as echo */
CALL GSENAB(2,1,1); /* Reenable */
Subtopics: |
Copyright IBM Corporation 1990, 2012 |