How to display the label when user clicks on the button?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
slinuxgeek Offline
Senior Member
Posts: 186
Joined: Feb 2012
Reputation: 0
Smile  How to display the label when user clicks on the button? Post: #1
Hi,
I have a label whose id is 5 and also a button .
The lable is hidden.
I want to display the label when user clicks on the button.

what should I write in <onclick> Confused </onclick> of the button.
I could not find any function like control(id).show( )

Thanks
find quote
pecinko Offline
Member+
Posts: 3,017
Joined: Dec 2008
Reputation: 27
Location: Prague / Belgrade
Post: #2
E.g.

Skin.SetString

or

SetProperty(key,value[,id])

and set label visibility based on that.

My skins:

Quartz
Amber
find quote
slinuxgeek Offline
Senior Member
Posts: 186
Joined: Feb 2012
Reputation: 0
Post: #3
Any other way please !!

Thanks for reply.
find quote
pecinko Offline
Member+
Posts: 3,017
Joined: Dec 2008
Reputation: 27
Location: Prague / Belgrade
Post: #4
Why?

My skins:

Quartz
Amber
find quote
henrava Offline
Senior Member
Posts: 100
Joined: Apr 2011
Reputation: 0
Location: Italy
Post: #5
You can try with:
<control type="button" id="8005">
<label>yourlabel</label>
<visible>Control.HasFocus(8005)</visible>

When you have focus on button, it became visible.
find quote
Hitcher Offline
Skilled Skinner
Posts: 9,935
Joined: Aug 2007
Reputation: 67
Location: Eastleigh, UK
Post: #6
Or Control.GetLabel(BUTTON_ID) if that's what you mean.

[Image: sig_zps3af3b48e.jpg]
find quote
slinuxgeek Offline
Senior Member
Posts: 186
Joined: Feb 2012
Reputation: 0
Post: #7
I actually simplified the question , actually I am trying to make a drop down menu , whose selected value will be represented by the label of the button which is on top of the menu.
menu may be achieved by a list control,which is by default hidden when user clicks on the button the drop down menu appears just below the button. user clicks on any choice of list and that choice's label becomes label of button.

I don't want the list control to become visible when button is focused but when the button is clicked.
Now there might appear a solution like:
<control type="button">
<onclick>setfocus(list_id)</onclick>
--------many lines--------
</control>
and list control will be like:
<control type="list" id="list_id">
<visible allowhiddenfocus="true">Control.HasFocus(list_id)</visible>
--------many lines--------
</control>

but in this case even if you don't click on button and simply move your mouse to the area where the list is but is hidden, the list control becomes visible which is bad.

Any Solution ?
Thanks.
find quote
slinuxgeek Offline
Senior Member
Posts: 186
Joined: Feb 2012
Reputation: 0
Post: #8
(2012-04-04 19:27)pecinko Wrote:  Why?

Because , when move mpuse out of the label I want the label should again become invisible , we will have to reset the string value but how & when ? means where we will write Skin.SetString(.......)?
find quote
butchabay Offline
Skilled Skinner
Posts: 3,425
Joined: Mar 2010
Reputation: 62
Location: Switzerland
Post: #9
Maybe you could try something like:


PHP Code:
<control type="radiobutton" id="1">
<
width>750</width>
<
height>35</height>
<
font>font_20</font>
<
label>label1</label>
<
textcolor>grey2</textcolor>
<
focusedcolor>white</focusedcolor>
<
texturefocus flipx="true">listwhitegradient.png</texturefocus>
<
texturenofocus>menuitemNF.png</texturenofocus>
<
onclick>Skin.ToggleSetting(enable_dropdown_list)</onclick>
<
selected>Skin.HasSetting(enable_dropdown_list)</selected>
</
control>
<
control type="radiobutton" id="2">
<
width>750</width>
<
height>35</height>
<
font>font_20</font>
<
label>List Label 1</label>
<
textcolor>grey2</textcolor>
<
focusedcolor>white</focusedcolor>
<
texturefocus flipx="true">listwhitegradient.png</texturefocus>
<
texturenofocus>menuitemNF.png</texturenofocus>
<
onclick>Skin.ToggleSetting(what_you_want)</onclick>
<
visible>Skin.HasSetting(enable_dropdown_list)</visible>
</
control
find quote
slinuxgeek Offline
Senior Member
Posts: 186
Joined: Feb 2012
Reputation: 0
Post: #10
Here is what I have done:
<control type="button">
<ondown>Skin.ToggleSetting(enable_dropdown_list)</ondown>
<ondown>setfocus(6)</ondown>

<onclick>Skin.ToggleSetting(enable_dropdown_list)</onclick>
<onclick>setfocus(6)</onclick>
</control>

Here is List control with many choices:

<control type="list" id="6">
<visible allowhiddenfocus="false">Skin.HasSetting(enable_dropdown_list) </visible>
</control>

when I press down arrow key on button the list control becomes visible but the list control does not take focus, so I can not press up and down arrow keys to traverse the choices with in list control.

If I write allowhiddenfocus="true" the list becomes visible when I move mouse over that area without any intension to see the list , which is bad.

what wrong I have written?


Thanks for help?
find quote
Post Reply