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 » Tooltip for cells Collapse All
Subject Author Date
Offer Har Apr 16, 2007 - 2:36 PM

Dear Support,

I would like to add a tool-tip with a text which is not the cell’s content, but a comment field of each cell (like in excel for example).

How can this be done? Please advise.

Regards,
Ron.

Offer Har Jul 19, 2007 - 4:45 PM

Dear Support,

Please find below a part from a thread regarding tooltip for cells - Is there any progress with this feature?

Regards,
Ron.

Author: Technical Support
Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 8:50 AM
This feature seems to be worth to be added to the library. Please give us some time so we can add it as a standard feature in one of the next versions.
Author: Offer Har
Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 8:55 AM
OK...

Will be waiting...

Regards,
Ron.
Author: Technical Support
Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 10:43 AM
The next version is being tested and will be released approximately within a week. So we will add it in the version that follows (within one, maximum two months).
Author: Offer Har
Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 11:19 AM
Great.

Will be waiting...

Technical Support Apr 17, 2007 - 12:46 PM

To set a custom tooltip text for the cell, you can override the CExtGridCell::OnInitToolTip() method in the cell class like as follows:

// DECLARATION

class CExtGridCellTooltip : public CExtGridCell
{
public:
      DECLARE_SERIAL( CExtGridCellTooltip );
      IMPLEMENT_ExtGridCell_Clone( CExtGridCellTooltip, CExtGridCell );
      CExtGridCellTooltip(
            CExtGridDataProvider * pDataProvider = NULL
            );

      // virtual methods
      virtual bool OnInitToolTip(
            CExtGridWnd & wndGrid,
            const CExtGridHitTestInfo & htInfo,
            CToolTipCtrl & wndToolTip,
            UINT nToolNo,
            const RECT & rcTool
            );

}; // class CExtGridCellTooltip


//IMPLEMENTATION

/////////////////////////////////////////////////////////////////////////////
// CExtGridCellTooltip

IMPLEMENT_SERIAL( CExtGridCellTooltip, CExtGridCell, VERSIONABLE_SCHEMA|1 );

CExtGridCellTooltip::CExtGridCellTooltip(
      CExtGridDataProvider * pDataProvider // = NULL
      )
      : CExtGridCell ( pDataProvider )
{
}

bool CExtGridCellTooltip::OnInitToolTip(
    CExtGridWnd & wndGrid,
    const CExtGridHitTestInfo & htInfo,
    CToolTipCtrl & wndToolTip,
    UINT nToolNo,
    const RECT & rcTool
    )
{
    ASSERT_VALID( this );
    ASSERT_VALID( (&wndGrid) );
    ASSERT( ! htInfo.IsHoverEmpty() );
    ASSERT( htInfo.IsValidRect() );
    htInfo;
bool bRetVal = false;
CExtSafeString strText( _T("Tooltip Text") );
    if( strText.GetLength() > 0 )
    {
        wndToolTip.AddTool(
            &wndGrid,
            (LPCTSTR)strText,
            &rcTool,
            nToolNo
            );
        bRetVal = true;
    }
    if( ! bRetVal )
    {
        wndToolTip.DelTool( &wndGrid, nToolNo );
        CWnd::CancelToolTips();
    } // if( ! bRetVal )
    return bRetVal;
}
Here is how you can use it:
CExtGridCellTooltip * pCellTooltip =
    STATIC_DOWNCAST(
        CExtGridCellTooltip,
        m_wndGrid.GridCellGet(
            4,
            nRowNo,
            0,
            0,
            RUNTIME_CLASS(CExtGridCellTooltip)
        )
);
Please note you should disable the content pop-up window for grid cells. Such a tooltip-like window shows the cell content for a cell which is partially visible
m_wndGrid.EnableTooltips(
            true,
            true,
            true,
            true,
            true
            );
m_wndGrid.EnableExpanding(
            false,
            false,
            false,
            false,
            false
            );

Offer Har Apr 17, 2007 - 1:02 PM

Few questions:
1) Will it obscure the cell, or can I control the location of the tool-tip (in excel it appears top-right of the cell)
2) I still want other cells to use the normal tool-tip when they are too long.
3) Can I use of the nice tooltips that are implemented in Prof-UIS and not the yellow square?

