Window border clicking

9 posts / 0 new
Last post
alfkil
alfkil's picture
Offline
Last seen: 3 months 5 days ago
Joined: 2011-05-10 22:02
Window border clicking

Is there some way to know, if the user has clicked inside the border of a normal intuition window??

As far as I can see, neither IDCMP_MOUSEBUTTONS or IDCMP_GADGETDOWN is invoked on mouseclicking borders of windows. So how can I get a message, that tells me, if this has happened??

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
Re: Window border clicking

@alfkil
If you have access to one of the OS3 developer CDs, there is an example called eventloop.c that reports clicks in window borders. The OS3 binary worked on my X1000. It opens a small window and when you click on a border in the small window, it opens a console window and reports where you clicked (mouse coordinates).

X1000 - OS 4.1FE

alfkil
alfkil's picture
Offline
Last seen: 3 months 5 days ago
Joined: 2011-05-10 22:02
Re: Window border clicking

I will check it out. Thanks!

I was hoping, that there would be a simple solution. This is for recognizing clicks on window borders in Qt, so you can close any popups and prevent unintuitive behaviors in popup mode. But probably it is not so easy...

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
Re: Window border clicking

Window borders are handled just like the window body, there is no difference. You get IDCMP_MOUSEBUTTON messages unless the mouse is over a control element (close button, drag bar etc.).

Of course if you run something like AutoBorderSize, you won't hear anything from window borders because all borders become control elements.

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
Re: Window border clicking

@thomas
That's true for an standard Intuition window; you get IDCMP_MOUSEBUTTON messages for all window border clicks including the dragbar. However I tried it in a Reaction window (window.class) and when I set the IDCMP_MOUSEBUTTON flag for the window and used WMHI_MOUSEBUTTONS to check for border clicks, I didn't get any MOUSEBUTTON messages for mouse clicks in the window dragbar; just messages for mouse clicks in the right, left and bottom borders.

X1000 - OS 4.1FE

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
Re: Window border clicking

Like I said you don't get messages if you click on control elements. The drag bar is a control element just like the close button, the size button and the depth button. You only get messages if you click into an empty area of the window, be it in the borders or in the body.

salass00
salass00's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-02-03 11:27
Re: Window border clicking

Do you really need to register just border clicks specifically or would any clicks inside the window do?

I don't understand why clicking the borders should close popups.

If you want to register mouse clicks also over gadgets you could probably do it with an input.device input handler, however this would be a pretty low level solution and would involve some extra code to find out if the mouse is over your window (look into ILayers->WhichLayer() function) and if it's in one of the window border areas if that's what you want.

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
Re: Window border clicking

@thomas
I overlooked the fact that my simple Intuition window did not have WA_DragBar set; which means the drag bar was not a control element and I received MOUSEBUTTON messages for clicks on the dragbar. However, a window that can't be moved isn't normally what you would want.

X1000 - OS 4.1FE

alfkil
alfkil's picture
Offline
Last seen: 3 months 5 days ago
Joined: 2011-05-10 22:02
Re: Window border clicking

Selecting anything appart from the popup should close it. BUT it is not possible to rely on Deactivation events, because sometimes, you need to keep the popup open, while it is deselected (Qt menus are one case). So the only possibility so far in sight is to register clicks on other windows - including their borders.

Log in or register to post comments