Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong item selected when using a scrolled popup menu #285

Open
Daniel-Tr opened this issue Feb 19, 2021 · 3 comments
Open

Wrong item selected when using a scrolled popup menu #285

Daniel-Tr opened this issue Feb 19, 2021 · 3 comments

Comments

@Daniel-Tr
Copy link

Daniel-Tr commented Feb 19, 2021

  • Compiled with Delphi 10.4.1 (latest)
  • Running on Windows 10 20H2 (latest)
  • Show a themed context menu that contains more elements than possible to show on the screen at once
  • Use the mouse to click the buttons to scroll up/down
  • Click on an element
  • Issue: A wrong element becomes executed/selected.

It seems like function TSysPopupStyleHook.GetItemClicked does not take the current offset into account. It works, when navigating the list with the keyboard only.

@tweibert
Copy link

I also experience this issue. So I'm bumping this. Has anyone found a solution yet?

@WeberAndre
Copy link

Hello, we worked around the issue with a detours hack and insert menu breaks and make long menus multicolumn... feels also better for me instead of scrolling through long popup's .
If this is a solution for you I can post the code...

@tweibert
Copy link

Thanks, @WeberAndre - this is actually a very good idea! I changed my code so that Break := mbBreak is set on every 20th or so TMenuItem. It's even more convenient to use now.

Disclaimer: I know that popup menus shouldn't have so many items anway, but this particular one is generated dynamically from the user's configuration/database, and we have a very small number of users which happen to have an unusually large number of items in their configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants