Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Menus&Toolbars » Accelerators stop after popup menu due to focus
Accelerators stop after popup menu due to focus [message #59823] Wed, 26 April 2023 18:08 Go to next message
devilsclaw is currently offline  devilsclaw
Messages: 72
Registered: August 2022
Member
I have added accelerators to the main app menu like Ctrl + X to close the program.

If I right click on an element that causes a popup menu to show. In this case the option selected removes an item from a ArrayCtrl.

Once the popup menu goes away the focus seems to be lost, at least that is what I think is causing the next thing.

After the popup menu goes away the Ctrl+X and any other accelerators stop working until I click the windows again.
Re: Accelerators stop after popup menu due to focus [message #59824 is a reply to message #59823] Wed, 26 April 2023 18:14 Go to previous message
devilsclaw is currently offline  devilsclaw
Messages: 72
Registered: August 2022
Member
Fixed the problem for my self added SetFocus() to the code after the execute

  void ArrayCtrl::RightDown(Point p, dword flags) {
    if((flags & (K_CTRL | K_SHIFT)) == 0) {
      if(cursor >= 0 && !multiselect) {
        ClearSelection();
      }
      DoPoint(p, false);
      ClickColumn(p);
      if(cursor >= 0 && multiselect) {
        if(!IsSelected(cursor)) {
          ClearSelection();
          SelectOne(anchor = cursor);
        }
        Action();
      }
    }
    MenuBar::Execute(WhenBar);
    SetFocus();
  }
Previous Topic: query , update menu / submenu itens
Next Topic: Menu opens, but does not close (Bug?)
Goto Forum:
  


Current Time: Sun Apr 28 19:33:17 CEST 2024

Total time taken to generate the page: 0.05264 seconds