Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Customize Theme Colors? Collapse All
Subject Author Date
Dan Heinz Mar 4, 2004 - 5:01 PM

Is there a way to change the base color in a theme?  I’d love to tweak the win2003 theme to use a darker blue if possible.


Thanks!

Sergiy Lavrynenko Mar 5, 2004 - 4:29 AM

Dear Dan,


To implement what you want, you need to create your own paint manager component and use it instead of CExtPaintManagerOffice2003. The Office 2003 style is more complex to implement in comparison to other styles because it supports three absolutely different painting modes for all Prof-UIS components:

  • VARIANT A: Windows XP themed mode is used on Windows XP/Server-2003 only with any desktop theme activated except for Windows Classic theme

  • VARIANT B: Classic mode is used on any non-XP and non-Server-2003 Windows and on Windows XP/Server-2003 with Windows Classic theme applied to in the desktop settings (in fact, the Classic theme is really not a theme at all, in other words, it is how the previous versions of Windows work)

  • VARIANT C: Low-Color mode is used on any Windows OS with the video mode is set to the 256 (or less) colors.

I recommend you to create your own class derived from CExtPaintManagerXP and copy all the methods and properties of the CExtPaintManagerOffice2003 class into it (i.e. simply create a copy of the CExtPaintManagerOffice2003 class and rename it). After that you need to modify the InitTranslatedColors() virtual method. Here is its code (simplified):
void CYourPaintManager2003::InitTranslatedColors()
{
 . . . . .
 if( stat_GetBPP() > 8 )
 {
  . . . . .
  if(  g_PaintManager.m_bUxApiInitPassed
   && g_PaintManager.m_bUxValidColorsExtracted
   && g_PaintManager.m_bUxUseIfAvailOnWinXpOrLater
   )
  { // if use WinXP themed colors
VARIANT A
  } // if use WinXP themed colors
  else
  { // if use system colors
VARIANT B
  } // if use system colors
  . . . . .
 } // if( stat_GetBPP() > 8 )
 else
 {
VARIANT C
 } // else from if( stat_GetBPP() > 8 )}
 . . . . .
}

Now you have to modify the source code for variants A and B.


A is based on the g_PaintManager.m_clrUxTaskBandEdgeLightColor, g_PaintManager.m_clrUxTaskBandEdgeShadowColor, g_PaintManager.m_clrUxTaskBandFillColorHint and g_PaintManager.m_clrUxTaskBandAccentColorHint colors values which are extracted from the User-Ex API of UxTheme.Dll. You may modify these color values before VARAINT A creates all other colors and non-linear gradient bitmaps.


B is mostly based on two classic system colors: COLOR_3DFACE and COLOR_3DSHADOW. You may also change the color generation code.


C needs no modification.


After completing this work, you can start using your paint manager:
    g_PaintManager.InstallPaintManager(
        new CYourPaintManager2003
        );

Best regards, Sergiy.