Print Page | Close Window

Themes on W2K...

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=677
Printed Date: 15 May 2024 at 7:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Themes on W2K...
Posted By: ddlittle
Subject: Themes on W2K...
Date Posted: 29 April 2004 at 3:49pm

I was testing an app on a W2K box that uses the Office/2003 theme, and the colors are all dull. 

What do most of you do in this situation?  Do you switch to a Office/2000 theme on W2K?  Do you try to emulate themes by hardcoding the colors in the paint manager?  I really don't want to ship something that is that dull...

Thanks!

- David Little




Replies:
Posted By: Ark42
Date Posted: 29 April 2004 at 5:05pm

See https://forum.codejock.com/forum_posts.asp?TID=626&PN=2 - https://forum.codejock.com/forum_posts.asp?TID=626&P N=2 -- I use hard coded colors to simulate the blue theme that it would look like under XP for anything less then XP, but only if the user has the default grey settings for their OS.



Posted By: ddlittle
Date Posted: 29 April 2004 at 5:54pm

That looks pretty good,except for the pane colors.  I guess I need to do something similar for those colors.  I'll try it tomorrow...

- David Little



Posted By: Ark42
Date Posted: 29 April 2004 at 5:57pm

Not sure what you mean by pane colors? The colors are all the exact same as they would look with the normal Office2003 theme under XP.
Got a screenshot?



Posted By: ddlittle
Date Posted: 29 April 2004 at 7:03pm

For my docking panes, I have this:

 GetDockingPaneManager()->SetTheme(xtpPaneThemeOffic e2003);

which is a different method than the overridden theme.  The color arrays and theme members are the same.  Am I using this wrong?

- David



Posted By: Ark42
Date Posted: 29 April 2004 at 7:08pm
Yeah, you aren't using the custom theme then. Anyplace you use SetTheme you need to use SetCustomTheme or some other equivalent.  You need to have a "new CXTPOffice2003ThemeEx()" for each place, I think.

I have to use the custom thing twice, and each one needs its own new'd copy or it blows up later on when they try to self-delete or something:

CXTPPaintManager::SetCustomTheme(new CXTPOffice2003ThemeEx());
GetCommandBars()->SetPaintManager(new CXTPOffice2003ThemeEx());



Posted By: Ark42
Date Posted: 30 April 2004 at 4:06pm

Ok, well I hadn't used the docking pain until now, but I think it needs its own theme, because its derived from some other class:

class CXTPDockingPaneOffice2003ThemeEx : public CXTPDockingPaneOffice2003Theme
{
public:
    CXTPDockingPaneOffice2003ThemeEx(BOOL bGreyToBlue = TRUE, BOOL bYellowHighlight = FALSE);
    BOOL m_bGreyToBlue, m_bYellowHighlight;
protected:
    virtual void RefreshMetrics();
};

CXTPDockingPaneOffice2003ThemeEx::CXTPDockingPaneOffice2 003ThemeEx(BOOL bGreyToBlue, BOOL bYellowHighlight)
{
    m_bGreyToBlue = bGreyToBlue;
    m_bYellowHighlight = bYellowHighlight;
    RefreshMetrics();
}

