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 » How to handle the right click event on the page of a CExtTabPageContainerwnd? Collapse All
Subject Author Date
Debabrata Mukherjee Oct 3, 2007 - 6:31 AM

Can you let me know the handler for this?

Technical Support Oct 16, 2007 - 12:42 PM

The CChildView window is the parent for the CYourTabWnd window. So you should invoke the following code in the OnTabWndClickedItem() method

GetParent()->SendMessage( . . .


Debabrata Mukherjee Oct 15, 2007 - 9:28 AM

class CChildView : public CExtTabPageContainerOneNoteWnd
{
     class CYourTabWnd : public CExtTabWnd
     {
protected:
virtual bool OnTabWndClickedItem(LONG nItemIndex,bool bButtonPressed,INT nMouseButton,UINT nMouseEventFlags)
{
bool bRet = CExtTabWnd::OnTabWndClickedItem(nItemIndex,bButtonPressed,nMouseButton,nMouseEventFlags);
            //CSaIsDoc * pDoc = (CSaIsDoc *)((CSaIsMainFrame*)GetParentFrame()->GetActiveDocument());
        if(nItemIndex > 2)
         {
if ( nMouseButton == MK_RBUTTON )
             {
                 //GetPresentationView()->SendMessage(WM_SAIS_SINK_TAB_RIGHT_CLICKED,0,nItemIndex);
                    //CChildView::GetMessageForPresentationView(nItemIndex);
}
            }
return bRet;
}

        

};
virtual CExtTabWnd * OnTabWndGetTabImpl()
{
return new CExtTWPC < CYourTabWnd >;
}
    
I have a query... I wanto send a message to the CSaIsPresentationView class which has an object as a member of CChildView . But in this nested declaration that you have suggested me, it seems difficult to do...

Please respond..Its very urgent.!

Technical Support Oct 3, 2007 - 1:08 PM

This method is required to make the tab page container use the CYourTabWnd control inside it instead of CExtTabWnd that is used by default. This is a very important method because tab item clicks are handled in the CYourTabWnd class.

Debabrata Mukherjee Oct 3, 2007 - 9:53 AM

virtual CExtTabWnd * OnTabWndGetTabImpl()
{
return new CExtTWPC < CYourTabWnd >;
}

Is this part required? If yes then what for

Suhai Gyorgy Oct 3, 2007 - 1:11 PM

Yes, it’s needed. Every CExtTabPageContainerWnd-derived object uses a built-in CExtTabWnd-derived object (the tabs with which users can switch between pages). OnTabWndClickedItem is method of CExtTabWnd class, so you have to override it in a CExtTabWnd-derived class. With the above OnTabWndGetTabImpl method you make your TabPageContainerWnd class use your TabWnd-derived object. If you don’t override it, the TabPageContainer will use the default tabwnd implementation, not yours.

Suhai Gyorgy Oct 3, 2007 - 9:28 AM

Use this class as your TabPageContainer. Change the base classes appropietly if you need Whidbey or any other type of tab:

class CYourTabPageContainerWnd : public CExtTabPageContainerWnd
{
	class CYourTabWnd : public CExtTabWnd
	{
	protected:
		virtual bool OnTabWndClickedItem(
			LONG nItemIndex,
			bool bButtonPressed,
			INT nMouseButton, // MK_... values
			UINT nMouseEventFlags
			)
		{
			bool bRet = CExtTabWnd::OnTabWndClickedItem( 
				nItemIndex,
				bButtonPressed,
				nMouseButton,
				nMouseEventFlags
				);
			if ( nMouseButton == MK_RBUTTON ) {
				// nItemIndex indicates which tab item is clicked
				// bButtonPressed is true for WM_LBUTTONDOWN and false for WM_LBUTTONUP
			}
			return bRet;
		}
	};
	virtual CExtTabWnd * OnTabWndGetTabImpl()
	{
		return new CExtTWPC < CYourTabWnd >;
	}
};
Check out Help for more information on OnTabWndClickedItem method.