L_DlgGetText

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_DlgGetText(hWndOwner, pDlgParams)

HWND hWndOwner;

/* owner of dialog */

LPTEXTDLGPARAMS pDlgParams;

/* pointer to a TEXTDLGPARAMS structure */

Displays the Get Text dialog box, and gets the options for L_EfxDrawRotated3dText.

Parameter

Description

hWndOwner

Handle of the window which owns the dialog.

pDlgParams

Pointer to a TEXTDLGPARAMS 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 dialog’s 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 Text dialog can be seen below:

image\GetText.gif

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_EfxDrawRotated3dText

Topics:

Dialogs: Special Effects

 

Using Imaging Common Dialog

Example

L_VOID ShowDialog ( HWND hWnd, pBITMAPHANDLE pBitmap )
{
   L_TCHAR        szSampleText [ L_MAXPATH ] ;
   TEXTDLGPARAMS DlgParams ;
   BITMAPHANDLE  ForeBitmap ;
   HDC           hDC ;
   HDC           hForeDC ;
   RECT          rcDst ;

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

   lstrcpy ( szSampleText, TEXT("LEADTOOLS!") ) ;

    L_InitBitmap(&ForeBitmap, sizeof(BITMAPHANDLE), 0, 0, 0 ) ;

   DlgParams.uStructSize             = sizeof ( TEXTDLGPARAMS ) ;
   DlgParams.pBitmap           = pBitmap ;
   DlgParams.pForegroundBitmap = &ForeBitmap ;
   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 ;

   L_DlgInit ( DLG_INIT_COLOR ) ;

   if ( SUCCESS_DLG_OK == L_DlgGetText ( hWnd, &DlgParams ) )
   {
      hForeDC = NULL ;

      if ( DlgParams.bUseForeImage )
      {
         hForeDC =  L_CreateLeadDC( &ForeBitmap ) ;
      }

      hDC = GetDC ( hWnd ) ;

      GetClientRect ( hWnd, &rcDst ) ;

      L_EfxDrawRotated3dText( hDC,
                               DlgParams.pszSampleText,
                               &rcDst,
                               DlgParams.nAngle,
                               DlgParams.uStyle | DlgParams.uAlign |
                               ( DlgParams.bWordWrap ) ? EFX_TEXT_WORDWRAP : 0,
                               DlgParams.nXDepth,
                               DlgParams.nYDepth,
                               DlgParams.crText,
                               DlgParams.crShadow,
                               DlgParams.crHilite,
                               DlgParams.hFont,
                               hForeDC  ) ;

      ReleaseDC ( hWnd, hDC ) ;

      if ( hForeDC )
      {
          L_DeleteLeadDC( hForeDC ) ;
      }
   }

   L_DlgFree ( ) ;

   if ( DlgParams.hFont )
   {
      DeleteObject ( DlgParams.hFont ) ;
   }

   if ( ForeBitmap.Flags.Allocated )
   {
       L_FreeBitmap( &ForeBitmap ) ;
   }

}