Creating Buttons and Icons

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
AndyA
Member
Posts: 17
Joined: Fri Nov 05, 2004 8:32 pm

Creating Buttons and Icons

Post by AndyA »

Does anyone know how to create your own icon for a button, every time I try using Paint Shop Pro6 I get a white background with the picture.

Ive tried to use a transparent background but it seem's that when I save as a .PNG it becomes a white!



Andy.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Andy,



What color is the background in PSP? Also, if you view the thumbnail the PNG in the Windows Explorer (My Computer), what color is it (or is it transparent)?
Scott
AndyA
Member
Posts: 17
Joined: Fri Nov 05, 2004 8:32 pm

Post by AndyA »

Scott



Many thanks for your reply.



I was up until the early hours not wanting to be beaten by this and found what I was doing wrong. :shock: It seems that my drawing software does not like saving a transparent background when saved as a .png, and was converting the transparent background into a white one!

New software - problem solved.



I have another question,



I am trying to control the dim value of an X10 light with two buttons (UP and DOWN) instead of a slider.

I have tried using a property change button but this only seems to allow you to assign a single value, would I need to create some sort of script for this?

Or is the an easy way?



Andy.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

AndyA wrote:I am trying to control the dim value of an X10 light with two buttons (UP and DOWN) instead of a slider.
I have tried using a property change button but this only seems to allow you to assign a single value, would I need to create some sort of script for this?
Or is the an easy way?
If you are trying to set one of the direct dim Properties (Leviton Dim or Preset Dim), you can use the +=n or -=n notation to increment or decrement the current value.



If you are just sending individual Dim or Bright Commands, you can either use a Script, or you can use the Direct X10 Command Property of the X10 Device and send something like Dim;n or Bright;n from the Property change button.



If you are trying to hit a particular Dim level with individual Dim or Bright commands, you will probably need to write a Task to first set the Dim level all the way down, and then bring it up to the correct level. Not really a pretty thing, but one of the limitations of the basic X10 commands.
Scott
AndyA
Member
Posts: 17
Joined: Fri Nov 05, 2004 8:32 pm

Post by AndyA »

Scott,



Thanks again, worked a treat.

I am having trouble trying to get the button repeat feature to work, I have tried putting the same +=n but nothing happens, do I need to give more specific detail of what value to change as button repeat does not show the property to be changed? Or is it because it is trying to update the (Leviton Dim) value for that particular device?





Andy.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Andy,



The button repeat will send the value to whatever Device/Property is selected in the Property Change tab. So the same property that changes when you press it is the same that changes when you hold it.
Scott
AndyA
Member
Posts: 17
Joined: Fri Nov 05, 2004 8:32 pm

Post by AndyA »

Scott,



I have created buttons to raise and lower the leviton light level of an X10 light which also has a bargraph display, the button will work fine with single press but I cannot get the button repeat to work.

I have enabled the button repeat feature and entered +=10 for the light raise button in the Send this Value check box. What am I doing wrong?



Andy.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Andy,



Not sure. It sounds like you're doing it right.



I've attached a quick sample Theme that you can associate to your SWRemote to test a setup that I know works. Just drag and drop the .hbx file onto HouseBot and then restart.



Scott
Scott
AndyA
Member
Posts: 17
Joined: Fri Nov 05, 2004 8:32 pm

Post by AndyA »

Scott,



When I download your test it saves as .zip and will not launch with Housebot, how do I change a .zip to .hbx?



Andy.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

AndyA wrote:When I download your test it saves as .zip and will not launch with Housebot, how do I change a .zip to .hbx?
Just rename it and it will work fine.
Scott
AndyA
Member
Posts: 17
Joined: Fri Nov 05, 2004 8:32 pm

Post by AndyA »

My problem with changing the file name was because I had not un checked the "Hide extensions for known file types" under folder options!!



I have also found that the problem with the button repeat not working is because the controls are on a pop-up panel, if I change the panel type the button works?



Why does the repeat function not work on a pop-up panel, or how can I make it work?

Also why is the response of the leviton dim level so slow when changing an actual X10 lamp, using your test with a Null Device the change is instant?

And finally how can you prevent the leviton level attempting to raise above 100 and pinging error messages for every button press?

Because the update time of the repeat is so slow the value will climb above 100 giving you error messages with every attempt.



Andy.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

AndyA wrote:Why does the repeat function not work on a pop-up panel, or how can I make it work?
So that was it! Not sure why it doesn't work. I'll have to get back to you on that one. I'm betting it will take a code change (no workaround).
Also why is the response of the Leviton dim level so slow when changing an actual X10 lamp, using your test with a Null Device the change is instant?
If a Property change involves the Device sending something to the Hardware Interface to fulfill the change request, the Property will not actually change until the Hardware Interface has successfully satisfied the request (it could even fail). Since the Leviton Dim change requires communication with your X10 interface and sending data on the power-line, it will be noticeably slower than the simple change in my sample.
And finally how can you prevent the Leviton level attempting to raise above 100 and pinging error messages for every button press?
Because the update time of the repeat is so slow the value will climb above 100 giving you error messages with every attempt.
That's a little more tricky. What you would actually need to do is to create a new Property that the button changes. Then have a Task (or Script) execute whenever that Property changes. If the value is in range, the Task will set the REAL Leviton Dim Property (otherwise it will do nothing).
Scott
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I just tried the button repeat on a pop-up and it seemed to work ok on my machine. I then went and looked a little deeper and found that I had fixed this problem a while back. Unfortunately, there hasn't been an update of HouseBot in a long while to release the fix, so you can expect it in the next release (I don't know when that might be).
Scott
Post Reply