Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread Close a dropdown panel
Sun, Oct 18 2015 9:05 AMPermanent Link

Christian Kaufmann

In my application I have a settings panel which opens when the user clicks on the icon in the top
right corner (similar to the settings menu in Gmail or Outlook webmail).

It's easy to hide this panel when the user clicks an option on it, but is there a way to capture
the next click after I showed the panel?

I tried with the OnMouseLeave event as well, but this doesn't always fire especially not, if the
user goes arround my panel after the click of the icon to open it.

cu Christian
Sun, Oct 18 2015 9:50 AMPermanent Link

Matthew Jones

Christian Kaufmann wrote:

> but is there a way to capture
> the next click after I showed the panel?

Pretty sure that in one application in EWB1 I used the OnExit to detect
this. This is basically focus monitoring, and once they moved out of
the panel, I hid it. I might have used a timer, and just checked which
control had focus, and was it a child of the panel. Of course you have
to make sure that an option on the drop-down is given focus first,
using SetFocus.

--

Matthew Jones
Sun, Oct 18 2015 2:54 PMPermanent Link

Christian Kaufmann

Matthew Jones wrote:

> Pretty sure that in one application in EWB1 I used the OnExit to detect
> this. This is basically focus monitoring, and once they moved out of

I have only TLabel's on my panel and they can't have focus. And using the TPanels SetFocus has no
effect.

cu Christian
Mon, Oct 19 2015 5:14 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< In my application I have a settings panel which opens when the user clicks on the icon in the top right corner (similar to the settings menu in Gmail or Outlook webmail).

It's easy to hide this panel when the user clicks an option on it, but is there a way to capture the next click after I showed the panel? >>

What is the user clicking on in "the next click" ?

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Oct 19 2015 5:36 PMPermanent Link

Christian Kaufmann

Tim Young [Elevate Software] wrote:

> What is the user clicking on in "the next click" ?

It could be anything available outside my menu/settings panel: input control or just in the empty
space of the client panel/form.

cu Christian
Mon, Oct 19 2015 6:35 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< It could be anything available outside my menu/settings panel: input control or just in the empty
space of the client panel/form. >>

Okay, I was thinking the opposite of what you were describing.

Unfortunately, the only way to do this is going to require a custom panel control that enables focus and handles dispatching the enter/exit events in a cohesive way to account for sub-controls that can *also* gain focus.

I've thought about adding this to the TControl as an option, but there are some serious downsides to doing so.  Namely, making a container focusable at the browser level can cause some automatic scrolling, depending upon the size of the container and where one is clicking.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 20 2015 4:58 AMPermanent Link

Christian Kaufmann

Tim Young [Elevate Software] wrote:

> I've thought about adding this to the TControl as an option, but there are some serious downsides
> to doing so.  Namely, making a container focusable at the browser level can cause some automatic
> scrolling, depending upon the size of the container and where one is clicking.

Ok, I build something "arround" that.

- Is there a global way to find the control at the current mouse position?
- Is there something like the Delphi Application.OnIdle event?

cu Christian
Tue, Oct 20 2015 9:21 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 10/18/2015 9:05 AM, Christian Kaufmann wrote:
> In my application I have a settings panel which opens when the user clicks on the icon in the top
> right corner (similar to the settings menu in Gmail or Outlook webmail).
>
> It's easy to hide this panel when the user clicks an option on it, but is there a way to capture
> the next click after I showed the panel?

Not an ideal solution but what about just timing it out - start a timer,
reset timer whenever user clicks in the panel and at the end of timer
just hide the panel.

Raul
Tue, Oct 20 2015 2:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< - Is there a global way to find the control at the current mouse position? >>

Not currently, no.

<< - Is there something like the Delphi Application.OnIdle event? >>

See Raul's answer - what you want to use is a TTimer with a timeout of 0, which will execute the next time that the UI message loop is processed.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 20 2015 2:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< See Raul's answer - what you want to use is a TTimer with a timeout of 0, which will execute the next time that the UI message loop is processed. >>

Just a clarification: my answer is slightly different than Raul's.  He was talking about a general solution to the problem, whereas my answer was regarding an OnIdle clone in terms of behavior.

Tim Young
Elevate Software
www.elevatesoft.com
Page 1 of 2Next Page
Jump to Page:  1 2
Image