Print Page | Close Window

DPI Scaling Related ContextMenu Drawing Problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=24372
Printed Date: 21 November 2024 at 3:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DPI Scaling Related ContextMenu Drawing Problem
Posted By: mschumi_41
Subject: DPI Scaling Related ContextMenu Drawing Problem
Date Posted: 16 March 2023 at 11:35am
Hello Codejock Team,
we encountered a context menu drawing problem. We are currently the Xtreme Toolkit Pro version 20.3.0.
Here is the reproduction:
- Occurs only in a multi-monitor setup; monitor resolution does not matter (both monitors can have the same display resolution; in my case 1920 x 1080)
- The scaling (the percentage value "size of text, apps, and other items) must be set different to reproduce the problem (in my setup: main monitor 100%, secondary monitor 125%).
- Start the program; it is opened on the main monitor
- Open a dialog where a context menu can be shown when the right mouse button is clicked upon the dialog
- Drag the dialog to the secondary monitor; as soon as more than half the dialog is dragged to the other monitor, it enlarges (because secondary monitor's scaling is on 125%)
- Now right-click on the dialog
- Here finally comes the problem
   - the context menu's shadows (right and bottom) are drawn in the correct place and size
   - however, the context menu's contents is drawn more to the upper left and in a smaller size that matches the main monitor's scaling


I checked what is called and found the following:
- our code looks as follows

with pCommandBars= nullptr or the MainFrame's command bars:
CXTPPopupBar* pPopup = CXTPPopupBar::CreatePopupBar(pCommandBars);
pPopup.LoadMenu(pMenu)
CXTPCommandBars::TrackPopupMenu(pPopup, flags, inX, inY, /*pWnd=*/nullptr, /*rcExclude=*/nullptr, /*pWndOwner=*/nullptr);

- on the XTP side is called:
- CXTPPopupBar::Popup(CXTPControlPopup* pControlPopup) with
- Animate (here something goes wrong)
   paintDC.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), pDC, rcWindow.left,                           rcWindow.top, SRCCOPY);
   ...
   GetPaintManager()->Animate(&paintDC, &animationDC, rcClient, animationType);
- and for the Shadows (works correctly)
   pPaintManager->GetShadowManager()->SetShadow(this, m_rcExclude, m_bRecursePopup ? 1 : 0);

- I changed one of the Codejock sample programs (CommandBars\HelpContext) and made the AboutDlg to have such a context menu. This reproduces the problem.
- I can send you the modified HelpContext sources  if it is needed

That is all for the moment; is this a bug or am I doing something wrong?

Thank you in advance and best regards,
Michael



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