Jump to content

GpiMove: Difference between revisions

From EDM2
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
==Description==
This function moves the current position to the specified point.
This function moves the current position to the specified point.  
 
==Syntax==
==Syntax==
<PRE>
  GpiMove(hps, pptlPoint)
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>
 
HPS        hps;        /*  Presentation-space handle. */
PPOINTL    pptlPoint;  /*  Position to which to move. */
BOOL      rc;        /* Success indicator. */
 
rc = GpiMove(hps, pptlPoint);
 
 
</PRE>


==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.  
;hps ([[HPS]]) - input: Presentation-space handle.
 
;pptlPoint (P[[POINTL]]) - input: Position to which to move.
; pptlPoint (PPOINTL) - input : Position to which to move.
:This position is in world coordinates.
 
This position is in world coordinates.


==Return Code==
==Return Code==
; rc (BOOL) - returns : Success indicator.
;rc ([[BOOL]]) - returns : Success indicator.
::TRUE - Successful completion
::FALSE - Error occurred.


TRUE
===Errors===
        Successful completion
Possible returns from WinGetLastError:
;PMERR_INV_HPS (0x207F) :An invalid presentation-space handle was specified.
;PMERR_PS_BUSY (0x20F4) :An attempt was made to access the presentation space from more than one thread simultaneously.
;PMERR_INV_COORDINATE (0x205B) :An invalid coordinate value was specified.


FALSE
==Remarks==
        Error occurred.
This function also has the effect of resetting position within a line-type sequence, and, if within an area, of starting a new closed figure and causing any previous one to be closed automatically if necessary.


===Errors===
This function is equivalent to the [[GpiSetCurrentPosition]] call, except that, if the current attribute mode is AM_PRESERVE (see ''GpiSetAttrMode''), the current position is not saved before being set to a new value by the GpiMove function, and hence cannot be restored using the [[GpiPop]] call.
Possible returns from WinGetLastError


PMERR_INV_HPS (0x207F)
==Graphic Elements and Orders==
        An invalid presentation-space handle was specified.  
:Element Type: OCODE_GSCP
::Note that GpiSetCurrentPosition also generates this element type.
:Order: Set Current Position


PMERR_PS_BUSY (0x20F4)
==Example Code==
        An attempt was made to access the presentation space from more than one thread simultaneously.  
<PRE>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>


PMERR_INV_COORDINATE (0x205B)
HPS        hps;        /*  Presentation-space handle. */
        An invalid coordinate value was specified.
PPOINTL    pptlPoint;  /*  Position to which to move. */
==Remarks==
BOOL      rc;        /*  Success indicator. */
This function also has the effect of resetting position within a line-type sequence, and, if within an area, of starting a new closed figure and causing any previous one to be closed automatically if necessary.


This function is equivalent to the GpiSetCurrentPosition call, except that, if the current attribute mode is AM_PRESERVE (see GpiSetAttrMode), the current position is not saved before being set to a new value by the GpiMove function, and hence cannot be restored using the GpiPop call.
rc = GpiMove(hps, pptlPoint);
</PRE>


==Example Code==
This example uses the GpiMove function to draw an X. The function moves the current position to the starting point of each leg of the character.
This example uses the GpiMove function to draw an X. The function moves the current position to the starting point of each leg of the character.
<PRE>
<PRE>
#define INCL_GPIPRIMITIVES      /* GPI primitive functions      */
#define INCL_GPIPRIMITIVES      /* GPI primitive functions      */
Line 62: Line 55:
GpiMove(hps, &ptl[2]);    /* move to (0,100) */
GpiMove(hps, &ptl[2]);    /* move to (0,100) */
GpiLine(hps, &ptl[3]);
GpiLine(hps, &ptl[3]);
</PRE>
</PRE>
==Graphic Elements and Orders==
Element Type: OCODE_GSCP
    Note that GpiSetCurrentPosition also generates this element type.
    Order: Set Current Position


==Related Functions==
==Related Functions==

Latest revision as of 23:49, 7 April 2025

This function moves the current position to the specified point.

Syntax

GpiMove(hps, pptlPoint)

Parameters

hps (HPS) - input
Presentation-space handle.
pptlPoint (PPOINTL) - input
Position to which to move.
This position is in world coordinates.

Return Code

rc (BOOL) - returns
Success indicator.
TRUE - Successful completion
FALSE - Error occurred.

Errors

Possible returns from WinGetLastError:

PMERR_INV_HPS (0x207F)
An invalid presentation-space handle was specified.
PMERR_PS_BUSY (0x20F4)
An attempt was made to access the presentation space from more than one thread simultaneously.
PMERR_INV_COORDINATE (0x205B)
An invalid coordinate value was specified.

Remarks

This function also has the effect of resetting position within a line-type sequence, and, if within an area, of starting a new closed figure and causing any previous one to be closed automatically if necessary.

This function is equivalent to the GpiSetCurrentPosition call, except that, if the current attribute mode is AM_PRESERVE (see GpiSetAttrMode), the current position is not saved before being set to a new value by the GpiMove function, and hence cannot be restored using the GpiPop call.

Graphic Elements and Orders

Element Type: OCODE_GSCP
Note that GpiSetCurrentPosition also generates this element type.
Order: Set Current Position

Example Code

#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>

HPS        hps;        /*  Presentation-space handle. */
PPOINTL    pptlPoint;  /*  Position to which to move. */
BOOL       rc;         /*  Success indicator. */

rc = GpiMove(hps, pptlPoint);

This example uses the GpiMove function to draw an X. The function moves the current position to the starting point of each leg of the character.

#define INCL_GPIPRIMITIVES      /* GPI primitive functions      */
#include <os2.h>

HPS hps;                /* presentation space handle            */
/* point array */
POINTL ptl[4] = { 0, 0, 100, 100, 0, 100, 100, 0 };

GpiMove(hps, &ptl[0]);    /* move to (0,0)   */
GpiLine(hps, &ptl[1]);
GpiMove(hps, &ptl[2]);    /* move to (0,100) */
GpiLine(hps, &ptl[3]);

Related Functions