Print Page | Close Window

CXTPControlPopupColor overloaded member problem

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=8183
Printed Date: 16 September 2024 at 4:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlPopupColor overloaded member problem
Posted By: terrym
Subject: CXTPControlPopupColor overloaded member problem
Date Posted: 26 September 2007 at 9:19pm

I have overloaded the Draw method for CXTPControlPopupColor however it seems to draw strange, I copied the code from the actual XTP library for Draw (so same code), except change m_clr (as it is private) to GetColor()

Any ideas why this is drawing strange, below it is drawn wrong (see color group)
 
 
and below is drawn correct (see color group)
 


-------------
Thank you,
Terry Mancey

email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey



Replies:
Posted By: Oleg
Date Posted: 27 September 2007 at 1:10am
Hi,
Show code you have.


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


Posted By: terrym
Date Posted: 27 September 2007 at 7:46am
We have the following code for our draw:
 
 
void CMyXTPControlPopupColor::Draw( CDC *pDC )

{

CXTPPaintManager* pPaintManager = GetPaintManager();

CXTPFontDC font (pDC, pPaintManager->GetRegularFont());

pPaintManager->DrawControlEntry(pDC, this);

pDC->SetTextColor(pPaintManager->GetControlTextColor(this));

CRect rcText = GetRect();

pPaintManager->DrawControlText(pDC, this, &rcText, TRUE, FALSE, TRUE, FALSE);

if ( GetColor() != COLORREF_NULL)

{

#define XTP_SELECTOR_SIZE 18

CRect rcButton(CPoint(m_rcControl.left + 2, m_rcControl.CenterPoint().y - XTP_SELECTOR_SIZE / 2), CSize(XTP_SELECTOR_SIZE, XTP_SELECTOR_SIZE));

rcButton.DeflateRect(3, 3);

if (GetEnabled())

pDC->FillSolidRect(rcButton, GetColor());

pDC->Draw3dRect(rcButton, GetXtremeColor(COLOR_3DSHADOW), GetXtremeColor(COLOR_3DSHADOW));

}

}



-------------
Thank you,
Terry Mancey

email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey


Posted By: terrym
Date Posted: 27 September 2007 at 7:59am
Basically rather than the thin coloured line that shows, I want to draw a square coloured image based on the selected colour

-------------
Thank you,
Terry Mancey

email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey



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