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 » 2.62 problems Collapse All
Subject Author Date
Offer Har Nov 7, 2006 - 9:28 AM

Dear support,

I have downloaded the version from the ftp site, but both bugs that you said were fixed, still are not solved:
1) Empty cells
2) Prevention of closing a docked bar when tabbed.

Please send me the correct version, or upload the correct version to the FTP site.

Regards,

Offer.

Technical Support Nov 7, 2006 - 12:31 PM

The CExtGridCell::Empty() is fully tested and should cause no problems. Just in case, please download the source code again. There is another way to prevent a control bar from being closed: you could override the CExtControlBar::_ClosingIsEnabled() internal virtual method and simply return false in it.

Offer Har Nov 9, 2006 - 5:06 AM

Before I go and change all my code - will this function be helpful in Tabbed docked bars as well?
It seems that it’s hard to fix this problem, so i would like to know if it works... maybe a sample problem would help.

Technical Support Nov 9, 2006 - 11:48 AM

The CExtControlBar::_ClosingIsEnabled() method should be overridden only in your control bar classes. This method disables any kind of closing.

Offer Har Nov 9, 2006 - 2:45 PM

Dear support,

This solution is not working well:

1) In Tabbed bars:
What this is doing is removing the ’X’ button.
This is the scenario i have: Bar1 & Bar2, both tabbed.
If Bar1 return false in _ClosingIsEnabled the ’X’ is gone, no matter if Bar1 or Bar2 are selected to be the active tab.

2) Redraw problem:
Until the NC area requires a redraw (like moving the mouse over), the NC area is not redrawn, so the ’X’ is not visible or vise versa.

Please let me know when you intend to fix these issues, as we need this feature very badly.

Technical Support Nov 10, 2006 - 11:10 AM

We provided you with several solutions to preventing control bars from being closed. Because all of them do not meet your requirements, we would like to ask you to provide the detailed description of the features you want to see in control bars, their caption buttons and activation commands.

Offer Har Nov 10, 2006 - 11:19 AM

The problem is that none of your solution are fully working.

All I need is to prevent a bar from being closed when the bar is not allowed to be closed.

I don’t care how, if the button is shown, enabled/disabled etc.
All I want is that if the user is about to close a bar that i don’t want him to close, the bar will not be closed, and at the same time all other bars will act normaly.

The solution you provided be all work until it comes to the tabbed docking bars.
Please review - almost all my problems are when the docking bars are tabbed, and then either you cannot close all the tabbed bars,
even if the one that I want the prevent the closing is not the active one, or you can close the active tabbed bar even if I prevent that bar from being closed.

If you still have any questions - do not hesitate to ask.

Technical Support Nov 14, 2006 - 8:45 AM

Please follow these steps to make the control bars that can be closed:

1) Update the CExtDynControlBar::NcButtons_HandleClick() method’s source code in the ExtDockBar.cpp file:

bool CExtDynControlBar::NcButtons_HandleClick(
    CExtBarNcAreaButton * pNcAreaButton,
    CPoint point,
    CExtControlBar * pBarEventSource,
    CExtControlBar * pBarActiveInContainer
    )
{
    ASSERT_VALID( this );
    ASSERT_VALID( pNcAreaButton );
    ASSERT_VALID( pBarEventSource );
#if (defined _DEBUG)
    if( pBarActiveInContainer != NULL )
    {
        ASSERT_VALID( pBarActiveInContainer );
    }
#endif
bool bRetVal = false;
    ASSERT_VALID( m_pWndDynDocker );
INT nBar, nCount = (INT)m_pWndDynDocker->m_arrBars.GetSize();
    for( nBar = 0; nBar < nCount; nBar++ )
    {
        CControlBar * pBar = (CControlBar *)
            m_pWndDynDocker->m_arrBars[nBar];
        if( pBar == NULL )
            continue;
        if( __PLACEHODLER_BAR_PTR(pBar) )
            continue;
        CExtControlBar * pExtBar =
            DYNAMIC_DOWNCAST( CExtControlBar, pBar );
        if( pExtBar == NULL )
            continue;
        if( pExtBar->NcButtons_HandleClick(
                pNcAreaButton,
                point,
                pBarEventSource,
                pBarActiveInContainer
                )
            )
            bRetVal = true;
    }
    if( ! bRetVal )
    {
        if( ! CExtControlBar::NcButtons_HandleClick(
                pNcAreaButton,
                point,
                pBarEventSource,
                pBarActiveInContainer
                )
            )
            bRetVal = false;
    }
    return bRetVal;
}
2) Put this code somewhere at beginning of the the MainFrm.h file of the SDI sample application:
#if (!defined __EXT_CONTROLBAR_TABBED_FEATURES_H)
    #include <../Src/ExtControlBarTabbedFeatures.h>
#endif
 
