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 » NcButtons_RemoveAll Collapse All
Subject Author Date
Offer Har Oct 26, 2006 - 10:12 PM

Dear support,

I have downloaded the 2.62 preview version, and checked this function.
I am happy to say that it works... i guess it either did not work well in 2.61+patch, or made a mistake ;-)

There is one small issue that you should look over:
This is from your sample code:

        if( pBarActiveInContainer == NULL // IF this BAR IS STAND ALONE DOCKED OR FLOATING
            || pBarActiveInContainer == pBarEventSource // IF THIS BAR IS SELECTED IN TABBED GROUP

What i see is as follows:
1) If the bar is floating alone, and i close it, pBarActiveInContainer == NULL, as you wrote
2) If the bar is tabbed, then pBarActiveInContainer is not pBarEventSource. What i get is that pBarEventSource is of type CExtDynaTabControlBar, and pBarActiveInContainer is the bar whose tab is the selected one, thus, your second check is not correct, it should be pBarActiveInContainer != NULL instead.

Please enlighten me if I’m wrong...

Regards,
Offer.

Technical Support Oct 27, 2006 - 6:19 AM

We agree with you and the final version uses pBarActiveInContainer != NULL. Thank you, Offer.

Offer Har Oct 27, 2006 - 9:35 AM

Hi,

I have explored some more this tabbed problem.
I have found out that when tabbed, the NcButtons_RemoveAll is called for EACH tabbed bar. If one of tabbed return true, and another returns false (that is, go to the default NcButtons_RemoveAll), the tabbed bars is closed.

This is a problem. What should be done is either that only the bars that call the default NcButtons_RemoveAll will be closed, or that none of them will be closed. The main concept is to PREVENT the closure of a docked/tabbed bar, so the closure should be on the restrictive side, and to not allow the closure if not all docked bars agree to the closure.

Best Regards,
Offer

Suhai Gyorgy Oct 27, 2006 - 10:38 AM

Just a guess: check if you set CExtControlBar::g_bCloseOnlyOneBarInTabGroup to true, maybe then it will work as expected.

Offer Har Oct 27, 2006 - 8:52 PM

Thanks for the suggestion, but the bug is still there - it’s even clearer now that there is a bug, because the bar that was not supposed to get closed got closed...

Support - please check the scenario with the flag g_bCloseOnlyOneBarInTabGroup set to true, you’ll see that the problem is real and there - a docked bar that returns true in the NcButtons_RemoveAll function, and does not call the base implementation is getting closed if tabbed, even if this flag is set to true (when only the active docked bar is to be closed, and although it was not supposed to get closed, it does)

Please try to solve this for the next version.
Thanks.

Offer Har Oct 27, 2006 - 9:16 AM

Dear Support,

This feature is still not working well. Now, when the docked bar is in a tabbed bar, the function NcButtons_RemoveAll is called, but even if i return true in it, the docked bar is closed.
Please verify, and fix for the 2.62 release.

Regards,
Offer

Technical Support Oct 30, 2006 - 12:04 PM

First of all, we can guess you are talking about the CExtControlBar::NcButtons_HandleClick() method, not about the CExtControlBar::NcButtons_Remove(). The CExtControlBar::NcButtons_HandleClick() method is really invoked for all bars inside the tabbed container or dynamic row/column container. This provides all the bars with information about which bar was clicked and where. This works regardless of if the "X" button closes one control bar or the group of control bars. This allows you to prevent a particular control bar or a group of bars from being closed depending on some conditions in other control bars.

Offer Har Oct 31, 2006 - 11:55 AM

You are correct, the function NcButtons_HandleClick.

Please try to reproduce the bug, in a tabbed bar, even if i don’t let the default NcButtons_HandleClick to be called, the tabbed control bar is closed.

When i set the flag g_bCloseOnlyOneBarInTabGroup , it is supposed to close only the active bar, and even if don’t let the default NcButtons_HandleClick to be called, the tabbed bar is closed.
If the flag g_bCloseOnlyOneBarInTabGroup is false, the whole tabbed container is closed, no matter if one of the tabbed bars do not call the default NcButtons_HandleClick.

Technical Support Nov 2, 2006 - 9:02 AM

Thank you for reporting this problem. We fixed it and you can download the latest source code from our ftp site.