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 » CExtPopupTip and CExtGrid question Collapse All
Subject Author Date
tera tera Oct 28, 2008 - 1:24 AM

Hello.



I want to display the tool tip of the specific cell.

I made the following programming.

Is the program good in this?


 


void XXXGrid::CellToolTip( CExtSafeString strNewTipText , CPoint * pPntFocus )

{

    CExtGridCell *pCell = NULL;

 CPoint ptFocus ;


 ptFocus = FocusGet();


 CRect rc;

 GridCellRectsGet(

         1,

         ptFocus.y ,

         0,

         0,

         NULL,

         &rc

    );


 CRect rcExcludeArea;

 GetWindowRect( &rcExcludeArea );

 rc.left   += rcExcludeArea.left;

 rc.top    += rcExcludeArea.top;

 rc.right  += rcExcludeArea.left;

 rc.bottom += rcExcludeArea.top;


 SetCursorPos( rc.left + rc.Width() / 2  , rc.top + rc.Height() / 2 );


 CExtPopupMenuTipWnd & wndTip = GetTip();

 wndTip.SetText( LPCTSTR(strNewTipText) );

 wndTip.Hide();


 CWnd * pWnd = FromHandle( m_hWnd );

 wndTip.Show( pWnd, rc , true );

}


 

tera tera Nov 5, 2008 - 6:55 PM

Please answer it


 

Technical Support Nov 6, 2008 - 12:57 PM

Your code looks correct. Please check a return value from the GridCellRectsGet() method. If it returns false(), the grid cell is outside the displayed on screen cell range and you should not try to show the tooltip.