LDialogEffect::DoModalGetGradient

#include "ltwrappr.h"

virtual L_INT LDialogEffect::DoModalGetGradient ( hWndOwner)

HWND hWndOwner;

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

Displays the Get Gradient dialog box, and gets the options for LPaintEffect::DrawGradient.

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::SetGradientParams must be called before using this function to set the initial values for the dialog. You can get the updated GRADIENTDLGPARAMS with the values entered by the user through the dialog by using LDialogEffect::GetGradientParams.

The Get Gradient dialog.

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::GetGradientParams, LDialogEffect::SetGradientParams, LDialogBase::Initialize, LPaintEffect::DrawGradient, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free

Topics:

Using Imaging Common Dialog

Example

L_INT LDialogEffect_DoModalGetGradientExample(LBitmap * pBitmap, HWND hWnd) 
{
   L_INT nRet;
   LDialogEffect DlgEffect; 
   nRet = LDialogEffect::Initialize (0); 
   if(nRet != SUCCESS)
      return nRet;
   DlgEffect.SetBitmap (pBitmap); 
   GRADIENTDLGPARAMS DlgParams; 
   memset ( &DlgParams, 0, sizeof ( GRADIENTDLGPARAMS ) ) ; 
   DlgParams.uStructSize      = sizeof ( GRADIENTDLGPARAMS ) ; 
   DlgParams.crStart   = RGB ( 0,0,255 ) ; 
   DlgParams.crEnd     = RGB ( 255,0,0 ) ; 
   DlgParams.uStyle    = EFX_GRADIENT_ANGLE_TO_RT ; 
   DlgParams.uSteps    = 200 ; 
   DlgParams.uDlgFlags = DLG_GRADIENT_SHOW_PREVIEW          |
                         DLG_GRADIENT_AUTOPREVIEW           |
                         DLG_GRADIENT_STARTCOLOR            |
                         DLG_GRADIENT_ENDCOLOR              |
                         DLG_GRADIENT_STEPS                 |
                         DLG_GRADIENT_NO_TREEVIEW           |
                         DLG_GRADIENT_CLASS_LINEAR          |
                         DLG_GRADIENT_CLASS_ANGULAR         |
                         DLG_GRADIENT_CLASS_RECTANGULAR     |
                         DLG_GRADIENT_CLASS_ELLIPTICAL      |
                         DLG_GRADIENT_CLASS_CONICAL ; 
   DlgEffect.EnableCallBack (FALSE); 
   nRet = DlgEffect.SetGradientParams (&DlgParams) ; 
   if(nRet != SUCCESS)
      return nRet;
   nRet = DlgEffect.DoModalGetGradient(hWnd); 
   if(nRet < 1)
      return nRet;
   // Gets the updated values for the structure
   nRet = DlgEffect.GetGradientParams (&DlgParams, sizeof(DlgParams)) ; 
   if(nRet != SUCCESS)
      return nRet;
   nRet = LDialogEffect::Free ();
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}