Click here to Skip to main content
15,887,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an issue with a toolbar tooltip with the UI in right to left mode.

My toolbar shows correctly. The order of the icon are reversed, but the icons themselves aren't mirrored.
However, when I pass the mouse over the icons, the tooltip shows incorrect.
The image in the tooltip is mirrored, and the image shows on the left in the tooltip with the tooltip text on the right side.
What I expect is the icon not to be mirrored and displayed on the right side with the tooltip text on its left.

Right to left mode is set as follow.
SetProcessDefaultLayout (LAYOUT_RTL);


The UI interface is using this style.
CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_ObsidianBlack);


My application is using a class as follow.
class MyApp : public CWinAppEx


MyApp myApp;
CMFCToolTipInfo ttParams;

ttParams.m_bVislManagerTheme = TRUE;
myApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL, RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);


What I have tried:

I tried to inherit the CMFCToolTipCtrl class with my own, and then overload the
OnDrawIcon, OnDrawLabel
functions.


class MyToolTipCtrl : public CMFCToolTipCtrl

BOOL MyToolTipCtrl::OnDrawIcon(CDC* pDC, CRect rectImage)
{
    ...
}
CSize MyToolTipCtrl::OnDrawLabel(CDC* pDC, CRect rect, BOOL bCalcOnly)
{
    ...
}


From the OnDrawIcon function, I receive the right size of the icon.
However, I'm stuck now since I can't find a way to get my icon from the CDC object.

Is this the right approach or is there anything more simple?
How do I control the positions of the icon and text inside the tooltip?

Thanks for help!

Alain
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900