Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPControlPopupColor overloaded member problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlPopupColor overloaded member problem

 Post Reply Post Reply
Author
Message
terrym View Drop Down
Senior Member
Senior Member


Joined: 13 April 2007
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote terrym Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlPopupColor overloaded member problem
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2007 at 1:10am
Hi,
Show code you have.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
terrym View Drop Down
Senior Member
Senior Member


Joined: 13 April 2007
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote terrym Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
terrym View Drop Down
Senior Member
Senior Member


Joined: 13 April 2007
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote terrym Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.