void CXTPDockingPaneOffice2003ThemeEx::RefreshMetrics()
{
    CXTPDockingPaneOffice2003Theme::RefreshMetrics();
    if( !m_bLunaTheme ) {
        CXTPColorManager *pClrMgr = XTPColorManager();
        COLORREF btn = pClrMgr->GetColor(COLOR_BTNFACE);
        if( m_bGreyToBlue && (btn == RGB(192, 192, 192) || btn == RGB(212, 208, 200)) ) {
            m_clrCommandBarDark = RGB(129, 169, 226);
            m_clrCommandBarLight = RGB(221, 236, 254);
            m_bLunaTheme = TRUE;

            m_arrColor[0] = RGB(0, 0, 0);
            m_arrColor[1] = RGB(0, 78, 152);
            m_arrColor[2] = RGB(0, 84, 227);
            m_arrColor[3] = RGB(122, 150, 223);
            m_arrColor[4] = RGB(255, 255, 255);
            m_arrColor[5] = RGB(255, 255, 255);
            m_arrColor[6] = RGB(0, 0, 0);
            m_arrColor[7] = RGB(0, 0, 0);
            m_arrColor[8] = RGB(0, 0, 0);
            m_arrColor[9] = RGB(255, 255, 255);
            m_arrColor[10] = RGB(212, 208, 200);
            m_arrColor[11] = RGB(212, 208, 200);
            m_arrColor[12] = RGB(128, 128, 128);
            m_arrColor[13] = RGB(49, 106, 197);
            m_arrColor[14] = RGB(255, 255, 255);
            m_arrColor[15] = RGB(236, 233, 216);
            m_arrColor[16] = RGB(172, 168, 153);
            m_arrColor[17] = RGB(172, 168, 153);
            m_arrColor[18] = RGB(0, 0, 0);
            m_arrColor[19] = RGB(216, 228, 248);
            m_arrColor[20] = RGB(255, 255, 255);
            m_arrColor[21] = RGB(113, 111, 100);
            m_arrColor[22] = RGB(251, 248, 231);
            m_arrColor[23] = RGB(0, 0, 0);
            m_arrColor[24] = RGB(255, 255, 225);
            m_arrColor[25] = RGB(181, 181, 181);
            m_arrColor[26] = RGB(0, 0, 128);
            m_arrColor[27] = RGB(61, 149, 255);
            m_arrColor[28] = RGB(0, 0, 0);
            m_arrColor[29] = RGB(0, 0, 0);
            m_arrColor[30] = RGB(158, 190, 245);
            m_arrColor[31] = RGB(255, 238, 194);
            m_arrColor[32] = RGB(0, 0, 128);
            m_arrColor[33] = RGB(254, 128, 62);
            m_arrColor[34] = RGB(144, 157, 178);
            m_arrColor[35] = RGB(197, 194, 184);
            m_arrColor[36] = RGB(255, 192, 111);
            m_arrColor[37] = RGB(0, 0, 128);
            m_arrColor[38] = RGB(39, 65, 118);
            m_arrColor[39] = RGB(106, 140, 203);
            m_arrColor[40] = RGB(109, 150, 208);
            m_arrColor[41] = RGB(246, 246, 246);
            m_arrColor[42] = RGB(230, 227, 210);
            m_arrColor[43] = RGB(0, 45, 150);
            m_arrColor[44] = RGB(0, 0, 0);
            m_arrColor[45] = RGB(0, 0, 0);
            m_arrColor[46] = RGB(0, 0, 0);
            m_arrColor[47] = RGB(0, 0, 0);
            m_arrColor[48] = RGB(218, 233, 255);
            m_arrColor[49] = RGB(129, 126, 114);
            m_arrColor[50] = RGB(0, 0, 128);
            m_arrColor[51] = RGB(216, 231, 252);
            m_arrColor[52] = RGB(158, 190, 245);
            m_arrColor[53] = RGB(203, 225, 252);
            m_arrColor[54] = RGB(0, 45, 150);
            m_arrColor[55] = RGB(196, 218, 250);
        } else if(m_bYellowHighlight) {
            m_arrColor[31] = RGB(255, 238, 194);
            m_arrColor[33] = RGB(254, 128, 62);
            m_arrColor[36] = RGB(255, 192, 111);
            m_bLunaTheme = TRUE;
        }
    }
}


    m_paneManager.SetCustomTheme(new CXTPDockingPaneOffice2003ThemeEx());


Its almost the same class, but it works like that.

What I havn't figured out yet is how to get the status bar color the proper shade of grey (by this I mean it is drawing as RGB(212, 208, 200) despite me wanting it RGB(236, 233, 216)):


..and how to get the edit box portion of a combo box on my toolbars to also use the proper shade of grey when disabled, and also its rightclick menu it not themed...


Posted By: Ark42
Date Posted: 30 April 2004 at 7:23pm

Well the best fix I could come up with without ripping apart all the codejock source is to just set
m_arrColor[15] = btn; instead of m_arrColor[15] = RGB(236, 233, 216);

This will make the theme not look exactly the same as it would under XP, but you still get all the cool blue gradiants and yellow/orange highlights, without the dual-tone disabled combo box and stuff. It will just use the normal button face color 212,208,200 or 192,192,192.




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