Thanks,
Ron.

Technical Support Apr 18, 2007 - 11:39 AM

You should not use the tooltip common control at all. The CExtContentExpandWnd class in Prof-UIS implements the popup window for several tasks:

1) Custom painted popup window for implementing the drag-n-dropped items such as grid/report-grid header cells.

2) Custom painted window for displaying the entire content of partially visible and hovered by mouse UI items such as grid cells, page captions in then page container or group captions in the toolbox.

3) Non rectangular window in form of red arrows and/or dots for highlighting drop target location such as position between header cells in grids.

Your control should have the CExtContentExpandWnd property, invoke its CExtContentExpandWnd::Activate() and CExtContentExpandWnd::Deactivate() methods and handle its CExtContentExpandWnd::g_nMsgPaintItemContent notification message for painting content of the content expand window. You will have entire control over location and appearance of this window.

Offer Har Apr 18, 2007 - 1:13 PM

Dear Support,

Thank you for the information.
Can you please explain how to add CExtContentExpandWnd to a cell?
Should I derive a cell type and add a member of that type?
How do I know when to activate the member etc.?

Regards,
Ron.

Technical Support Apr 19, 2007 - 5:56 AM

The content expand window is one for the entire grid and it is specified as the CExtGridWnd::m_wndContentExpand property. You should override the CExtGridWnd::OnGbwExpand() virtual method if you want to implement a custom content expand window. You can paint it by overriding CExtGridWnd::OnGbwPaintExpandedItemContent() or CExtGridCell:: OnPaintExpandedContent() (use these methods as an example of how you can paint it). Although the grid window positions the content expand window exactly over grid cell areas, you can position it anywhere you need. You will not need to track any mouse/keyboard events. The grid itself hides the content expand window when necessary (e.g. when the hovered cell changed, mouse wheel event, Windows active process changed). You really need only to reposition and, optionally, repaint the content expand window.

Offer Har Apr 19, 2007 - 7:37 AM

Dear Support,

I am still confused...
What i need is that when the mouse is over a specific cell (not all cells, but cells that have some extra data), a tool-tip or balloon box will appear to the right of the cell, or above the cell with this extra information.

Please advise how this can be achieved.

Thanks,
Ron.

Technical Support Apr 20, 2007 - 8:06 AM

It is understandable that you need an Excel-like tooltip for particular cells and this tooltip should display some info associated with these cells. At the same time, you want other cells to display the content expand window if the cell’s content does not fit the cell area (which is supported in Prof-UIS for all cells).

This dual functionality is not supported in Prof-UIS by default. So you should implement this yourself. This should not be difficult as we described above. If you want us to do this work for you, please contact our sales manager at sales@prof-uis.com.

Offer Har Apr 20, 2007 - 8:25 AM

Dear Support,

I am willing to drop the tool-tip for the popup, if there is no other choice...
Your explanations were a little to theoretical - what functions do I need to change, and what objects do I need to introduce?

Thanks,
Ron.

Technical Support Apr 20, 2007 - 8:34 AM

We would have provided such a sample if we had it. Unfortunately, we do not have a ready to use solution. So it is a custom project.

Offer Har Apr 20, 2007 - 8:41 AM

Dear Support,

Other grids I used had this feature in them, this is why i’m puzzled with the lack of this feature (for example syncfusion grid).

Can you please give me some guidelines as to how this can be implemented, how to catch the mouse entering a cell, leaving the cell etc. and what class implements the popup balloon in the library.

Best Regards,
Ron.

Technical Support Apr 20, 2007 - 8:50 AM

This feature seems to be worth to be added to the library. Please give us some time so we can add it as a standard feature in one of the next versions.

Offer Har Apr 20, 2007 - 8:55 AM

OK...

Will be waiting...

Regards,
Ron.

Technical Support Apr 20, 2007 - 10:43 AM

The next version is being tested and will be released approximately within a week. So we will add it in the version that follows (within one, maximum two months).

Offer Har Apr 20, 2007 - 11:19 AM

Great.

Will be waiting...