Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - RTL issue in Context Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

RTL issue in Context Menu

 Post Reply Post Reply
Author
Message
ColtSeavers View Drop Down
Newbie
Newbie
Avatar

Joined: 30 October 2007
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ColtSeavers Quote  Post ReplyReply Direct Link To This Post Topic: RTL issue in Context Menu
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2008 at 1:14am

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
Back to Top
ColtSeavers View Drop Down
Newbie
Newbie
Avatar

Joined: 30 October 2007
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ColtSeavers Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2008 at 2:18pm
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.