Print Page | Close Window

RTL issue in Context Menu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12328
Printed Date: 23 June 2025 at 9:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: RTL issue in Context Menu
Posted By: ColtSeavers
Subject: RTL issue in Context Menu
Date 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.



Replies:
Posted By: Oleg
Date 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


Posted By: ColtSeavers
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net