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 » How can I change the color of floating docking bar. Collapse All
Subject Author Date
se hui Park Mar 22, 2010 - 12:10 AM

I’m trying to change the gripper color of floating docking bar.

When I override OnMsgUseCustomNcArea fuction, it can be changed in Docked state.

but in floating state It can not.

How can I change the color?

Technical Support Mar 22, 2010 - 11:33 AM

Floating control bars are in fact implemented as CExtMiniDockFrameWnd palette windows control bars inside. The floating palette caption is really part of the CExtMiniDockFrameWnd window. So, first of all you should code your own CExtMiniDockFrameWnd-derived class. Here is the basic example of how to code it:

#include "../Src/ExtMiniDockFrameWnd.h"

class CMyFloatingMiniDockFrameWnd : public CExtMiniDockFrameWnd
{
public:
            DECLARE_DYNCREATE( CMyFloatingMiniDockFrameWnd );
            virtual void RenderNC( CDC & dc ); 
};

IMPLEMENT_DYNCREATE( CMyFloatingMiniDockFrameWnd, CExtMiniDockFrameWnd );

void CMyFloatingMiniDockFrameWnd::RenderNC( CDC & dc )
{
            ASSERT_VALID( this );
            ASSERT( dc.GetSafeHdc() != NULL );
. . . . .
}

Your CMyFloatingMiniDockFrameWnd::RenderNC() virtual method implementation should have the source code simplar to the CExtMiniDockFrameWnd::RenderNC() method. But it should paint different caption background.
Please take a look at the following part of the CExtMiniDockFrameWnd::RenderNC() method:
               CExtPaintManager::PAINTGRIPPERDATA _pgd(
                                    pFlashingBar, // pSingleVisbleFlatingBar
                                    rcCapt,
                                    rcText,
                                    bActive,
                                    true,
                                    false,
                                    bExtBar,
                                    sCaption.IsEmpty() ? LPCTSTR( NULL ) : sCaption,
                                    ( (g_ResourceManager->OnQueryLangLayout()&LAYOUT_RTL) != 0 ) ? true : false
                                    );
                        bool bDrawDefaultCaption = true, bFlashCaptionHighlightedState = false;
                        if( pFlashingBar->FlashCaptionIsInProgress( &bFlashCaptionHighlightedState ) )
                        {
                                    _pgd.m_bFlashCaptionHighlightedState = bFlashCaptionHighlightedState;
                                    _pgd.m_clrFlashCaptionText = pFlashingBar->m_clrFlashCaptionText;
                                    _pgd.m_clrFlashCaptionBackground = pFlashingBar->m_clrFlashCaptionBackground;
                                    if(         pFlashingBar->FlashCaption_DoPaintNC(
                                                            dc,
                                                            (LPVOID)(&_pgd)
                                                            )
                                                )
                                                bDrawDefaultCaption = false;
                        } // if( pFlashingBar->FlashCaptionIsInProgress( &bFlashCaptionHighlightedState ) )
                        if( bDrawDefaultCaption )
                        {
                                    PmBridge_GetPM()->PaintGripper( dc, _pgd );
                                    if( pExtBar != NULL )
                                                pExtBar->NcButtons_Paint( dc );
                        } // if( bDrawDefaultCaption )
It performs custom background painting if the if( pFlashingBar->FlashCaptionIsInProgress( &bFlashCaptionHighlightedState ) ) condition is true. This is implementation of the window caption flashing feature.
The second step is to make Prof-UIS using the CMyFloatingMiniDockFrameWnd windows instead of the CExtMiniDockFrameWnd windows. This can be done by invoking only one line of code before creating all the control bars in your main frame window:
   m_pFloatingFrameClass = RUNTIME_CLASS( CMyFloatingMiniDockFrameWnd );
Please note the CFrameWnd::m_pFloatingFrameClass property is protected and the line of code above should be invoked in the beginning of the CMainFrame::OnCreate() method.