Real Software Forums
http://forums.realsoftware.com/

MenuBar causing buttons to be unclickable
http://forums.realsoftware.com/viewtopic.php?f=8&t=32842
Page 1 of 2

Author:  rebrandsoftware [ Thu Mar 04, 2010 5:26 pm ]
Post subject:  MenuBar causing buttons to be unclickable

Here's a weird one:

I thought all my pushbuttons and bevelbuttons weren't working in Linux. When you click on them they show the "push" effect but nothing happens. It turns out I was wrong: you can push them, you just have to move your mouse up about 15 pixels and click in the invisible space where it looks like there is no button.

I've uploaded a picture to illustrate, even though it's really just my best guess about where I have to push. The red squares are where I have to click to access each button.

Image

It affects the pushbuttons, bevelbuttons and a splitter control, but not text, checkboxes or comboboxes.

What on earth is going on here? This code works great on Mac and Windows. It's the last thing I have to overcome to get the software working on Linux. Any ideas?

Cheers,

-Mike

Edit: I changed the subject to reflect the fact that this is caused by the MenuBar.

Author:  rebrandsoftware [ Thu Mar 04, 2010 5:34 pm ]
Post subject:  Re: Button "clickable" area is not over the button?

Also, even though those red squares show where it seems like the clickable area has moved, it doesn't work if I click the actual button in that area.

For example, the Browse button can be clicked by clicking above it, but the Add button can only be clicked if you click the space bettween the Browse and Add buttons.

Nothing ever happens when I click an actual button.

Author:  tempel [ Thu Mar 04, 2010 7:02 pm ]
Post subject:  Re: Button "clickable" area is not over the button?

I'm also deploying an app that shall run on Linux, and your results worry me.
Have you found out more?
Have you reported it as a bug?
What happens if you disable the use of the menu bar so that all items move up? Does it work then?

Author:  rebrandsoftware [ Fri Mar 05, 2010 9:37 am ]
Post subject:  Re: Button "clickable" area is not over the button?

Right now I'm still stumped but if I find a solution I'll certainly post it here.

Author:  rebrandsoftware [ Fri Mar 05, 2010 4:37 pm ]
Post subject:  Re: Button "clickable" area is not over the button?

It turns out it was the menubar doing it. I'm not sure what to do about that because my app definitely needs the menubar. Now that I know the cause I'll search around the forums and see if anyone else has had this problem.

-Mike

Author:  rebrandsoftware [ Fri Mar 05, 2010 4:59 pm ]
Post subject:  Re: MenuBar causing buttons to be unclickable

I've tried adding the menubar after the form has already fully loaded but it doesn't make a difference. Does anyone know why this is happening?

Author:  rebrandsoftware [ Fri Mar 05, 2010 5:17 pm ]
Post subject:  Re: MenuBar causing buttons to be unclickable

Some more test results:

1) It's not something I'm doing to my menubar, the default menubar causes the same problem
2) It's not because the buttons are inside groupboxes
3) If I load a window with an empty menu bar the buttons work as usual. If I then add a menubar through code the buttons stop working.

As far as I can see from searching the forums no one has posted a question about this before.

Author:  tempel [ Fri Mar 05, 2010 5:42 pm ]
Post subject:  Re: MenuBar causing buttons to be unclickable

Whatever you find, please do the rest of us a favor and report this as a bug to RS with their Feedback app, and make sure they can reproduce it. Would be much appreciated.

Author:  computerfreaker [ Fri Mar 05, 2010 10:40 pm ]
Post subject:  Re: MenuBar causing buttons to be unclickable

I see you're using a splitter - try taking that out and see if it fixes your problem.
I can't imagine how a splitter would be causing this kind of problem, but it's even less conceivable that a MenuBar is doing it (unless showing the MenuBar is pushing the graphical part of the buttons down, while leaving the invisible, clickable part intact).

Author:  jefftullin [ Sat Mar 06, 2010 2:02 am ]
Post subject:  Re: MenuBar causing buttons to be unclickable

Can I clarify?
When you say menubar, do you mean the menu that runs along the top File/Edit/Languages etc?

My app carries one of those (most apps will), and I dont see the effects you are seeing.
I havent tried lots of Linux distros, my current Vm is using an Ubuntu distro thats about 4-5 years old.

I do wonder if you have set the screen resolution to the equivalent of Windows' Large Font settings..
ie is the screen running at 96dpi or something like 120 dpi?
Mind you ,if that is the cause, I would expect the difference between control and hit rectangle to vary from the top of the window to the bottom, rather than be a fixed 15 pixels.

Author:  timhare [ Sat Mar 06, 2010 2:33 am ]
Post subject:  Re: MenuBar causing buttons to be unclickable

When you say "menubar", do you actually mean "toolbar"?

Author:  rebrandsoftware [ Mon Mar 08, 2010 10:42 am ]
Post subject:  Re: MenuBar causing buttons to be unclickable

Hi, thanks for the replies.

By MenuBar I mean: File > Edit > Languages > About

Sorry for the confusion, I just assumed it was called a MenuBar since to add one you choose Add Menu Bar and then add it to your window's MenuBar property.

I tested removing various controls until I found the one that is causing the problem. Removing the splitter and toolbar had no effect. Removing the menubar resolved the problem.

If I have a form with no menubar I don't encounter this problem, but if I then create a button that adds a menubar during run time all the buttons get funky again.

I'm running Ubuntu 9.04 off the CD drive, so it's a clean install every time. I will try the suggestion about changing the resolution and see if that makes a difference.

I suspect that all the buttons are indeed off by 15px.

-Mike

Author:  rebrandsoftware [ Mon Mar 08, 2010 11:13 am ]
Post subject:  Re: MenuBar causing buttons to be unclickable

Looks like it was running at 96 DPI.

Author:  jefftullin [ Mon Mar 08, 2010 12:15 pm ]
Post subject:  Re: MenuBar causing buttons to be unclickable

if it only happens because of adding the menu at runtime, can it not be added at design time?

or if not, can a placeholder menu be added at design time, followed by replacing the menu by the 'real one' at run time?

Author:  rebrandsoftware [ Tue Mar 09, 2010 9:47 am ]
Post subject:  Re: MenuBar causing buttons to be unclickable

It happens during both runtime and design time. I was hoping that adding it during runtime might solve the problem but it doesn't.

It turns out that this is almost definitely caused by something I am doing. I tried a simple test form with just a menubar and a button, and that worked without causing the button issue.

It's going to take some detective work to figure out exactly what I've done that could cause such a weird bug.

-Mike

Page 1 of 2 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/