Can Controls Overlay An Image?

Does anyone know if it is possible to have controls overlay an image in the background in a formLayout?

I got it all setup and pretty but I can

yeah, it's perfectly easy, there's just a couple of weird rules to remember:

1) you must declare the controls in the REVERSE order. This seems pretty dumb, and I have no idea why this is the case, but lets say you want a background image, with a button on top you would ASSUME that your code would be:

CODE
formLayout;
image;
button;

but in fact, for the button to be usable you must do this:

CODE
formLayout;
button;
image;

odd..! I can only guess that the earlier a control is created, the higher the priority it's given.

2) you cannot place controls over ACTIVE controls. basically, lets say you wanted to put a button or an image OVER an iconTextButton you could not do it, becasue the iconTextButton is an active control and is constantly refreshing itself as your mouse moves over it. So no matter what you do it will always keep drawing on top of whatever else is on it.

this is the behaviour on a windows OS at least, so I'm not sure if this is the case on others.

:nathaN

Awesome! Thanks! Two more questions if I may.

First. The controls don't show up until the mouse hovers over them. Is there a way to get the controls to show up on init.

Second. On a bit of a different topic. Is there a way to remove the highlight from symbol controls?

Again, thanks,
JDA

in response to your first question, this shouldn't be happening, unless you are ignoring rule 2)

as for the second question, don't use the symbol controls, use the iconText controls (iconTextButton, et al..). They don't have borders (highlight).

:nathaN

OK got it!
Yeah, I was breaking rule 2, I didn't realize that "picture" was a control and "image" was not. I switched it to image and it worked perfectly. Thanks!

For those following the thread, now or in the future, here's a recap. I'm guessing its fairly basic stuff to some, but searching threads likes these have helped me so much I just wanted to pass it along..

If you want controls over an image you must declare all your controls before your background image in your formLayout.

Your background must be of type "image" though "picture" may see no different, it is a control and you can not have controls overlaying other controls.

Note your formLayout will not size to type "image" as it does with "picture" you must manually set the height and width for your formLayout.

symbol* controls have no way of removing their margins (highlights). If you want a seamless button against your background you need to use the control type iconText* and set the -marginWidth(-mw) and -marginHeight(-mh) to 0.

I think that's it. (Hopefully I got it all right) Thanks again Naughty for all your help.
JDA

Ahh interesting thread!!

actually in MEL-UI-speak an image is still a "control"

There is still another way to make anything a "button". You can add a popupMenu and enter your button-command as "-postMenuCommand"!

But of course the cool thing at an iconTextButton is that you can have a highlight and pressed image. Same at the shelfButton. But this has another nice feature: If you press a shelfButton the command is stacked into the recentCommands list and you can press "G" over and over as much as you like.