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 » The Styles of the borders in CExtDynamicControlBar Collapse All
Subject Author Date
Chun Pong Lau Oct 12, 2006 - 8:13 PM

Dear support team,

Is there any way to modify the styles (e.g. thickness, color) of the border line in CExtDynamicControlBar?

Thanks in advance.

Alan

Technical Support Oct 13, 2006 - 8:26 AM

Customized non client areas of control bars are demonstrated in the TabbedBars sample. The CMainFrame::OnMsgUseCustomNcArea() method in this sample handles the CExtControlBar::g_nMsgCustomNcAreaQuery registered Windows message which is designed both for recomputing and repainting the non client area of resizable control bars.

Chun Pong Lau Oct 14, 2006 - 6:15 AM

I did the following but the debugger never runs into the modified function

In CMainFrame.h,

afx_msg LRESULT OnMsgUseCustomNcArea( WPARAM wParam, LPARAM lParam );

In CMainFrame.cpp,

BEGIN_MESSAGE_MAP( CMainFrame, CFrameWnd )
    ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgCustomNcAreaQuery,    OnMsgUseCustomNcArea)
END_MESSAGE_MAP()

LRESULT CMainFrame::OnMsgUseCustomNcArea( WPARAM wParam, LPARAM lParam ){
    int i = 0; // ******* the programe never reaches this line******
    return 0;
}

Please advice. Thanks a lot.

Regards,
Alan

Technical Support Oct 16, 2006 - 10:36 AM

Please also set the CExtControlBar::g_bUseCustomNcArea global variable to true. This is needed to tell all the CExtControlBar windows to start sending the CExtControlBar::g_nMsgCustomNcAreaQuery message and let your code affect the non-client area of any control bar.

Chun Pong Lau Oct 16, 2006 - 3:32 PM

Thanks for your response. I can go to CExtControlBar::g_nMsgCustomNcAreaQuery() now. However, actually what I would like is simply to remove the border lines of a CExtDynamicControlBar. Can add code inside g_nMsgCustomNcAreaQuery() help to achieve this purpose?

On the other hand, I attempted to let CExtControlBar::DoPaintNC( CDC * pDC ) draw nothing but its border lines are still present (in white without any style makeup though).

Is there any way to remove the border lines of a CExtDynamicControlBar like a ribbon bar /page does? Please help. Thanks a lot.

Alan

Technical Support Oct 17, 2006 - 11:09 AM

The message handler for the CExtControlBar::g_nMsgCustomNcAreaQuery registered Windows message should look like:

LRESULT CMainFrame::OnMsgUseCustomNcArea( WPARAM wParam, LPARAM lParam )
{
    ASSERT_VALID( this );
    lParam;
CExtControlBar::CUSTOM_NC_AREA_QUERY_DATA * pCNAQD =
        CExtControlBar::CUSTOM_NC_AREA_QUERY_DATA::FromWPARAM( wParam );
    ASSERT( pCNAQD != NULL );
    ASSERT_VALID( pCNAQD->m_pBar );
    if( pCNAQD->m_pBar->IsFixedMode() )
        return 0;
    if( pCNAQD->m_hDcDraw != NULL )
    { // if rendering query
        pCNAQD->m_bQueryHandled = false;
    } // if rendering query
    else
    { // if metric update query
        pCNAQD->m_bQueryHandled = true;
        pCNAQD->m_pBar->_SeparatorWidthSet( 0 );
        pCNAQD->m_pBar->_SeparatorHeightSet( 0 );
    } // if metric update query
    return 0;
}
Please also update the source code for the CExtControlBar::_SeparatorHeightSet() method in the .../Prof-UIS/Src/ExtControlBar.cpp file to fix a small assertion bug:
void CExtControlBar::_SeparatorHeightSet( INT nSeparatorHeight )
{
    ASSERT_VALID( this );
    ASSERT( nSeparatorHeight >= 0 ); /* previously in 2.60 this line was ASSERT( nSeparatorHeight > 0 ); */
    m_nSeparatorHeight = nSeparatorHeight;
}