class CMyControlBar : public CExtControlBar
{
public:
    DECLARE_DYNAMIC( CMyControlBar );
    bool m_bDisableClosingMode:1;
    CMyControlBar()
        : m_bDisableClosingMode( true )
    {
    }
    virtual bool NcButtons_HandleClick(
        CExtBarNcAreaButton * pNcAreaButton,
        CPoint point,
        CExtControlBar * pBarEventSource,
        CExtControlBar * pBarActiveInContainer
        )
    {
        pNcAreaButton;
        point;
        pBarEventSource;
        pBarActiveInContainer;
        if( m_bDisableClosingMode )
        {
            if( pBarActiveInContainer == NULL )
                return true;
            CExtDynTabControlBar * pTabBar = _GetNearestTabbedContainer();
            if( pTabBar == NULL || IsCloseOnlyOneBarInTabGroup() )
                return true;
            ASSERT_VALID( pTabBar->m_pWndDynDocker );
            int nCount = (int)pTabBar->m_pWndDynDocker->m_arrBars.GetSize();
            for( int nBar = 0; nBar < nCount; nBar++ )
            {
                CControlBar * pBar = (CControlBar *)
                    pTabBar->m_pWndDynDocker->m_arrBars[nBar];
                if( pBar == NULL )
                    continue;
                if( __PLACEHODLER_BAR_PTR(pBar) )
                    continue;
                if( pBar == this )
                    continue;
                CExtControlBar * pExtBar =
                    DYNAMIC_DOWNCAST( CExtControlBar, pBar );
                if( pExtBar != NULL )
                {
                    CMyControlBar * pOtherMyControlBar =
                        DYNAMIC_DOWNCAST( CMyControlBar, pExtBar );
                    if(      pOtherMyControlBar == NULL
                        ||  ( ! pOtherMyControlBar->m_bDisableClosingMode )
                        )
                        pExtBar->OnShowControlBarChain(
                            false,
                            true,
                            false
                            );
                }
                else
                    m_pDockSite->ShowControlBar(
                        pBar,
                        FALSE,
                        true
                        );
            }
            pTabBar->_DisplayingSet( false );
            CFrameWnd * pFrame = GetParentFrame();
            pFrame->RecalcLayout();
            return true;
        }
        return false;
    }
};
3) Put the following line at beginning of the the MainFrm.cpp file of the SDI sample:
IMPLEMENT_DYNAMIC( CMyControlBar, CExtControlBar );
4) Use the CMyControlBar class instead of the CExtControlBar class for some of control bars in the CMainFrame class of the SDI sample. The use will not be able to close these CMyControlBar windows.

5) Compile both Prof-UIS and the SDI. run this sample, and let us know if it is what you are looking for?

Offer Har Nov 14, 2006 - 11:12 AM

Dear support.

Pleas add this at the end of OnCreate:

    // RON ADDITION:

    CExtControlBar::g_bCloseOnlyOneBarInTabGroup = true;

    m_wndResizableBar0.m_bDisableClosingMode = false;
    m_wndResizableBar1.m_bDisableClosingMode = false;

Now do this:

Place Bar0 & Bar1 tabbed:
If Bar0 is active, and you press the ’X’, Bar0 will be closed, and Bar1 will remain open.
Now, add Bar2 to Bar1, so that you’ll have Bar1 & Bar2 tabbed.
In this two bars, no matter what tab is active, you cannot close the bars, even though Bar1 is closable.

This is the bug, I must say that it behaves much better now with the new changes to CExtDynControlBar::NcButtons_HandleClick, but this bug is still there.

Thanks,
Ron & Offer

Offer Har Nov 20, 2006 - 1:28 PM

Dear Support,

Any news? did you manage to re-produce the problem?

Thanks.

Technical Support Nov 23, 2006 - 11:43 AM

Thank you for reporting this bug. Please update the source code for the CExtDynControlBar::NcButtons_HandleClick() method in the ExtDockBar.cpp file:

bool CExtDynControlBar::NcButtons_HandleClick(
    CExtBarNcAreaButton * pNcAreaButton,
    CPoint point,
    CExtControlBar * pBarEventSource,
    CExtControlBar * pBarActiveInContainer
    )
{
    ASSERT_VALID( this );
    ASSERT_VALID( pNcAreaButton );
    ASSERT_VALID( pBarEventSource );
#if (defined _DEBUG)
    if( pBarActiveInContainer != NULL )
    {
        ASSERT_VALID( pBarActiveInContainer );
    }
#endif
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
CExtControlBar * pActiveInTabbedBar = NULL;
CExtDynTabControlBar * pTabbedBar = NULL;
    if( CExtControlBar::g_bCloseOnlyOneBarInTabGroup )
    {
        pTabbedBar =
            DYNAMIC_DOWNCAST( CExtDynTabControlBar, this );
        if( pTabbedBar != NULL )
        {
            LONG nTabSel = pTabbedBar->GetSwitcherSelection();
            if( nTabSel >= 0 )
                pActiveInTabbedBar = pTabbedBar->GetBarAt( nTabSel, true );
        }
    }
#endif
bool bRetVal = false;
    ASSERT_VALID( m_pWndDynDocker );
INT nBar, nCount = (INT)m_pWndDynDocker->m_arrBars.GetSize();
    for( nBar = 0; nBar < nCount; nBar++ )
    {
        CControlBar * pBar = (CControlBar *)
            m_pWndDynDocker->m_arrBars[nBar];
        if( pBar == NULL )
            continue;
        if( __PLACEHODLER_BAR_PTR(pBar) )
            continue;
        CExtControlBar * pExtBar =
            DYNAMIC_DOWNCAST( CExtControlBar, pBar );
        if( pExtBar == NULL )
            continue;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
        if( CExtControlBar::g_bCloseOnlyOneBarInTabGroup && pTabbedBar != NULL )
        {
            if( pExtBar != pActiveInTabbedBar )
                continue;
        }
#endif
        if( pExtBar->NcButtons_HandleClick(
                pNcAreaButton,
                point,
                pBarEventSource,
                pBarActiveInContainer
                )
            )
            bRetVal = true;
    }
    if( ! bRetVal )
    {
        if( ! CExtControlBar::NcButtons_HandleClick(
                pNcAreaButton,
                point,
                pBarEventSource,
                pBarActiveInContainer
                )
            )
            bRetVal = false;
    }
    return bRetVal;
}

