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 is shown in the following figure:

image\GetText.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::GetTextParams, LDialogEffect::SetTextParams, LDialogBase::Initialize, LPaintEffect::Draw3dText, 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); 
   
   TEXTDLGPARAMS DlgParams; 
   LBitmap ForeImage; 
   L_TCHAR        szSampleText [ L_MAXPATH ] ; 
   memset ( &DlgParams, 0, sizeof ( TEXTDLGPARAMS ) ) ; 

   DlgParams.uStructSize      = sizeof ( TEXTDLGPARAMS ) ; 
   ForeImage.Initialize();
   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); 
   DlgEffect.SetTextParams (&DlgParams) ; 
   DlgEffect.DoModalGetText(hWnd); 
   
   // Gets the updated values for the structure
   DlgEffect.GetTextParams (&DlgParams, sizeof(DlgParams)) ; 
   LDialogEffect::Free ();

}