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 » Soldi background Collapse All
Subject Author Date
Sergio Buonanno Oct 27, 2006 - 3:07 AM

To avoid problems of slow painting I would like to have a solid color background instead of a faded one in case my application is running under Terminal Server. At present I’m using Visual Studio 2005 theme and it slows down a lot my application when it’s running under Terminal Server because it takes a long time to update windows (due to the shaded background color of dialogs and toolbars). Is there any solution to fix this problem ?

Technical Support Oct 27, 2006 - 6:38 AM

You can implement a solid background by overriding the CExtPaintManagerStudio2005:: InitTranslatedColors() method:

 
class CYourPaintManager : public CExtPaintManagerStudio2005
{
public:
    void InitTranslatedColors()
    {
        ASSERT_VALID( this );
        CExtPaintManagerStudio2005::InitTranslatedColors();
        // Make dark gradient color same as light
        m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_DARK] =
            m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_LIGHT];
    }
};
To use this paint manager, just invoke this line:
g_PaintManager.InstallPaintManager( new CYourPaintManager );

Sergio Buonanno Oct 27, 2006 - 7:16 AM

I’m sorry, the function is called. But I need a solid background for menus and toolbars too. I need to reduce at minimum the grafic averhead during Terminal Service sessions. Any hint ?

Technical Support Oct 30, 2006 - 10:37 AM

If you want to remove all the gradient backgrounds, then why do not use the CExtPaintManager or CExtPaintManagerXP themes? They do not use gradients at all and it is exactly what you want.

Sergio Buonanno Nov 3, 2006 - 12:58 AM

Because those themes change also look of some controls like the Page Navigator and labels of dock-able control panels. I want to keep the look of my application and remove all gradients. There is another important thing; I would like to use the same color of standard dialogs’ background color instead of the gradient. I noticed that the color used by Prof-UIS is slightly different.
You suggested me to replace the paint manager class with the following:

class CTerminalServicePaintManager : public CExtPaintManagerStudio2005
{
public:
virtual void InitTranslatedColors()
{
ASSERT_VALID( this );
        CExtPaintManagerStudio2005::InitTranslatedColors();
// Make dark gradient color same as light
m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_LIGHT] =
m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_DARK] = COLOR_BTNFACE;
}
};

But COLOR_BTNFACE isn’t the same background color used by dialogs with themes. I would like to remove the gradient and use the same background color of standard (themed) dialogs. I know how to get that color but I don’t know how to set it in the Paint Manager.

Technical Support Nov 3, 2006 - 11:21 AM

Please try replacing these lines

m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_LIGHT] = 
m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_DARK] = COLOR_BTNFACE;
with
m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_LIGHT] = 
m_mapColorTranslate[CExtPaintManagerOffice2003::_2003CLR_GRADIENT_DARK] = InstallColor( ::GetSysColor(COLOR_BTNFACE) );

Sergio Buonanno Nov 6, 2006 - 9:55 AM

And how can I remove the gradient of the Page Navigator’s labels ?

Technical Support Nov 7, 2006 - 1:08 PM

You can see how the _2003CLR_PN_xxx color constants are initialized in the CExtPaintManagerStudio2005::InitTranslatedColors() method. You can change them as you wish.

Please note you can use the CExtControlBar::g_eResizablePanelDockingType static property for changing the docking algorithm for control bars including docking markers. Here are three available types:

__RESIZABLE_DOCKING_TYPE_BY_THEME depends on the currently installed Paint Manager
__RESIZABLE_DOCKING_TYPE_STUDIO_2003- always as in Visual Studio .NET 2002/2003
__RESIZABLE_DOCKING_TYPE_STUDIO_2005 always as in Visual Studio 2005

So you can use the 2005 style docking even for the Office 2000 theme.

Sergio Buonanno Oct 27, 2006 - 7:02 AM

I missed to tell you something important. I’m using Prof UIS ver. 2.52. I called g_PaintManager.InstallPaintManager(RUNTIME_CLASS(CMyPaintManager)) as you told me to do; but the function InitTranslatedColors isn’t called. Is this because I’m using Prof UIS 2.52 ? In that case; Is there any solution for version 2.52 ?