Offer Har Nov 27, 2006 - 2:23 PM

HALELUYA!

It works...
I think that we can finally close this enable/disable bar close issue...

Offer Har Nov 9, 2006 - 5:04 AM

Dear Support.

I am sorry to say that Empty does not work for all cell types.
I tried it for 2 so far, and got 50% fail (or success...):

1) For CExtGridCellUpDown what I got is 0 in the cell, and not an empty cell - fail.
2) For CExtGridCellColor i got a ’?’ in the cell - success.

Technical Support Nov 10, 2006 - 11:43 AM

We cannot confirm that the Empty feature is not working. We used the following code for testing the CExtGridCellUpDown cell.

 CExtGridCellUpDown * pCellUpDown1 =
  STATIC_DOWNCAST(
   CExtGridCellUpDown,
   m_wndGrid.GridCellGet(
    nColNo,
    nRowNo,
    0,
    0,
    RUNTIME_CLASS(CExtGridCellUpDown)
    )
   );
 pCellUpDown1->_VariantAssign( 123.00, VT_R8 );
 pCellUpDown1->Empty();
Please make sure that you do not assign any values to the CExtGridCellUpDown cell after invoking Empty() because otherwise the Empty style will be removed.

We can even make all the cells empty on the Grid page in the ProfUIS_Controls sample and send this updated sample to you so you can make certain that the Empty feature works for all the cells.

Offer Har Nov 10, 2006 - 11:51 AM

My cell is in a property gird.

The initialization of the cell in the c’tor is as follows:

    CExtGridCellUpDown* pValue =
        STATIC_DOWNCAST(CExtGridCellUpDown, ValueActiveGetByRTC(RUNTIME_CLASS(CExtGridCellUpDown)));

    pValue->ModifyStyle(0, __EGCS_TA_HORZ_MASK);
    pValue->ModifyStyle(__EGCS_TA_HORZ_LEFT);
    pValue->_VariantAssign(nSize, VT_I4);

    ValueDefaultFromActive();



To clear the cell have a function called elsewhere with out line:

    ValueActiveGet()->Empty();

If you don’t see any problem with this, send me a working example, i will try to find what is going wrong.

Technical Support Nov 15, 2006 - 1:08 PM

To fix the problem, please modify the following method in this way:

void CExtGridCellVariant::Assign( const CExtGridCell & other )

{

                ASSERT_VALID( this );

                CExtGridCellEx::Assign( other );

bool bEmpty = IsEmpty();

                if( other.IsKindOf( RUNTIME_CLASS(CExtGridCellVariant) ) )

                {

                                _VariantAssign( 

                                                static_cast < const CExtGridCellVariant & > ( other )

                                                );

                                if( bEmpty )

                                                ModifyStyleEx( __EGCS_EX_EMPTY, 0 );

                                return;

                } // if( other.IsKindOf( RUNTIME_CLASS(CExtGridCellVariant) ) )

                _InitM();

                _VariantInit();

LPCTSTR strTextBuffer = LPCTSTR( other.GetTextBuffer() );

                if( strTextBuffer != NULL )

                {

                                _VariantAssign( strTextBuffer );

                                ASSERT( vt == VT_BSTR );

                                if( bEmpty )

                                                ModifyStyleEx( __EGCS_EX_EMPTY, 0 );

                                return;

                } // if( strTextBuffer != NULL )

CExtSafeString strCopy;

                other.TextGet( strCopy );

                if( strCopy.IsEmpty() )

                                return;

                strTextBuffer = LPCTSTR( strCopy );

                ASSERT( strTextBuffer != NULL );

                _VariantAssign( strTextBuffer );

                ASSERT( vt == VT_BSTR );

                if( bEmpty )

                                ModifyStyleEx( __EGCS_EX_EMPTY, 0 );

}


Offer Har Nov 15, 2006 - 1:20 PM

Thanks, it works!

Nitesh Singh Nov 7, 2006 - 11:20 PM

sorry this is off topic question... I actually want the ftp site address..... thanks

Technical Support Nov 8, 2006 - 8:43 AM

We sent this information to your e-mail box.