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 Tech Support » StatusBar Gradient Color Collapse All
Subject Author Date
John Kiernan Jun 14, 2006 - 12:31 PM

Hi,
I’m using a CExtStatusControlBar status bar and the Office 2007 (Luna-Blue) theme.
The gradient on the first pane ("Ready" text) is a light blue and all the other panes have a dark blue gradient.

Is there a way to make the rest of the panes have the same gradient as the first pane?

Thanks,

John Kiernan

Technical Support Jun 14, 2006 - 1:03 PM

Yes, you can set any of two backgrounds for the status pane when Office 2007 themes are applied. All the supported status pane backgrounds are defined by the CExtStatusControlBar::e_StatusPaneBackgroundAccent_t enumeration:

    enum e_StatusPaneBackgroundAccent_t
    {
        __ESPBA_AUTOMATIC    = 0,
        __ESPBA_LIGHT        = 1,
        __ESPBA_DARK         = 2,
    };
By default, the __ESPBA_AUTOMATIC color accent is used for all the panes. The status tip pane with zero identifer uses the light accent. All other panes use the dark accent. You can get the number of status panes and get/set color accents to each of them using the following members of the CExtStatusControlBar class:
    int GetPaneCount() const; 
    virtual e_StatusPaneBackgroundAccent_t OnQueryPaneBackgroundAccent(
        int nIndex
        ) const;
    e_StatusPaneBackgroundAccent_t GetPaneBackgroundAccent(
        int nIndex
        ) const;

John Kiernan Aug 15, 2006 - 4:27 PM

Alright, now I have a related question. I just made my dialog resizable and now the gripper on the status bar has a dark accent.
Is there a way to change the gripper background accent to be light also?

Technical Support Aug 16, 2006 - 10:23 AM

Thank you for the interesting question. We would like to ask you to update the source code for the CExtPaintManagerOffice2007_Impl::StatusBar_EraseBackground() method in the ../Prof-UIS/Src/ExtPaintManager.cpp file. This update will make the gripper consistent with the background style of the last status pane:

bool CExtPaintManagerOffice2007_Impl::StatusBar_EraseBackground(
    CDC & dc,
    const RECT & rcClient,
    const CExtStatusControlBar * pStatusBar,
    LPARAM lParam
    ) const
{
    ASSERT_VALID( this );
    ASSERT_VALID( pStatusBar );
    lParam;
    if(    m_bmpStatusBkLight.IsEmpty()
        || m_bmpStatusBkDark.IsEmpty()
        )
        return false;
bool bLastIsDark = true;
INT nPaneIdx, nPaneCount = pStatusBar->GetPaneCount();
    if( nPaneCount > 0 )
    {
        CExtStatusControlBar::e_StatusPaneBackgroundAccent_t eSPBA =
            pStatusBar->OnQueryPaneBackgroundAccent( nPaneCount - 1 );
        if( eSPBA == CExtStatusControlBar::__ESPBA_LIGHT )
            bLastIsDark = false;
    }
    if( bLastIsDark )
        m_bmpStatusBkDark.DrawSkinParts(
            dc.m_hDC,
            rcClient,
            m_rcStatusBkPadding,
            CExtBitmap::__EDM_STRETCH
            );
    else
        m_bmpStatusBkLight.DrawSkinParts(
            dc.m_hDC,
            rcClient,
            m_rcStatusBkPadding,
            CExtBitmap::__EDM_STRETCH
            );
    for( nPaneIdx = 0; nPaneIdx < nPaneCount; nPaneIdx++ )
    {
        CExtStatusControlBar::e_StatusPaneBackgroundAccent_t eSPBA =
            pStatusBar->OnQueryPaneBackgroundAccent( nPaneIdx );
        if( bLastIsDark )
        {
            if( eSPBA == CExtStatusControlBar::__ESPBA_LIGHT )
            {
                CRect rcPane;
                pStatusBar->GetItemRect( nPaneIdx, &rcPane );
                rcPane.top = rcClient.top;
                rcPane.bottom = rcClient.bottom;
                if( rcPane.IsRectEmpty() || (! dc.RectVisible( &rcPane ) ) )
                    continue;
                m_bmpStatusBkLight.DrawSkinParts(
                    dc.m_hDC,
                    rcPane,
                    m_rcStatusBkPadding,
                    CExtBitmap::__EDM_STRETCH
                    );
                continue;
            }
        }
        else
        {
            if( eSPBA == CExtStatusControlBar::__ESPBA_DARK )
            {
                CRect rcPane;
                pStatusBar->GetItemRect( nPaneIdx, &rcPane );
                rcPane.top = rcClient.top;
                rcPane.bottom = rcClient.bottom;
                if( rcPane.IsRectEmpty() || (! dc.RectVisible( &rcPane ) ) )
                    continue;
                m_bmpStatusBkDark.DrawSkinParts(
                    dc.m_hDC,
                    rcPane,
                    m_rcStatusBkPadding,
                    CExtBitmap::__EDM_STRETCH
                    );
                continue;
            }
        }
    }
    return true;
}

John Kiernan Aug 16, 2006 - 3:09 PM

Excellent. Works great!
Thank you very much for your time.

John

John Kiernan Jun 14, 2006 - 2:02 PM

Excellent!
Thanks for you help!