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 » GridCell tooltip Collapse All
Subject Author Date
Ulrich Heinicke Jul 3, 2008 - 8:36 AM

Do you have an example how to use OnInitAdvancedTip to display custom tooltips for a grid cell?


Ulrich

Technical Support Jul 8, 2008 - 8:24 AM

Both tooltips and expanding windows require mouse hover events for grid cells. By default grid cells do not receive mouse hover notifications. To turn them on for inner and/or outer/header grid cells, you should invoke the grid’s <code.HoverEventsSet()</code> method or apply the __EGBS_EX_HVI_EVENT_CELLS and/or __EGBS_EX_HVO_EVENT_CELLS styles using the SiwModifyStyleEx() method.


Technical Support Jul 4, 2008 - 1:16 PM

Your overridden method should be similar to the original one. But it can invoke methods of the CExtPopupMenuTipWnd object for changing tooltip window settings. It can make it balloon like for instance. Which kind of tooltips you are looking for?

Ulrich Heinicke Jul 7, 2008 - 7:12 AM

Hi,


i overwrite OnInitAdvancedToolTip with the following code:


 



bool CIBHGridCellPicture::OnInitAdvancedTip(CExtGridWnd & wndGrid, const CExtGridHitTestInfo & htInfo,
                                            CExtPopupMenuTipWnd & _ATTW, RECT & rcArea)
{
#ifdef _TTRACE
    CString strTrace;
    TTrace::Debug()->Send("CIBHGridCellPicture::OnInitAdvancedTip");
#endif
    strToolTipText = _T("TEST");
    if (strToolTipText.GetLength()>0)
    {
        _ATTW.SetText(strToolTipText);
        _ATTW.SetTipStyle(CExtPopupMenuTipWnd::__ETS_RECTANGLE_NO_ICON);
    }
    return true;
}



in my implementation i used:



    CIBHGridCellPicture * pCellPicture;
    pCellPicture = STATIC_DOWNCAST(CIBHGridCellPicture, 
        GridCellGet(2L, WRESULT_BENDING, 0, 0, RUNTIME_CLASS(CIBHGridCellPicture)));


but im my trace window i didn’t find the call of OnInitAdvancedTip.


Please tell me what’s wrong.


Ulrich


 


 

Technical Support Jul 7, 2008 - 12:40 PM

There are two conflicting grid features: grid cell tooltips and grid cell expanding. These features are configured for inner and outer grid cell areas independently of each other by applying a combination of the following styles using the CExtGridWnd::SiwModifyStyleEx() method:

__EGBS_EX_CELL_TOOLTIPS_OUTER_L
__EGBS_EX_CELL_TOOLTIPS_OUTER_R
__EGBS_EX_CELL_TOOLTIPS_OUTER_T
__EGBS_EX_CELL_TOOLTIPS_OUTER_B
__EGBS_EX_CELL_TOOLTIPS_INNER
__EGBS_EX_CELL_EXPANDING_OUTER_L
__EGBS_EX_CELL_EXPANDING_OUTER_R
__EGBS_EX_CELL_EXPANDING_OUTER_T
__EGBS_EX_CELL_EXPANDING_OUTER_B
__EGBS_EX_CELL_EXPANDING_INNER
A tooltip window is displayed near a grid cell. An expanding window covers the cell area completely to make the location of the text on the screen matching the text inside the grid cell. The cell expanding feature is of higher priority. So, if you applied the __EGBS_EX_CELL_TOOLTIPS_INNER style to make an inner data cell displaying a tooltip and also applied the __EGBS_EX_CELL_EXPANDING_INNER style at the same time, the expanding window will be displayed instead of tooltip.

Ulrich Heinicke Jul 8, 2008 - 5:44 AM

I define my grid with the following code:



    m_wndResultGrid.OuterRowCountTopSet(1);
    m_wndResultGrid.OuterRowHeightSet(true, 0L, 0);
    m_wndResultGrid.ColumnAdd(3, false);
    m_wndResultGrid.RowAdd(5, false);
    m_wndResultGrid.DefaultColumnWidthSet(90, false);
    m_wndResultGrid.SiwModifyStyle(
        __ESIS_STH_PIXEL
        |__ESIS_STV_ITEM
        |__EGBS_SFB_FULL_ROWS
        |__EGBS_GRIDLINES
        |__EGBS_NO_HIDE_SELECTION
        ,
        0,
        false
        );
    m_wndResultGrid.SiwModifyStyleEx(
        __EGBS_EX_CELL_TOOLTIPS_INNER
        | __EGBS_EX_CELL_EXPANDING_INNER
        | __EGWS_EX_PM_COLORS
        | __EGBS_EX_CORNER_AREAS_3D
        ,
        0,
        false
        );
    m_wndResultGrid.EnableTooltips(true, true, true, true, true);
    m_wndResultGrid.EnableExpanding(false, false, false, false, false);


but when i move the mouse over the text cell i get the following:



over the picture cell i get nothing. But i want to have an tooltip to explain the picture.

Technical Support Jul 8, 2008 - 8:23 AM

The expanding windows are always displayed only if there is no space to display the cell content in the current cell rectangle. Tooltip windows always contain some helper/additional information which is not intersected with the grid cell area. It looks like you don’t need tooltips nor expanding windows. It’s possible to display some tooltip like window instead of built-in tooltips. You can simply override the CExtGridBaseWnd::OnGbwTooltip() virtual method and display what you need. In general, you can use the CExtContentExpandWnd window to display any custom drawn content in popup window over the grid control.

Ulrich Heinicke Jul 8, 2008 - 8:56 AM

Do you have an small example how to use CExtContentExpandWnd to draw an popup window over the grid control?


Thanks

Technical Support Jul 8, 2008 - 12:37 PM

We coded the following simplest possible sample application for you:

CustomDrawnContentExpandWindowInGrid

It uses a built-in content expand window of the grid control. But it makes the grid display it for all the inner data cells regardles of if the cell data is completely visible. Besides it repaints the content expand window surface. We think you should copy the CMyGridWnd class into your project and change the required size of the content expand window and put your painting code into it.

Ulrich Heinicke Jul 9, 2008 - 5:43 AM

Thanks, that’s what i need. The only thing now missing ist ShellList and ShellTree from the next version. If you have the source for me to intergrate it now please send it to me.


Ulrich

Technical Support Jul 9, 2008 - 12:41 PM

We would like to ask you to write a very short e-mail to the support mail box so we can reply with the shell controls download information.

Ulrich Heinicke Jul 8, 2008 - 5:46 AM

when i changed to:



    m_wndResultGrid.SiwModifyStyleEx(
        __EGBS_EX_CELL_TOOLTIPS_INNER
//        | __EGBS_EX_CELL_EXPANDING_INNER
        | __EGWS_EX_PM_COLORS
        | __EGBS_EX_CORNER_AREAS_3D
        ,
        0,
        false
        );


nothing will be changed (no tooltip over the picture).

Ulrich Heinicke Jul 7, 2008 - 8:56 AM

I forget the following:



class CIBHGridCellPicture : public CExtGridCellPicture
{
public:
    CIBHGridCellPicture();
    ~CIBHGridCellPicture();

    void SetToolTipText(CString strText);

protected:
    CString    strToolTipText;

    /// Überschreibung für Tooltip
    virtual bool OnInitAdvancedTip(CExtGridWnd & wndGrid, const CExtGridHitTestInfo & htInfo,
        CExtPopupMenuTipWnd & _ATTW, RECT & rcArea);
};