Jump to content

GpiSetStopDraw: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
This function sets or clears the "stop draw" condition.  
This function sets or clears the "stop draw" condition.


==Syntax==
==Syntax==
  GpiSetStopDraw(hps, lValue);
  GpiSetStopDraw(hps, lValue)


==Parameters==
==Parameters==
;hps (HPS) - input
;hps (HPS) - input:Presentation-space handle.
:Presentation-space handle.  
;lValue (LONG) - input:Stop draw condition.
 
::SDW_OFF - Clear the "stop draw" condition
;lValue (LONG) - input
::SDW_ON - Set the "stop draw" condition
:Stop draw condition.
 
:;SDW_OFF
::Clear the "stop draw" condition  
:;SDW_ON
::Set the "stop draw" condition.


==Returns==
==Returns==
;rc (BOOL) - returns
;rc (BOOL) - returns:Success indicator.
:Success indicator.
::TRUE - Successful completion  
 
::FALSE - Error occurred
:;TRUE
::Successful completion  
:;FALSE
::Error occurred.


==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError


;PMERR_INV_HPS (0x207F)
;PMERR_INV_HPS (0x207F):An invalid presentation-space handle was specified.
:An invalid presentation-space handle was specified.  
;PMERR_INV_STOP_DRAW_VALUE (0x20CF):An invalid value parameter was specified with GpiSetStopDraw.
;PMERR_INV_STOP_DRAW_VALUE (0x20CF)
;PMERR_INV_MICROPS_FUNCTION (0x20A1):An attempt was made to issue a function that is invalid in a micro presentation space.
:An invalid value parameter was specified with GpiSetStopDraw.  
;PMERR_INV_MICROPS_FUNCTION (0x20A1)
:An attempt was made to issue a function that is invalid in a micro presentation space.


==Remarks==
==Remarks==
Line 41: Line 28:


If one of the following calls is made (or has already been initiated from another thread) to the same presentation space, the call is terminated if the "stop draw" condition exists:
If one of the following calls is made (or has already been initiated from another thread) to the same presentation space, the call is terminated if the "stop draw" condition exists:
* GpiDrawChain
* GpiDrawChain
* GpiDrawDynamics
* GpiDrawDynamics
Line 47: Line 33:
* GpiDrawSegment
* GpiDrawSegment
* GpiPlayMetaFile
* GpiPlayMetaFile
* GpiPutData.
* GpiPutData
 
The call terminates with a warning.
The call terminates with a warning.


Line 56: Line 41:


==Example Code==
==Example Code==
<pre>
#define INCL_GPICONTROL /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
HPS    hps;    /*  Presentation-space handle. */
LONG    lValue;  /*  Stop draw condition. */
BOOL    rc;      /*  Success indicator. */
rc = GpiSetStopDraw(hps, lValue);
</pre>
This example shows how to stop drawing.
This example shows how to stop drawing.
<pre>  
<pre>  
#define INCL_GPICONTROL
#define INCL_GPICONTROL
#include <OS2.H>
#include <OS2.H>
HPS hps;        /*   Presentation-space */
HPS hps;        /* Presentation-space handle. */
                /*  handle.           */


GpiSetStopDraw(hps,SDW_OFF);
GpiSetStopDraw(hps,SDW_OFF);
</pre>
</pre>



Revision as of 10:57, 4 April 2025

This function sets or clears the "stop draw" condition.

Syntax

GpiSetStopDraw(hps, lValue)

Parameters

hps (HPS) - input
Presentation-space handle.
lValue (LONG) - input
Stop draw condition.
SDW_OFF - Clear the "stop draw" condition
SDW_ON - Set the "stop draw" condition

Returns

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_INV_STOP_DRAW_VALUE (0x20CF)
An invalid value parameter was specified with GpiSetStopDraw.
PMERR_INV_MICROPS_FUNCTION (0x20A1)
An attempt was made to issue a function that is invalid in a micro presentation space.

Remarks

This function allows an application to set up, and control, an asynchronous thread on which long drawing operations may be performed. At the point at which the controlling thread stops a draw, it sets the "stop draw" condition. The controlling thread clears this condition after it has received an acknowledgment from the drawing thread.

The "stop draw" condition has no effect on any other calls.

If one of the following calls is made (or has already been initiated from another thread) to the same presentation space, the call is terminated if the "stop draw" condition exists:

  • GpiDrawChain
  • GpiDrawDynamics
  • GpiDrawFrom
  • GpiDrawSegment
  • GpiPlayMetaFile
  • GpiPutData

The call terminates with a warning.

Any call other than GpiSetStopDraw, directed at a presentation space that is currently in use, gives a PMERR_PS_BUSY error condition.

Note: If this function is issued when an asynchronous draw to a metafile is taking place, the result is an unusable metafile.

Example Code

This example shows how to stop drawing.

 
#define INCL_GPICONTROL
#include <OS2.H>
HPS hps;         /* Presentation-space handle. */

GpiSetStopDraw(hps,SDW_OFF);

Related Functions

  • GpiDrawChain
  • GpiDrawDynamics
  • GpiDrawFrom
  • GpiDrawSegment
  • GpiPlayMetaFile
  • GpiPutData
  • GpiQueryStopDraw