LDialogEffect::DoModalGetText

#include "ltwrappr.h"

virtual L_INT LDialogEffect::DoModalGetText(hWndOwner)

HWND hWndOwner;

handle of the window which owns the dialog

Displays the Get Text dialog box, and gets the options for LPaintEffect::Draw3dText.

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

The Get Text 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::GetTextParams, LDialogEffect::SetTextParams, LDialogBase::Initialize, LPaintEffect::Draw3dText, LBase::EnableCallBack, LDialogBase::EnablePreview, LDialogBase::EnableAutoProcess, LDialogBase::EnableToolbar, LDialogBase::Free

Topics:

Using Imaging Common Dialog

Example

L_INT LDialogEffect_DoModalGetTextExample(LBitmap * pBitmap, HWND hWnd) 
{ 
   L_INT nRet; 
   LDialogEffect DlgEffect; 
   nRet = LDialogEffect::Initialize (0); 
   if(nRet != SUCCESS) 
      return nRet; 
   DlgEffect.SetBitmap (pBitmap); 
   TEXTDLGPARAMS DlgParams; 
   LBitmap ForeImage; 
   L_TCHAR szSampleText [ L_MAXPATH ] ; 
   memset ( &DlgParams, 0, sizeof ( TEXTDLGPARAMS ) ) ; 
   DlgParams.uStructSize      = sizeof ( TEXTDLGPARAMS ) ; 
   nRet = ForeImage.Initialize (); 
   if(nRet != SUCCESS) 
      return nRet; 
   DlgParams.pForegroundBitmap = ForeImage.GetHandle() ; 
   DlgParams.pszSampleText     = szSampleText ; 
   DlgParams.nMaxCount         = 180 ; 
   DlgParams.crText            = RGB ( 0,0,255 ) ; 
   DlgParams.crHilite          = RGB ( 255,255,255 ) ; 
   DlgParams.crShadow          = RGB ( 128,128,128 ) ; 
   DlgParams.uStyle            = 0 ; 
   DlgParams.uAlign            = EFX_TEXT_HCENTER | EFX_TEXT_VCENTER ; 
   DlgParams.bWordWrap         = FALSE ; 
   DlgParams.nAngle            = 450 ; 
   DlgParams.hFont             = NULL ; 
   DlgParams.nXDepth           = 10 ; 
   DlgParams.nYDepth           = 10 ; 
   DlgParams.bUseForeImage     = TRUE ; 
   DlgParams.uDlgFlags         = DLG_TEXT_SHOW_PREVIEW | 
   DLG_TEXT_AUTOPREVIEW  | 
   DLG_TEXT_SAMPLETEXT   | 
   DLG_TEXT_STYLE        | 
   DLG_TEXT_COLOR        | 
   DLG_TEXT_BORDERCOLOR  | 
   DLG_TEXT_ALIGN        | 
   DLG_TEXT_ANGLE        | 
   DLG_TEXT_WORDWRAP     | 
   DLG_TEXT_FONT         | 
   DLG_TEXT_FOREIMAGE    | 
   DLG_TEXT_BROWSEIMAGE  | 
   DLG_TEXT_SHADOWCOLOR  | 
   DLG_TEXT_SHADOW_X_Y ; 
   DlgEffect.EnableCallBack (FALSE); 
   nRet = DlgEffect.SetTextParams (&DlgParams) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = DlgEffect.DoModalGetText(hWnd); 
   if(nRet < 1) 
      return nRet; 
   // Gets the updated values for the structure 
   nRet = DlgEffect.GetTextParams (&DlgParams, sizeof(DlgParams)) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = LDialogEffect::Free (); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Common Dialog C++ Class Library Help