LRasterDialog::DoModalText

#include "Ltwrappr.h"

L_INT LRasterDialog::DoModalText(hWnd, pTextDlgInfo)

HWND hWnd;

/* owner of the dialog */

pPAINTDLGTEXTINFO pTextDlgInfo;

/* pointer to a structure */

Brings up the text properties dialog box.

Parameter

Description

hWnd

Handle of the window that owns the dialog.

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

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Required DLLs and Libraries

LTPDG

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:

LRasterPaint::GetProperty, LRasterPaint::SetProperty, LRasterPaint::ApplyText

Topics:

Using the DigitalPaint Common Dialogs

Example

// This example will display the Text common dialog 


L_VOID TextDlgTest ( HWND hWnd, L_BOOL bUseDef ) 
{
   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 ;

   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 ;
   }

   lRstDlg.DoModalText ( hWnd, &DlgTextInfo  ) ;

   return ;

}