Jump to content

GpiSetLineEnd: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; ''hps'' ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
; ''lLineEnd'' ([[LONG]]) - input: Style of line end.
 
; lLineEnd ([[LONG]]) - input
: Style of line end.


[[Image:GpiSetLineEnd_lLineEnd.png]]
[[Image:GpiSetLineEnd_lLineEnd.png]]


: The possible values for this parameter are:
: The possible values for this parameter are:
:; LINEEND_DEFAULT
::LINEEND_DEFAULT : Use default, same as LINEEND_FLAT (unless changed with [[GpiSetDefAttrs]])
:: Use default, same as LINEEND_FLAT (unless changed with [[GpiSetDefAttrs]])
::LINEEND_FLAT : Flat
:; LINEEND_FLAT
::LINEEND_SQUARE : Square
:: Flat
::LINEEND_ROUND : Round.
:; LINEEND_SQUARE
:: Square
:; LINEEND_ROUND
:: Round.


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


==Remarks==
==Remarks==
Line 37: Line 27:
==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_PS_BUSY (0x20F4): An attempt was made to access the presentation space from more than one thread simultaneously.
; PMERR_PS_BUSY (0x20F4)
; PMERR_INV_LINE_END_ATTR (0x2093): An invalid line end attribute value was specified.
: An attempt was made to access the presentation space from more than one thread simultaneously.
; PMERR_INV_LINE_END_ATTR (0x2093)
: An invalid line end attribute value was specified.


==Graphic Elements and Orders==
==Graphic Elements and Orders==
Line 54: Line 41:


==Example Code==
==Example Code==
<PRE>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS    hps;      /* Presentation-space handle. */
LONG    lLineEnd; /* Style of line end. */
BOOL    rc;      /* Success indicator. */
rc = GpiSetLineEnd(hps, lLineEnd);
</PRE>
This function sets the line end to be square (as opposed to round for example).
This function sets the line end to be square (as opposed to round for example).
<pre>
<pre>
#define INCL_GPIPRIMITIVES
#define INCL_GPIPRIMITIVES
#include &lt;OS2.H&gt;
#include <OS2.H>


HPS hps; /* Presentation-space handle. */
HPS hps; /* Presentation-space handle. */

Latest revision as of 00:47, 24 November 2025

This function sets the current line-end attribute.

Syntax

GpiSetLineEnd(hps, lLineEnd)

Parameters

hps (HPS) - input
Presentation-space handle.
lLineEnd (LONG) - input
Style of line end.

The possible values for this parameter are:
LINEEND_DEFAULT : Use default, same as LINEEND_FLAT (unless changed with GpiSetDefAttrs)
LINEEND_FLAT : Flat
LINEEND_SQUARE : Square
LINEEND_ROUND : Round.

Return Value

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

Remarks

The line-end attribute defines the shape of the ends of lines or arcs at the beginning and end of an open figure. This attribute is used only in the GpiModifyPath function (with a lMode parameter of MPATH_STROKE) or in the GpiStrokePath function. The attribute mode (see GpiSetAttrMode) determines whether the current value of the line-end attribute is preserved.

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_LINE_END_ATTR (0x2093)
An invalid line end attribute value was specified.

Graphic Elements and Orders

Element Type: OCODE_GSLE

This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.
Order: Set Line End

Element Type: OCODE_GPSLE

This element type is generated if the attribute mode is set to AM_PRESERVE.
Order: Push and Set Line End

Example Code

This function sets the line end to be square (as opposed to round for example).

#define INCL_GPIPRIMITIVES
#include <OS2.H>

HPS hps; /* Presentation-space handle. */

GpiSetLineEnd(hps, LINEEND_SQUARE);

Related Functions