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 » Grid and tooltip problem Collapse All
Subject Author Date
Offer Har Apr 10, 2008 - 5:14 AM

I have a grid, in which I set the background to be the same color as the dialog background of the there. I use the CExtPaintManagerOffice2007_Black theme, and  because of that, the cell text have to be white I query the color of the text line this:



    CWindowDC dcFake(NULL);
    COLORREF m_clrText =
        PmBridge_GetPM()->QueryObjectTextColor(
        dcFake,
        true,
        false,
        false,
        false,
        (CObject*)this
        );

This will give me white in black themes, and black in the others.


My problem is that when the text does not fit into the cell, the tool-tip is displayed. The tool-tip has a yellow background, so I get white on yellow... as you can imagine nothing is seen.


Is there a way to fix the tool-tip text color to be black? Where do I set the color of the toot-tip’s text?

Technical Support Apr 23, 2008 - 4:58 AM

The version is almost ready. Just needs some last touches.

Technical Support Apr 15, 2008 - 5:01 AM

The text and background colors of the content popup window displayed for a cell is inherited from a cell. All the painting procedures are invoked from the CExtGridCell::OnPaintExpandedContent() virtual method when the client area of the content popup window is being painted. Just take a look at this method and you will see that the text is painted in the CExtGridCell::OnPaintText() method, so the text color is the same as the color of the cell text.

If you need some different text colors, you can do the following:

a) Override CExtGridCell::OnPaintExpandedContent() and pass some dwHelperPaintFlags value to the OnPaintText() method call.

           OnPaintText(
                        rcItem,
                        wndGrid,
                        picd.m_dc,
                        htInfo.m_nVisibleColNo,
                        htInfo.m_nVisibleRowNo,
                        htInfo.m_nColNo,
                        htInfo.m_nRowNo,
                        htInfo.GetInnerOuterTypeOfColumn(),
                        htInfo.GetInnerOuterTypeOfRow(),
                        htInfo.m_rcExtra,
                        htInfo.m_rcItem,
                        rcVisibleRange,
                        htInfo.m_dwAreaFlags,
>>>>>>            0L //dwHelperPaintFlags   <<<<<<
                        );


b) Override CExtGridCell::OnQueryTextColor() virtual method. Check the dwHelperPaintFlags parameter in it and return any needed color.

Offer Har Apr 18, 2008 - 3:55 PM

It’s impossible to implement this solution, as I need to copy all the function, which uses some constant values you define in the ExtGridWnd.cpp file:



#define __EXT_EXPANDED_TEXT_GAP_X 2
#define __EXT_EXPANDED_TEXT_GAP_Y 2

In any case, this is rather a lot of work for something as simple as that - would it be possible that you will set a special value in dwHelperPaintFlags when the paint is coming from a tooltip paint call for next version - this is what I did now (changed the ExtGridWnd.cpp so that in the OnPaint call you mentioned above I pass a special value, in the function CExtGridCell::OnPaintExpandedContent, and in my cell’s OnQueryTextColor I look for that special value as you wrote in (b)


Let me know if you think this is not a good idea.

Technical Support Apr 22, 2008 - 8:54 AM

We added a __EGCPF_EXPANDED_CONTENT value which is now passed to the OnQueryBackColor and OnPaintText methods when they paint the cell’s expanded content. You can either wait for the next version release or request the new code by email.

Offer Har Apr 22, 2008 - 8:57 AM

Thanks.


Any news when the next version is to be released?