Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread TMenu.PopUp question
Tue, May 1 2018 9:31 AMPermanent Link

Ralf Mimoun

Hi all,

trying to emulate "modern" UIs I added a menu icon and a TMenu with three dummy entries to my form. The icon OnClick event calls Menu.Popup with appropiate coordiates. Et voila! the menu is shown. But it does not close when I click outside of the menu. More exactly, it does, depending on where I click. Like:

- Panel: close
- Label: nada
- Label with FocusControl set to a TEdit (or something else): close
- Grid: nada
- Padding area of form: nada

It seems that the menu only close if you click on something that can get the focus (because only then TMenu lose focus). Is there any way to persuade TMenu.Popup to behave better?
Wed, May 2 2018 3:40 AMPermanent Link

Uli Becker

Ralf,

> trying to emulate "modern" UIs I added a menu icon and a TMenu with three dummy entries to my form. The icon OnClick event calls Menu.Popup with appropiate coordiates. Et voila! the menu is shown. But it does not close when I click outside of the menu. More exactly, it does, depending on where I click.

Maybe this thread helps:

https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&page=1&msg=8324#8324

Uli
Wed, May 2 2018 9:37 AMPermanent Link

Ralf Mimoun

Looks cool, thanks Smile


Uli Becker wrote:

Ralf,

> trying to emulate "modern" UIs I added a menu icon and a TMenu with three dummy entries to my form. The icon OnClick event calls Menu.Popup with appropiate coordiates. Et voila! the menu is shown. But it does not close when I click outside of the menu. More exactly, it does, depending on where I click.

Maybe this thread helps:

https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&page=1&msg=8324#8324

Uli
Wed, May 2 2018 2:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ralf,

<< It seems that the menu only close if you click on something that can get the focus (because only then TMenu lose focus).  >>

That's correct.  Remember, there are touch environments involved, and you don't necessarily want the menu going away unless it has somewhere to go and the user didn't just accidentally touch outside of the menu.

Tim Young
Elevate Software
www.elevatesoft.com
Image