Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - How to set Task Dialog main instruction color?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to set Task Dialog main instruction color?

 Post Reply Post Reply
Author
Message
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post Topic: How to set Task Dialog main instruction color?
    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)

Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

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: 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
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.111 seconds.