LDialogEffect::DoModalGetShape

#include "ltwrappr.h"

virtual L_INT LDialogEffect::DoModalGetShape ( hWndOwner)

HWND hWndOwner;

/* handle of the window which owns the dialog */

Displays the Get Shape dialog box, and gets the options for LPaintEffect::Draw3dShape.

Parameter

Description

hWndOwner

Handle of the window which owns the dialog.

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

LDialogEffect::SetShapeParams must be called before using this function to set the initial values for the dialog. You can get the updated SHAPEDLGPARAMS with the values entered by the user through the dialog by using LDialogEffect::GetShapeParams.

The Get Shape dialog is shown in the following figure:

image\GetShape.gif

Required DLLs and Libraries

LTDLGEFX
LTDLGFILE
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTDIS
LTIMG

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:

LDialogEffect::GetShapeParams, LDialogEffect::SetShapeParams, LDialogBase::Initialize, LPaintEffect::Draw3dShape, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free

Topics:

Using Imaging Common Dialog

Example

void TestFunction(LBitmap * pBitmap, HWND hWnd) 
{
   LDialogEffect DlgEffect; 
   LDialogEffect::Initialize (0); 
   DlgEffect.SetBitmap(pBitmap); 
   
   LBitmap BackImage; 
   SHAPEDLGPARAMS DlgParams; 

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

   DlgParams.uStructSize      = sizeof ( SHAPEDLGPARAMS ) ; 
   BackImage.Initialize();
   
   DlgParams.pBackgroundBitmap = BackImage.GetHandle();
   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 ; 

   DlgEffect.EnableCallBack(FALSE); 
   DlgEffect.SetShapeParams(&DlgParams) ; 
   DlgEffect.DoModalGetShape(hWnd); 

   // Gets the updated values for the structure
   DlgEffect.GetShapeParams(&DlgParams, sizeof(DlgParams)) ; 
   LDialogEffect::Free ();

   if ( BackImage. IsAllocated() ) 
   {
      BackImage.Free();
   }
}