![]() |
DrawTextEx : is not a member of "CXTPPaintManager" |
Post Reply ![]() |
Author | |
shanmuganathan ![]() Groupie ![]() ![]() Joined: 01 December 2006 Status: Offline Points: 49 |
![]() ![]() ![]() ![]() ![]() 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.
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |