![]() |
RTL issue in Context Menu |
Post Reply ![]() |
Author | |
ColtSeavers ![]() Newbie ![]() ![]() Joined: 30 October 2007 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 03 October 2008 at 4:48pm |
I came across an issue with CXTPPopupBar when used with CXTPCommandBars::TrackPopupMenu. If the parent window has the WS_EX_LAYOUTRTL extended style and one of the menu items has its text changed in the update handler, CXTPPopupBar::CalculatePopupRect is called more than once. As a result, m_ptPopup is adjusted multiple times and the context menu is shifted to the left by the width of the context menu.
The easiest resolution I found was to use a local CPoint variable that copies m_ptPopup and use this within CalculatePopupRect. This way the original mouse coordinates are never lost and the adjustment is correct. I also looked for a way to avoid calling CalculatePopupRect more than once but did not see a straightforward way to do this. To reproduce the issue just add the line: pCmdUI->SetText(_T("New Command Text")); inside an ON_UPDATE_COMMAND_UI handler for an item in the context menu. What's even more amusing is that the menu will appear at the far left edge of the screen if you change the text of multiple commands. Thank you for looking into this matter. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Think it was fixed already. I can't reproduce it with last version. What version do you have ? |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
ColtSeavers ![]() Newbie ![]() ![]() Joined: 30 October 2007 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
I am on 11.1.3, which I realize is out of date. I'm still working on getting the latest version but I wanted to see if this issue has been addressed.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |