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 » Dock bar close event problem Collapse All
Subject Author Date
Offer Har Sep 13, 2006 - 10:05 AM

Dear Support,

I have followed the description in the FAQ:

How to handle events from caption buttons in resizable control bars?

And captured successfully the close button of my docked bar, as i need to know when the bar is being closed to do some other operations.

This however, does not work when the dock bar is tabbed with other bars. In this case my close button is not called, so i don’t know that my bar is close.

Please advise on how to capture the event of my bar being closed.

Regards,

Offer

Technical Support Sep 14, 2006 - 10:12 AM

The tabbed bar group is a dynamically created instance of the CExtDynTabControlBar class (or CExtDynamicTabbedControlBar class if you use dynamic control bars controlled by the CExtDynamicBarSite class). You can use your CExtDynTabControlBar-derived class (or your CExtDynamicTabbedControlBar-derived class) to implement the same custom caption button as that in your CExtControlBar-derived class. What you need to do is to handle the CExtControlBar::g_nMsgCreateTabbedBar registered windows message in your main frame window:

class C_YOUR_DynTabControlBar : public CExtDynTabControlBar
{
    . . .
};
 
ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgCreateTabbedBar, OnMsgCreateTabbedBar )
 
LRESULT CMainFrame::OnMsgCreateTabbedBar( WPARAM wParam, LPARAM lParam )
{
    lParam;
CExtDynTabControlBar ** ppBar = (CExtDynTabControlBar **)wParam;
    (*ppBar) = new C_YOUR_DynTabControlBar;
    return 0L;
}

Offer Har Sep 14, 2006 - 10:17 AM

Isn’t there a simpler way of knowing when a bar si closed?
I have to write a lot of code for a simple issue.

All i need is to know that my bar is closed, and then to destroy the bar and the dialog in it.

Please advise on how to perform that task.

Regards,

Offer

Technical Support Sep 16, 2006 - 10:39 AM

There is no simpler way than that available at the moment. We have not coded a virtual method for handling simple button clicks in the CExtControlBar class because we assume buttons may perform different tasks and have various behaviors.

Offer Har Sep 17, 2006 - 8:28 PM

Your solution is an over-kill:
1) I need to change code in the CMainFrm
2) I need to derive a new class.
3) I need to check somehow if the closed bar is the one i’m looking for.

All i need is to know when my bar is closed.... there must be a simpler way.

Technical Support Sep 19, 2006 - 7:11 AM

We agree that handling a caption button is a more complicated than you were expecting. We can simplify this by adding virtual methods to the CExtControlBar class. Would it be a suitable solution?

Erick NUWENDAM Sep 30, 2006 - 10:32 AM

Dear Support,
I was searching also a solution to capture this event because I need to perform soe other actions also.
This virtual function is what I need and I would be intersted to receive this modification as soon as it
is available.

Regards,

Liviu

Technical Support Oct 24, 2006 - 5:30 AM

We have already implemented a set of virtual functions in the CExtControlBar class, which allow you to control caption buttons without having to create a separate class for each button. Please contact us for the update.

Offer Har Sep 19, 2006 - 1:00 PM

That’s exactly what i miss...
It wouldbe great to have someting like OnClose in the CExtConrolBar.