Print Page | Close Window

DrawTextEx : is not a member of "CXTPPaintManager"

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5725
Printed Date: 17 July 2025 at 5:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DrawTextEx : is not a member of "CXTPPaintManager"
Posted By: shanmuganathan
Subject: DrawTextEx : is not a member of "CXTPPaintManager"
Date Posted: 08 December 2006 at 5:42am
Hi
 
When we execute our code using latest XtremeToolkit (10.3.1) we face the following error.
 
D:\Sample_Workspace_toTest_Xtreme\Sample workspace\MainFrm.cpp(159) : error C2039: 'DrawTextExA' : is not a member of 'CXTPPaintManager'
D:\Sample_Workspace_toTest_Xtreme\Sample workspace\MainFrm.cpp(207) : error C2039: 'DrawTextExA' : is not a member of 'CXTPPaintManager'
Guide us what to do.



Replies:
Posted By: Oleg
Date Posted: 08 December 2006 at 10:55am
Hello,
Yes, sorry was changed. use DrawControlText method:
 
 
CSize CControlStatic::GetSize(CDC* pDC)
{
 // This function is used to determine the size
 // of the bounding rectangle of the text.  The
 // function returns the size of the rectangle in
 // a CSize object.
 // Determine if the toolbar is docked horizontally or vertically.
 BOOL bVert = GetParent()->GetPosition() == xtpBarRight || GetParent()->GetPosition() == xtpBarLeft;
 // Instantiate an empty CRect object to hold the
 // size of the bounding rectangle of the text.
 CXTPEmptyRect rcText;
 // Function declaration for the DrawTextEx function:
 //  CSize DrawTextEx(
 //      CDC*    pDC,                A pointer to the current device context.
 //      CString str,                A CString object that contains the text to draw.
 //      CRect   rcText,             A CRect object that is used to hold the size of the bounding rectangle of the text.
 //      BOOL    bDraw,              If TRUE, then the text is drawn.  If FALSE, then the function returns the size of the bounding rectangle of the text.
 //      BOOL    bVert,              TRUE if the toolbar is docked in a vertical position.
 //      BOOL    bCentered,          TRUE if the text is drawn centered.
 //      BOOL    bTriangled,         If TRUE, then an arrow is drawn at the end of the text.
 //      BOOL    bEmbosssed = FALSE, TRUE to draw the text embossed.
 //  );
 // Do not draw the text, just get the size of the bounding rectangle of the text.
 CSize sz = GetPaintManager()->DrawControlText(pDC, this, &rcText, FALSE, bVert, FALSE, FALSE);
 // If the toolbar is docked in a vertical position,
 // then the minimum width of the bounding rectangle is 22.
 // The height of the bounding rectangle is the length of the text.
 if (bVert)
  return CSize(max(22, sz.cx), sz.cy);
 // If the toolbar is drawn in a horizontal position, then
 // the length of the bounding rectangle is the length of the text.
 // The height of the bounding rectangle is a minimum of 22.
 return CSize(sz.cx, max(22, sz.cy));
}
void CControlStatic::Draw(CDC* pDC)
{
 // Determine if the toolbar is docked horizontally or vertically.
 BOOL bVert = GetParent()->GetPosition() == xtpBarRight || GetParent()->GetPosition() == xtpBarLeft;
 // Get the bounding rectangle of the control.
 CRect rcText = GetRect();
 // Function declaration for DrawControlEntry:
 // DrawControlEntry(
 //      CDC*            pDC,         Pointer to a valid device context
 //      CRect           rc,          Rectangle to draw.
 //      BOOL            bEnabled,    TRUE if the control is enabled.
 //      BOOL            bSelected,   TRUE if the control is selected.
 //      BOOL            bPressed,    TRUE if the control is pushed.
 //      BOOL            bChecked,    TRUE if the control is checked.
 //      BOOL            bPopuped,    TRUE if the control is popuped.
 //      XTPBarPosition  barPosition, Parent's bar position.
 //  );
 // This method is called to fill the control's face.
 pDC->SetTextColor(GetPaintManager()->GetRectangleTextColor(FALSE, FALSE, GetEnabled(), FALSE, FALSE, GetParent()->GetType(), GetParent()->GetPosition()));
 // Function declaration for the DrawTextEx function:
 //  CSize DrawTextEx(
 //      CDC*    pDC,                A pointer to the current device context.
 //      CString str,                A CString object that contains the text to draw.
 //      CRect   rcText,             A CRect object that is used to hold the size of the bounding rectangle of the text.
 //      BOOL    bDraw,              If TRUE, then the text is drawn.  If FALSE, then the function returns the size of the bounding rectangle of the text.
 //      BOOL    bVert,              TRUE if the toolbar is docked in a vertical position.
 //      BOOL    bCentered,          TRUE if the text is drawn centered.
 //      BOOL    bTriangled,         If TRUE, then an arrow is drawn at the end of the text.
 //      BOOL    bEmbosssed = FALSE, TRUE to draw the text embossed.
 //  );
 // GetEnabled() returns TRUE if the control is enabled; otherwise FALSE.
 GetPaintManager()->DrawControlText(pDC, this, &rcText, TRUE, bVert, TRUE, FALSE);
}
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net