L_DlgGetShape

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgGetShape(hWndOwner, pDlgParams)

L_HWND hWndOwner;

/* owner of dialog */

LPSHAPEDLGPARAMS pDlgParams;

/* pointer to a SHAPEDLGPARAMS structure */

Displays the Get Shape dialog box, and gets the options for L_EfxDraw3dShape.

Parameter

Description

hWndOwner

Handle of the window which owns the dialog.

pDlgParams

Pointer to a SHAPEDLGPARAMS structure to be updated with the values entered by the user, through the dialog. Set members of this structure, before calling this function, to set the dialogs initial values.

Returns

SUCCESS_DLG_OK

The "OK" button was pressed, and the dialog exited successfully.

SUCCESS_DLG_CANCEL

The "Cancel" button was pressed, and the dialog exited successfully.

< 1

An error occurred. Refer to Return Codes.

Comments

The Get Shape dialog.

Required DLLs and Libraries

LTDLGEFX
LTDLGFILE
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMG
LTKRN

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_DlgInit, L_EfxDraw3dShape

Topics:

Dialogs: Special Effects

 

Using Imaging Common Dialog

Example

 L_INT ShowDlgGetShapeExample(HWND hWnd, pBITMAPHANDLE  pBitmap)
{
   SHAPEDLGPARAMS DlgParams ;
   BITMAPHANDLE   BackBitmap ;
   L_INT          nRet ;
   HDC            hDC ;
   HDC            hBackDC ;
   RECT           rcDst ;
   RECT           rcBack ;

   memset ( &DlgParams, 0,sizeof ( SHAPEDLGPARAMS ) ) ;

   nRet = L_InitBitmap(&BackBitmap, sizeof(BITMAPHANDLE), 0, 0, 0 ) ;
   if(nRet != SUCCESS)
      return nRet;

   DlgParams.uStructSize       = sizeof ( SHAPEDLGPARAMS ) ;
   DlgParams.pBitmap           = pBitmap ;
   DlgParams.pBackgroundBitmap = &BackBitmap; 
   DlgParams.uShape            = EFX_SHAPE_PARALLELOGRAM_R ;
   DlgParams.crBack            = RGB ( 0, 0, 255 ) ;
   DlgParams.uBackStyle        = 2 ;
   DlgParams.crFill            = RGB ( 255, 0, 0 ) ;
   DlgParams.uFillStyle        = 1 ;
   DlgParams.crBorder          = RGB ( 100, 255, 100 ) ;
   DlgParams.uBorderStyle      = 1 ;
   DlgParams.uBorderWidth      = 5 ;
   DlgParams.crInnerHilite     = RGB ( 255, 255, 255 ) ;
   DlgParams.crInnerShadow     = RGB ( 0, 0, 0 ) ;
   DlgParams.uInnerStyle       = 1 ;
   DlgParams.uInnerWidth       = 3 ;
   DlgParams.crOuterHilite     = RGB ( 255, 255, 0 ) ;
   DlgParams.crOuterShadow     = RGB ( 255, 0, 255 ) ;
   DlgParams.uOuterStyle       = 1 ;
   DlgParams.uOuterWidth       = 5 ;
   DlgParams.nShadowX          = 10 ;
   DlgParams.nShadowY          = 10 ;
   DlgParams.crShadow          = RGB ( 128, 128, 128 ) ;
   DlgParams.uDlgFlags         = DLG_SHAPE_SHOW_PREVIEW         |
                                 DLG_SHAPE_AUTOPREVIEW          |
                                 DLG_SHAPE_BACKSTYLE            |
                                 DLG_SHAPE_FILLSTYLE            |
                                 DLG_SHAPE_FORE_BACK_COLOR      |
                                 DLG_SHAPE_BORDERSTYLE          |
                                 DLG_SHAPE_BORDERWIDTH          |
                                 DLG_SHAPE_BORDERCOLOR          |
                                 DLG_SHAPE_INNERSTYLE           |
                                 DLG_SHAPE_INNERWIDTH           |
                                 DLG_SHAPE_INNER_HILITE_SHADOW  |
                                 DLG_SHAPE_OUTERSTYLE           |
                                 DLG_SHAPE_OUTERWIDTH           |
                                 DLG_SHAPE_OUTER_HILITE_SHADOW  |
                                 DLG_SHAPE_SHADOWCOLOR          |
                                 DLG_SHAPE_SHADOW_X_Y           |
                                 DLG_SHAPE_BROWSEIMAGE          |
                                 DLG_SHAPE_CLASS_SQUARE         |
                                 DLG_SHAPE_CLASS_RECTANGLE      |
                                 DLG_SHAPE_CLASS_PARALLELOGRAM  |
                                 DLG_SHAPE_CLASS_TRAPEZOID      |
                                 DLG_SHAPE_CLASS_TRIANGLE       |
                                 DLG_SHAPE_CLASS_OTHER          |
                                 DLG_SHAPE_CLASS_CIRCLE         |
                                 DLG_SHAPE_CLASS_ELLIPSE        |
                                 DLG_SHAPE_CLASS_STAR           |
                                 DLG_SHAPE_CLASS_CROSS          |
                                 DLG_SHAPE_CLASS_ARROW ;

   L_DlgInit ( DLG_INIT_COLOR ) ;

   nRet = L_DlgGetShape ( hWnd, &DlgParams ) ;

   if ( nRet == SUCCESS_DLG_OK )
   {
      hBackDC = L_CreateLeadDC( DlgParams.pBackgroundBitmap ) ;

      SetRect ( &rcBack, 0, 0, DlgParams.pBackgroundBitmap->Width, DlgParams.pBackgroundBitmap->Height ) ;

      hDC = GetDC ( hWnd ) ;

      GetClientRect ( hWnd, &rcDst);

      //now paint the shape
      nRet = L_EfxDraw3dShape(hDC,
                       DlgParams.uShape,
                       &rcDst,
                       DlgParams.crBack,
                       hBackDC,
                       &rcBack,
                       DlgParams.uBackStyle,
                       DlgParams.crFill,
                       DlgParams.uFillStyle,
                       DlgParams.crBorder,
                       DlgParams.uBorderStyle,
                       DlgParams.uBorderWidth,
                       DlgParams.crInnerHilite,
                       DlgParams.crInnerShadow,
                       DlgParams.uInnerStyle,
                       DlgParams.uInnerWidth,
                       DlgParams.crOuterHilite,
                       DlgParams.crOuterShadow,
                       DlgParams.uOuterStyle,
                       DlgParams.uOuterWidth,
                       DlgParams.nShadowX,
                       DlgParams.nShadowY,
                       DlgParams.crShadow,
                       NULL ) ;
      if(nRet != SUCCESS)
         return nRet;

      ReleaseDC ( hWnd, hDC ) ;

      if ( NULL != hBackDC )
         L_DeleteLeadDC( hBackDC ) ;
   }
   else
      return nRet;

   nRet = L_DlgFree();
   if (nRet != SUCCESS)
      return nRet;

   if ( BackBitmap.Flags.Allocated )
      L_FreeBitmap( &BackBitmap ) ;

   return SUCCESS;
}