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 » Using XP style with the same effect used in 2003 style for disabled buttons Collapse All
Subject Author Date
Paula Burkle Apr 16, 2004 - 12:44 PM

Hi all,


I would like to use the XP style but with the same effect of disabled buttons in toolbars and menus used in 2003 style (grayed buttons). There is a way to do that?


One more question: If we don’t call the method DockControlBar for the menu bar, when we restore and maximize the main window, the menu bar is not updated and the buttons minimize, restore and maximize don’t disappear.


 


thanks a lot, Paula.


 

Technical Support Apr 19, 2004 - 9:44 AM

Dear Paula,

To use the XP-like style with disabled alpha icons, just derive your own class from CExtPaintManagerXP and override two its methods:

class CMyPaintManager : public CExtPaintManagerXP
{
public:
    double GetIconAlphaAdjustPercent() const
    {
        return 0.70; // 70% enlighten
    }
    COLORREF GetIconAlphaColor() const
    {
        COLORREF clrAlpha =
            ( const_cast < CMyPaintManager * >
                    ( this ) )
                -> GetColor( COLOR_3DFACE );
        return clrAlpha;
    }
};

Then use it:
g_PaintManager.InstallPaintManager( new CMyPaintManager );
 

As for non-updated min/max/close buttons in the menu bar, it is a minor bug, which is easily fixed by overriding the WindowProc() virtual method in the CExtMenuControlBar class:
LRESULT CExtMenuControlBar::WindowProc(
    UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT lResult =
        CExtToolControlBar::WindowProc(
            message,wParam,lParam);
    switch( message )
    {
    case WM_WINDOWPOSCHANGED:
    case WM_SIZE:
        if( m_pDockContext == NULL )
        {
            Invalidate();
            UpdateWindow();
        } // if( m_pDockContext == NULL )
        break;
    } // switch( message )
    return lResult;
}

Paula Burkle Apr 19, 2004 - 12:00 PM

thank a lot. but, the non-updated solution didn’t work.


bes regards,


Paula.

Technical Support Apr 25, 2004 - 12:26 PM

Dear Paula,

What do you mean by "the non-updated solution"?