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.
Subject |
Author |
Date |
|
Debabrata Mukherjee
|
Sep 19, 2007 - 8:56 AM
|
When I close the controlbar using the "X" (close) button, then by default it opens up... on ShowControlBar(SW_SHOW). This I dont want, I want the user to open it from a menu option only if the "X" has been pressed as that means that the user doesnt want the controlbar at all and not just hide it to resurface again....
Can I handle the "X" of a CExtToolControlBar. Please suggest as its very urgent.
|
|
Debabrata Mukherjee
|
Sep 20, 2007 - 8:34 AM
|
Hi,
This is my current implementation. I want to call the OnNcAreaClicked() method when i close the control bar.
class CSaControlToolBar : public CExtToolControlBar { public: // Construction CSaControlToolBar(); virtual void OnNcAreaButtonsReinitialize() { CExtToolControlBar::OnNcAreaButtonsReinitialize(); } virtual CExtBarNcAreaButtonClose OnNcAreaClicked() { AfxMessageBox("Hi"); return NULL; } }; Can you please help me regarding this.
|
|
Suhai Gyorgy
|
Sep 20, 2007 - 8:48 AM
|
This might work, though I didn’t try: class CSaControlToolBar : public CExtToolControlBar
{
class CSaBarNcAreaButtonClose : public CExtBarNcAreaButtonClose
{
public:
CSaBarNcAreaButtonClose(CExtControlBar * pBar) : CExtBarNcAreaButtonClose( pBar ) {}
virtual bool OnNcAreaClicked( CPoint point )
{
AfxMessageBox("Hi");
return CExtBarNcAreaButtonClose::OnNcAreaClicked(point);
}
}; // class CSaBarNcAreaButtonClose
virtual void OnNcAreaButtonsReinitialize()
{
ASSERT_VALID( this );
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CSaBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
}
}; // class CSaControlToolBar
|
|
Suhai Gyorgy
|
Sep 20, 2007 - 1:56 AM
|
|
|