property change button with propery lable

Simple advice that you may find useful. Feel free to discuss or add your own.
Post Reply
skakooli2
Member
Posts: 9
Joined: Tue Jun 05, 2012 12:30 pm

property change button with propery lable

Post by skakooli2 »

Hi,
I want to create button that will change some property, and that it's text will be taken from another property value.
Is that possible?
Thanks, Shakhar.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: property change button with propery lable

Post by Richard Naninck »

Take a look at multi state buttons. You cannot put a text from another property but you can define a unique text per button state. Mayby that will do for you.
skakooli2
Member
Posts: 9
Joined: Tue Jun 05, 2012 12:30 pm

Re: property change button with propery lable

Post by skakooli2 »

Hi,
Thank you for the reply.
A multi state button is a button that displays another picture at each state and that's not what i'm looking for.
I need a button that will change some propery and that the text of the button will be taken from another property.
Basicly, i want to display text from excel file.
I know how to read an excel file and pass it's text to HB.

I thought to change the XML file with a script
The script will search for the button definition in the XML, and change it's text to the desired text.
But it's very hard to do, and i will glad if I have a better solution.

Thanks, Shakhar.
lostdreamer
Member
Posts: 54
Joined: Sat Apr 18, 2009 8:53 pm

Re: property change button with propery lable

Post by lostdreamer »

Whenever I need something like that, i simply create a button to controll property A, and put a label on top of it with the value of property B.
This usually works ok.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: property change button with propery lable

Post by Richard Naninck »

You cannot press the button where the text is displayed so you need to create a button large enough to show some free touch space (space not covered by the text property)
markd
Advanced Member
Posts: 234
Joined: Fri Jul 21, 2006 4:32 pm

Re: property change button with propery lable

Post by markd »

Or make the pushable button transparent?
skakooli2
Member
Posts: 9
Joined: Tue Jun 05, 2012 12:30 pm

Re: property change button with propery lable

Post by skakooli2 »

Ok thanks.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: property change button with propery lable

Post by Richard Naninck »

You would actually need to create a button with a transparant hole in it because once you press the button, the text will fall behind it and once the text is refreshed it will appear on top of the button again. Not very consistent. I use this trick with indicators in buttons.
Post Reply