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 » change CExtProgressWnd style Collapse All
Subject Author Date
Borremans Pierre Dec 12, 2009 - 11:10 PM

In my application i everride the CExtPaintManagerOffice2003. How to have CExtProgressWnd with office 2007 style ?

Technical Support Dec 14, 2009 - 9:29 AM

You should override the CExtPaintManager::PaintProgress() virtual method and copy the source code from the CExtPaintManagerOffice2007_Impl::PaintProgress() method. You will also need to add the following properties into your paint manager class:

   CExtBitmapCache
                        m_bmpProgressMainH, m_bmpProgressMainV,
                        m_bmpProgressBorderH, m_bmpProgressBorderV;
            CRect
                        m_rcProgressBarPartH,
                        m_rcProgressBarPartV,
                        m_rcProgressBackgroundPartH,
                        m_rcProgressBackgroundPartV,
                        m_rcProgressBarPaddingH,
                        m_rcProgressBarPaddingV,
                        m_rcProgressBackgroundPaddingH,
                        m_rcProgressBackgroundPaddingV,
                        m_rcProgressBorderPaddingH,
                        m_rcProgressBorderPaddingV;

The rectangles should be initialized in constructor:
   , m_rcProgressBarPartH( 0, 0, 92, 8 )
            , m_rcProgressBarPartV( 0, 92, 8, 182 )
            , m_rcProgressBackgroundPartH( 92, 0, 182, 8 )
            , m_rcProgressBackgroundPartV( 0, 0, 8, 92 )
            , m_rcProgressBarPaddingH( 1, 1, 10, 1 )
            , m_rcProgressBarPaddingV( 1, 10, 1, 1 )
            , m_rcProgressBackgroundPaddingH( 0, 0, 0, 0 )
            , m_rcProgressBackgroundPaddingV( 0, 0, 0, 0 )
            , m_rcProgressBorderPaddingH( 2, 2, 2, 2 )
            , m_rcProgressBorderPaddingV( 2, 2, 2, 2 )

The bitmaps also can be initialized in constructor:
   VERIFY(
                        m_bmpProgressMainH.LoadBMP_Resource(
                                    MAKEINTRESOURCE( IDB_EXT_2007_PROGRESS_MAIN )
                                    )
                        );
            VERIFY(
                        m_bmpProgressMainV.CreateRotated9xStack(
                                    m_bmpProgressMainH,
                                    270,
                                    1,
                                    m_bmpProgressMainH.GetSize().cx,
                                    m_bmpProgressMainH.GetSize().cy,
                                    true,
                                    true
                                    )
                        );
            VERIFY(
                        m_bmpProgressBorderH.LoadBMP_Resource(
                                    MAKEINTRESOURCE( IDB_EXT_2007_PROGRESS_BORDER )
                                    )
                        );
            VERIFY(
                        m_bmpProgressBorderV.CreateRotated9xStack(
                                    m_bmpProgressBorderH,
                                    270,
                                    1,
                                    m_bmpProgressBorderH.GetSize().cx,
                                    m_bmpProgressBorderH.GetSize().cy,
                                    true,
                                    true
                                    )
                        );


Borremans Pierre Dec 14, 2009 - 6:41 AM

I found a solution : override the function PaintProgress and it works.