L_PntDlgShape

#include "ltpdg.h"

L_LTPDG_API L_INT L_PntDlgShape( hWnd, pShapeDlgInfo )

L_HWND hWnd;

/*owner of the dialog */

pPAINTDLGSHAPEINFO pShapeDlgInfo;

/* pointer to a structure */

Brings up the shape properties dialog box.

Parameter

Description

hWnd

Handle of the window that owns the dialog.

pShapeDlgInfo

Pointer to a PAINTDLGSHAPEINFO structure that contains shape information. The values present in pShapeDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_SHAPE_INITUSEDEFAULT is not set in the dwFlags member of pShapeDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTPDG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_PntGetProperty, L_PntSetProperty, L_PntDrawShapeEllipse, L_PntDrawShapeLine, L_PntDrawShapePolyBezier, L_PntDrawShapePolygon, L_PntDrawShapeRectangle, L_PntDrawShapeRoundRect

Topics:

DigitalPaint Functions: DigitalPaint Common Dialogs

 

Using the DigitalPaint Common Dialogs

Example

This example will display the Shape common dialog.

 L_INT PntDlgShapeExample(HWND   hWnd, L_BOOL fUseDef)
{
   L_INT nRet;
   L_TCHAR * g_ppszPaperTexture [] = {TEXT("Paper 0"),
                                      TEXT("Paper 1"),
                                      TEXT("Paper 2"),
                                      TEXT("Paper 3"),
                                      TEXT("Paper 4"),
                                      TEXT("Paper 5")} ;
   PAINTDLGSHAPEINFO dlgShapeInfo;
   memset(&dlgShapeInfo, 0, sizeof(dlgShapeInfo));

   if ( fUseDef == TRUE )
   {
      dlgShapeInfo.dwFlags = PAINT_DLG_SHAPE_INITUSEDEFAULT |
                               PAINT_DLG_SHAPE_SHOWALL        ;
   }
   else
   {
      dlgShapeInfo.nSize                   = sizeof ( PAINTDLGSHAPEINFO ) ;
      dlgShapeInfo.dwFlags                 = PAINT_DLG_SHAPE_SHOWBKGRNDSTYLE       |
                                               PAINT_DLG_SHAPE_SHOWBKOPAQUECOLOR     |
                                               PAINT_DLG_SHAPE_SHOWBORDERSTYLE       |
                                               PAINT_DLG_SHAPE_SHOWBORDERWIDTH       |
                                               PAINT_DLG_SHAPE_SHOWBORDERBRUSHSTYLE  |
                                               PAINT_DLG_SHAPE_SHOWBORDERCOLOR       |
                                               PAINT_DLG_SHAPE_SHOWGRADIENTSTYLE     |
                                               PAINT_DLG_SHAPE_SHOWGRADIENTDIRECTION |
                                               PAINT_DLG_SHAPE_SHOWGRADIENTSTARTCOLOR|
                                               PAINT_DLG_SHAPE_SHOWGRADIENTENDCOLOR  |
                                               PAINT_DLG_SHAPE_SHOWGRADIENTPREVIEW   |
                                               PAINT_DLG_SHAPE_SHOWGRADIENTSTEPS     |
                                               PAINT_DLG_SHAPE_SHOWENDCAP            |
                                               PAINT_DLG_SHAPE_SHOWELLIPSEWIDTH      |
                                               PAINT_DLG_SHAPE_SHOWELLIPSEHEIGHT     |
                                               PAINT_DLG_SHAPE_SHOWOPACITY           |
                                               PAINT_DLG_SHAPE_SHOWTEXTURE           |
                                               PAINT_DLG_SHAPE_SHOWDEFAULT           ;

      dlgShapeInfo.pszTitle                = TEXT("Lead Shape Common Dialog ") ;
      dlgShapeInfo.nBackgroundStyle        = PAINT_SHAPE_BACK_STYLE_GRADIENT ;
      dlgShapeInfo.crBackgroundColor       = RGB ( 255, 0, 0 ) ;     
      dlgShapeInfo.nBorderStyle            =  PAINT_SHAPE_BORDER_STYLE_DOT;
      dlgShapeInfo.nBorderWidth            = 10;
      dlgShapeInfo.nBorderBrushStyle       = PAINT_SHAPE_BORDER_BRUSH_STYLE_COLOR ; 
      dlgShapeInfo.crBorderColor           = RGB ( 0, 255, 0 ) ;   
      dlgShapeInfo.nGradientStyle          = PAINT_SHAPE_GRADIENT_STYLE_RECTANGLE_FROM_C;
      dlgShapeInfo.crGradientStartColor    = RGB ( 255, 0, 0 ) ;
      dlgShapeInfo.crGradientEndColor      = RGB ( 0, 0, 255 ) ;
      dlgShapeInfo.uGradientSteps          = 200 ;
      dlgShapeInfo.nBorderEndCap           = PAINT_SHAPE_BORDER_ENDCAP_FLAT ;
      dlgShapeInfo.nRoundRectEllipseWidth  = 10 ;
      dlgShapeInfo.nRoundRectEllipseHeight = 10 ;
      dlgShapeInfo.nOpacity                = 10;
      dlgShapeInfo.ppszPaperTexture        = g_ppszPaperTexture ;
      dlgShapeInfo.uPaperTextureCount      = 6;
      dlgShapeInfo.nActivePaperTextureItem = 3;
   }

   nRet = L_PntDlgShape ( hWnd, &dlgShapeInfo ) ;
   if(nRet != SUCCESS)
      return nRet;

   return SUCCESS;
}