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 General Discussion » Getting the hover event of button on CExtTabbedToolControlBarButtons. Collapse All
Subject Author Date
Seung Cheol Lee Jul 25, 2007 - 6:12 AM

Hi.
How to get the hover event of button on CExtTabbedToolControlBarButtons.

Seung Cheol Lee Jul 26, 2007 - 8:52 PM

I wonder if you can reply my question.
Perhaps is my question fault ?

Technical Support Jul 27, 2007 - 10:21 AM

We are sorry for the delay with this reply. You can do this in the following two steps.

1) Create a CExtBarButton-derived class, which implements a custom toolbar button. In this class override CExtBarButton::OnHover() to catch the event when the mouse pointer enters/leaves the button.

2) Replace default buttons in the tabbed toolbar with your custom buttons:

class CYourTabbedToolControlBarClass : public CExtTabbedToolControlBar
{
public:
      class LocalToolBar : public CExtTabbedToolControlBar::LocalNoReflectedToolBar
      {
      public:
            virtual CExtBarButton * OnCreateBarCommandBtn( UINT nCmdID, UINT nStyle = 0 )
            {
                  ASSERT_VALID( this );
                  CExtBarButton * pTBB = new CYourBarButtonClass( this, nCmdID, nStyle );
                  ASSERT_VALID( pTBB );
                  return pTBB;
            }
      };
public:
      virtual CExtToolControlBar * OnBarCreateObject()
      {
            ASSERT_VALID( this );
            CExtToolControlBar * pToolBar = NULL;
            try
            {
                  pToolBar = new LocalToolBar;
            }
            catch( CException * pException )
            {
                  ASSERT( FALSE );
                  pException->Delete();
                  pToolBar = NULL;
            }
            return pToolBar;
      }
};

Seung Cheol Lee Jul 27, 2007 - 8:38 PM

I really appreciate your help.