LRasterPaintWindow::GetPaintText
#include "Ltwrappr.h"
PAINTTEXT * LRasterPaintWindow::GetPaintText()
Gets the paint text properties.
Returns
Pointer to a PAINTTEXT structure that contains the current paint text properties.
Comments
If this function is called before LRasterPaintWindow::SetPaintText has been called, the default values will be returned. For more information about the default property values, refer to:
LRasterPaintWindow::Initialize must be called before calling this function.
Required DLLs and Libraries
LTPNT 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: |
Example
void OnPropsText(LRasterPaintWindow *pRasterPntWnd, LBitmapBase *pLBtmpBackTile, HWND hWnd, LBitmapBase* pLBtmpPaperTexture, LRasterDialog *pPaintDialog)
{
PAINTDLGTEXTINFO TextDlgInfo;
PAINTTEXT* pPaintText = pRasterPntWnd->GetPaintText();
L_INT nRetCode;
LOGFONT lf;
L_TCHAR* BKTileBitmap [ ] = { TEXT("Blocks") };
L_TCHAR* TextureBitmap [ ] = { TEXT("Texture-00") };
if(pPaintText->hFont != NULL)
{
GetObject(pPaintText->hFont, sizeof(LOGFONT), &lf);
}
TextDlgInfo.dwFlags = PAINT_DLG_TEXT_SHOWALL;
TextDlgInfo.pszTitle = TEXT("Text Properties");
TextDlgInfo.pszText = pPaintText->pszText;
TextDlgInfo.logFont = lf;
TextDlgInfo.nBorderBrushStyle = pPaintText->nBorderBrushStyle;
TextDlgInfo.nBorderWidth = pPaintText->nBorderWidth;
TextDlgInfo.crBorderColor = pPaintText->crBorderColor;
TextDlgInfo.nBackgroundStyle = pPaintText->nBackgroundStyle;
TextDlgInfo.crBackgroundColor = pPaintText->crBackgroundColor;
TextDlgInfo.ppszBackgroundTileBitmap = BKTileBitmap;
TextDlgInfo.uBackgroundTileBitmapCount = 1;
TextDlgInfo.nActiveBackgroundTileBitmapItem = 0;
TextDlgInfo.nAlignment = pPaintText->nAlignment;
TextDlgInfo.nOpacity = pPaintText->nOpacity;
TextDlgInfo.ppszPaperTexture = TextureBitmap;
TextDlgInfo.uPaperTextureCount = 1;
TextDlgInfo.nActivePaperTextureItem = ((pPaintText->pTexture != NULL) ? 0 : -1);
TextDlgInfo.TransformInfo = pPaintText->TransformInfo;
nRetCode = pPaintDialog->DoModalText (hWnd, &TextDlgInfo );
if(nRetCode == SUCCESS)
{
pPaintText->nSize = sizeof(PAINTTEXT) ;
pPaintText->dwMask = PTF_ALL;
pPaintText->pszText = TextDlgInfo.pszText;
if(pPaintText->hFont != NULL)
{
DeleteObject(pPaintText->hFont);
}
pPaintText->hFont = CreateFontIndirect(&TextDlgInfo.logFont);
pPaintText->nBorderBrushStyle = TextDlgInfo.nBorderBrushStyle;
pPaintText->nBorderWidth = TextDlgInfo.nBorderWidth;
pPaintText->crBorderColor = TextDlgInfo.crBorderColor;
pPaintText->nBackgroundStyle = TextDlgInfo.nBackgroundStyle;
pPaintText->crBackgroundColor = TextDlgInfo.crBackgroundColor;
pPaintText->pBackgroundTileBitmap = ((TextDlgInfo.nActiveBackgroundTileBitmapItem != -1) ? pLBtmpBackTile->GetHandle() : NULL);
pPaintText->nAlignment = TextDlgInfo.nAlignment;
pPaintText->nOpacity = TextDlgInfo.nOpacity;
pPaintText->pTexture = ((TextDlgInfo.nActivePaperTextureItem != -1) ? pLBtmpPaperTexture->GetHandle() : NULL);
pPaintText->TransformInfo = TextDlgInfo.TransformInfo;
pRasterPntWnd->SetPaintText (pPaintText);
}
}