Print Page | Close Window

How to set Task Dialog main instruction color?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=11342
Printed Date: 23 November 2024 at 2:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set Task Dialog main instruction color?
Posted By: Smucker
Subject: How to set Task Dialog main instruction color?
Date Posted: 08 July 2008 at 9:32am
On a skinned dark background, it's not very readable:



None of the colors in my skin project seem to match (though because of cleartype I can't be positive) -- is there a property I need to add?

-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)




Replies:
Posted By: Smucker
Date Posted: 09 July 2008 at 1:18pm
The color of the main instruction appears to be hardcoded in CXTPTaskDialogClient::RefreshColors():

   m_crMainText = m_bThemeReady ? RGB(0x00, 0x33, 0x99) : m_crContextText;

Shouldn't this use a skinnable color? It is unreadable on a dark background!



-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)



Posted By: Smucker
Date Posted: 10 July 2008 at 6:00pm
Here's my workaround for now, by overriding CXTPTaskDialog::DrawMainInstruction() . It's rather arbitrary and ugly, but it is a temporary solution sufficient for my current needs. (Overriding RefreshColors() was an option as well, but it's not virtual so more likely to cause problems.)

Please let me know if and when there will be a way to handle this color properly from within the skin.

class CSWTaskDialog : public CXTPTaskDialog
{
public:
  CSWTaskDialog(CWnd* pWndParent = NULL) : CXTPTaskDialog(pWndParent) {};

protected:
  virtual void DrawMainInstruction(CDC* pDC) {
    if (m_crMainText == RGB(0x00, 0x33, 0x99)
        && GetRValue(m_crContext) + GetGValue(m_crContext) + GetBValue(m_crContext) < 360)
      m_crMainText = RGB(0x66, 0x99, 0xff);
    CXTPTaskDialog::DrawMainInstruction(pDC);
  };
};



-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)



Posted By: Oleg
Date Posted: 11 July 2008 at 3:43am
Hello,
 
Thanks, we fixed it.
 
Here code we added
 
  if (!XTPColorManager()->LongColor(m_crMainText, crWindow, 1, 50))
   m_crMainText = m_crContextText;


-------------
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