LRasterDialog::DoModalText

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalText(hWnd, pTextDlgInfo)

Brings up the text properties dialog box.

Parameters

HWND hWnd

Handle of the window that owns the dialog.

pPAINTDLGTEXTINFO pTextDlgInfo

Pointer to a PAINTDLGTEXTINFO structure that contains text information. The values present in pTextDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_TEXT_INITUSEDEFAULT is not set in the dwFlags member of pTextDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will display the Text common dialog.

L_INT LRasterDialog_DoModalTextExample( HWND hWnd, L_BOOL bUseDef ) 
{ 
   L_INT             nRet; 
   L_TCHAR*          ppszBackgroundTileBitmap [ ] = { TEXT("Tile 0"), TEXT("Tile 1"), TEXT("Tile 2"), TEXT("Tile 3"), TEXT("Tile 4"), TEXT("Tile 5") }; 
   PAINTDLGTEXTINFO  DlgTextInfo ; 
   LOGFONT           lf ;  
   PAINTTRANSFORM    Painttransform ; 
   LRasterDialog     lRstDlg ; 
 
   memset(&DlgTextInfo,0,sizeof(PAINTDLGTEXTINFO)); 
 
   if ( bUseDef == TRUE )  
   { 
      DlgTextInfo.dwFlags = PAINT_DLG_TEXT_INITUSEDEFAULT | PAINT_DLG_TEXT_SHOWALL  ; 
   } 
   else 
   { 
      lf.lfHeight         = 48; 
      lf.lfWidth          = 0 ;  
      lf.lfEscapement     = 0 ;  
      lf.lfOrientation    = 0 ;  
      lf.lfWeight         = FW_NORMAL ; 
      lf.lfItalic         = FALSE ;  
      lf.lfUnderline      = FALSE ;  
      lf.lfStrikeOut      = FALSE ;  
      lf.lfCharSet        = ANSI_CHARSET ;  
      lf.lfOutPrecision   = OUT_DEFAULT_PRECIS ;  
      lf.lfClipPrecision  = CLIP_DEFAULT_PRECIS ;  
      lf.lfQuality        = DEFAULT_QUALITY ;  
      lf.lfPitchAndFamily = FF_DONTCARE ;  
      lstrcpy(lf.lfFaceName, TEXT("Times New Roman") ) ; 
 
      Painttransform.nRotate  = 45 ; 
      Painttransform.Scale.cx = 200 ; 
      Painttransform.Scale.cy = 200 ; 
 
      DlgTextInfo.nSize                       = sizeof ( PAINTDLGTEXTINFO ) ; 
      DlgTextInfo.dwFlags                     = PAINT_DLG_TEXT_SHOWTEXT              | 
                                                PAINT_DLG_TEXT_SHOWBKGRNDSTYLE       | 
                                                PAINT_DLG_TEXT_SHOWBKGRNDOPAQUECOLOR | 
                                                PAINT_DLG_TEXT_SHOWBKGRNDTILE        | 
                                                PAINT_DLG_TEXT_SHOWBORDERWIDTH       | 
                                                PAINT_DLG_TEXT_SHOWBORDERCOLOR       | 
                                                PAINT_DLG_TEXT_SHOWHORZALIGNMENT     | 
                                                PAINT_DLG_TEXT_SHOWVERTALIGNMENT     | 
                                                PAINT_DLG_TEXT_SHOWROTATE            | 
                                                PAINT_DLG_TEXT_SHOWSCALE             | 
                                                PAINT_DLG_TEXT_SHOWTRUETYPEFONT      | 
                                                PAINT_DLG_TEXT_SHOWOPACITY           | 
                                                PAINT_DLG_TEXT_SHOWDEFAULT           ; 
 
      DlgTextInfo.pszTitle                         = TEXT("Lead Text Common Dialog ") ; 
      DlgTextInfo.pszText                          = TEXT("Test Test Test"); 
      DlgTextInfo.logFont                          = lf ;  
      DlgTextInfo.nBorderWidth                     = 10 ;  
      DlgTextInfo.crBorderColor                    = RGB ( 0, 0, 255 ) ;  
      DlgTextInfo.nBackgroundStyle                 = PAINT_TEXT_BACK_STYLE_TILEDIMAGE   ; 
      DlgTextInfo.crBackgroundColor                = RGB ( 255, 0, 0 ) ;  
      DlgTextInfo.ppszBackgroundTileBitmap         = ppszBackgroundTileBitmap ; 
      DlgTextInfo.uBackgroundTileBitmapCount       = 6 ; 
      DlgTextInfo.nActiveBackgroundTileBitmapItem  = 2 ; 
      DlgTextInfo.nAlignment                       = ( PAINTALIGNMENT ) ( PAINT_ALIGNMENT_RIGHT | PAINT_ALIGNMENT_VCENTER ) ;  
      DlgTextInfo.nOpacity                         = 10 ;    
      DlgTextInfo.TransformInfo                    = Painttransform ; 
   } 
 
   nRet = lRstDlg.DoModalText ( hWnd, &DlgTextInfo  ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
 
} 

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DigitalPaint C++ Class Library Help