Invisible buttons

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
John_Paul_128
Member
Posts: 15
Joined: Tue Apr 15, 2003 9:33 am

Invisible buttons

Post by John_Paul_128 »

Hi all,

In SWRemote, I want to create some invisible buttons that sit over a background that has the buttons already drawn, is this possible?
thanks, John
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Invisible buttons

Post by Richard Naninck »

This was possible in previous versions of HB, but since the last release, fully transparent buttons cannot be clicked anymore to provide for a new feature namely rounded buttons. The new rounded buttons can only be clicked in the area where a button is visible and not on the transparent edges. To make this work, just add a transparent color to your button which is almost not visible. This makes the button semi transparant and makes it clickable again. If the transparent layer becomes visible in the theme, you can up the transparency of the image a bit in the theme editer itself to make it go away again. Be advised that there is a cut off when upping the transparency. When the level is too high, you cannot click the button anymore. So just fiddle a bit to find the best solution.

So the answer would be... yes, but..
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Invisible buttons

Post by Steve Horn »

I can't get this to work, but I probably don't understand. I have a multi-state image control sitting (ideally) "under" a same sized panel change button. The plan is for the panel change button to be transparent so that the image can be seen, which is reflecting the state of a device's property (on, off, whatever...). Clicking on the button would open the corresponding panel associated with the device that the image control is displaying. But I cannot "layer" the control in such a way that it is transparent to the image. (Since there is no layer property for an image, there does not appear to be a way to position it below the button control.) That is, the button becomes transparent to the base layer of the panel, but NOT to the image that should be "underneath" it. The panel change button is hot pink with the transparent color the same. We know that works because the button is transparent for part of its footprint if the button and image control do not directly overlay. But clicking on the portion of the image/button where the button and image share (overlay one another) does not open the panel.
Its winter here :( , so I'm back to playing with HB. :D
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Invisible buttons

Post by Richard Naninck »

Steve,

Don't use a transparant color to make stuff transparent, but use a paint program to really make the upstate of a button transparent.

In my theme I have static images underlaying buttons. I just checked, but both the button and the image have layer control. Indicators don't! Layer the image underneath the button and you should be fine. But now the tricky part comes:
Imagine a button with a transparent upstate (left side of the button image) and a filled in downstate (rightside of the button image). If you overlay the button on top of the static or dynamic image, you should see the image. If you press the button, the downstate of the button should appear. Now if the upstate is fully transparent, you can't push the button. Maybe you should also fiddle with the Transparent Click Through option (I don't use it). So if you create a transparent layer in the upstate of the button it becomes clickable again. Maybe hard to describe, but there is a difference between fully transparent and an image having a transparent color of some sort. I will email you an example button.
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Invisible buttons

Post by Steve Horn »

After a lot of fooling with the panel change button control's image file I never got it to overlay either the multi-state indicator OR even a static image file. Then I took your emailed "information" image file and tested with it instead. It worked fine layered over an image on my theme. That tells me I don't know how to make a portion (left/upstate) of a control's image file transparent in Paint! But your "Information" image file will not overlay a multi-state indicator - as you point out. no way currently to specify the layer of the indicator below the image control. Maybe that's an enhancement request?
That said, since there appears to be no way to overlay a multi-state (or ANY) indicator with an image, I'll cobble together some other less elegant way to do it.
Thanks!
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Invisible buttons

Post by Richard Naninck »

Indicators don't have layer control. It has been feature requested but not easy to implement. Instead this transparent button feature came about.

I do however have indicators in my buttons. I created buttons with a true transparent hole in them through which the indicator appears. A couple of things happen when you do that:
1. You cannot press the button where the indicator is sitting so make your buttons large enough (or with enough space surrounding the indicator).
2. After pressing the button, the indicator may disappear behind the button even though the button is transparent at the spot where the indicator is positioned. You have to refresh the indictor (script or task) to make it appear again.

I have lots of Audio / Video source buttons with this trick.
Take a receiver and source buttons like Video 1, DVD, CD, TV etc. I got all the source buttons in my panel, but the selected one is showing an indicator in green like an LED whereas the non selected sources show a full button because the not selected state of the indicator has the exact same color as te button and therefore blends in with the button to make it whole again. If you want I can mail you examples from this as well.
It is always nice to have indicators in buttons that are alive even without pressing the button itself. Example: A power button from the same receiver. Can be either in standby (grey/red) or on (green). The receiver produces its own status through serial so if the receiver is switched on using the standard remote, the power button in the theme changes state.

For transparency to work, you need a good paint program. I use an old version of Fireworks but it handles transparency very well. You can take a sample from the button I emailed you and copy that into your buttons. Remember to fiddle with the transparency option in the theme editer. Mine sits at 24 because at 25 the button doesn't work anymore and below 24 it becomes visible again. So nice tradeoff there..
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Invisible buttons

Post by Steve Horn »

Resurrecting this old chestnut. With the ability of having an Android SWremote, I created a theme that re-scales an existing theme to a new tablet's aspect ratio. When I did this I added task-triggering buttons and overlaid them atop of indicator controls that are mapped to the state of a property controlled by the task. In English, when the button is clicked, it turns a speaker zone on and a red "ring" around the button lights up. The button's layers, presumably due to the number of buttons on the panel is high (22). But since indicators don't have layers (do they?) that may not matter. Anyway, the button atop the indicator works fine.
I tried to replicate that in another theme, for a non-Android SWRemote but the indicator overlays the button making the button unclickable. This seems to agree with Richard's explanation above. (Indicators don't have layers, there are work-arounds dealing with "holes" in buttons, etc. ).
I tried copying the Android functioning button and indicator "ring"( which is a largely transparent image with a red border in the "down state") to the non Android theme. Didn't work - same result as I got initially.
So I'm left with the conclusion that the Android SWRemote handles layers differently than the non- version. I can create a button with a "hole" in it (This is a mute button with an indication that mute is on or off. (Looks like the lack of sound would tip one off, but I digress...) But I'm puzzled as to why the concept works in one theme but not another.
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Invisible buttons

Post by Richard Naninck »

It would make (or actually would have made) a huge difference if indicators could sit on top of buttons where they would Always be visible and not disappear underneath the button when clicked while the underlaying button remains clickable. If this works in Android, it certainly makes it easy to create nice looking panels without too much trouble. Nice find. People are in a habit these days to open up zombie threads again :D Just means HB is still alive..
Steve Horn
HouseBot Guru
Posts: 750
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Re: Invisible buttons

Post by Steve Horn »

It occurred to me late last night after my previous post that this peculiarity presented itself to me earlier in my Android work. I had built the Android theme and it was working as described. Then I called up the same theme on an old win2k tablet because it has the same aspect ratio as the Android. And the speaker zone buttons disappeared! I wrote it off as an anomaly due to the "oldness" of the win2k tablet. But it seems now to be due to the SWRemote client.
Yup, HB is still very much alive here!
Steve
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Invisible buttons

Post by ScottBot »

Steve,

Unfortunately, as you now know, some of the controls don't support layering. The android remote is actually a little smarter about things and you could add a ZORDR="1" property to the indicator control in the theme XML manually to get this to work. However, every time you save the theme, it *may* change the button z-orders to break your manual change.

Another option would be to use a multi-state button, since that's really what it sounds like you are trying to do.
Scott
Post Reply