blank infotext for edit control?
#1
is there a way to display a text like "type album name" in the edit control if it has focus and nothing is typed in, but disappears as something is typed in?
Reply
#2
Display the label in the same position as the edit control and add a visible condition based on whether the control is empty?
Reply
#3
thought that there was a special control tag for the edit control, which isn't in the wiki. like <alternattext></alternatetext> or so...

Code:
<control type="label" description="search album">
            <visible>Control.HasFocus(19) + Container.Content(Albums) + IsEmpty(19)</visible>
            <posx>108</posx>
            <posy>4</posy>
            <width>220</width>
            <height>40</height>
            <aligny>center</aligny>
            <align>left</align>
            <label>type album name here</label>
        </control>

doesn't work as expected, because even i type something the label is still thereHuh
Reply
#4
Try -

PHP Code:
IsEmpty(Control.GetLabel(19)) 
Reply
#5
nope... doesn't work too. and StringCompare(Control.GetLabel(19),) also doesn't work both remain true even sth is typed in to the filter...Sad

another idea?

or is it sth worse to implement and i should request cause atm it isn't possible? so request a control tag for the edit control? <textifempty> or <altlabel> or sth like this?
Reply
#6
added as ticket: http://trac.xbmc.org/ticket/11610
Reply
#7
Control.GetLabel(id) won't work here because label in edit control is the label/header and not the value.

Just for discussion here I'll refer to that text that appear only if nothing is typed in as hint_text.
It would be cleaner (less hacky) to set hint_text inside edit control tags ... but then skinners wouldn't have control over font used to render it (on some websites I think I saw hint_text displayed in italics and user input was regular text). Alternatively we could add way (via infolabel) to get value of edit control - this would allow hacky label overlay. Maybe You guys could figure out some other use scenarios for this

This is open for discussion - I'd like more opinions from skinners before doing some work on it.
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
Reply
#8
I would welcome a way to be able to do what vanMiez requests.
I wanted to do the same for the playlist name field in the smart playlist editor. Benefits would be saving space (which in for example the smart playlist editor is very welcome) and coherence.
It could also be used for the name field in the media source dialog, and in the keyboard dialog. Possibly also the search field in the left menu in the library screens.
Being able to set the font preference would be essential as far as I'm concerned though.
Reply
#9
Label Formatting of course would be available for hint_text no matter which way it would be done.

Keep in mind that merging hint_text into edit control would result in limted functionality. Using infolabel would allow applying animations for hint_text itself, use of image indicators and propably more. Personally I'm leaning toward infolabel way as it is way more flexible Smile
Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

My previous forum/trac nickname: grajen3
Reply
#10
would it be possible to use <label2> in the edit control for the hint_text?
if that could be done and Control.GetLabel() would return the value of label2 to the skin, i'd say we have a winner.

i would prefer to avoid hacky overlays with a bunch of conditionals if possible.

pieh Wrote:but then skinners wouldn't have control over font used to render it

true, but it's not limited to the edit control only, there's currently also no way the specify different fonts for <label> and <label2> in a button control...
so it may be better to address this as a separate issue.

perhaps add [font=] to the label formatting options?
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#11
One thing to think about is an edit control has 2 labels (left and right like a button), and will currently return label1 most likely? It would be feasible to change this so that it returns a combination of label1 and label2 - I think button does this?

I prefer having a hint text displayed in label2 - it is more straight forward. Same font isn't an issue as you can colour it or italic it as you wish.

With that said, Control.GetLabel() should return _something_ sensible either way.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
ronie Wrote:perhaps add [font=] to the label formatting options?
That would be very handy in general imo, I believe I even made a trac for this at some point actually.
Reply
#13
Jeroen Wrote:It could also be used for the name field in the media source dialog, and in the keyboard dialog. Possibly also the search field in the left menu in the library screens.

+1 for that...
would save work and make it more usable for users if we could easily display what is expected to type in instead of displaying it in the dialog headings or an extra label i guess...
i think important would be that <altlabel> could a) formatted with [FONT] tag and b) we can have many of them by different visible control tags
Reply
#14
jmarshall Wrote:One thing to think about is an edit control has 2 labels (left and right like a button), and will currently return label1 most likely? It would be feasible to change this so that it returns a combination of label1 and label2 - I think button does this?

both only return label1 atm.

jmarshall Wrote:With that said, Control.GetLabel() should return _something_ sensible either way.

to me that would be the text entered by the user,
so we could pass it as an argv to a script, for instance.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#15
while we are on the topic of scripts and fonts and stuff I was thinking it might be easier for scripts and skins to be able to do things like this

using font sets
Code:
<label font="default">hello world</label>

using a font file that a script could include for itself in its skin folder
Code:
<label font="arial.ttf" size="20">hello world</label>

That way scripts can make windows using all sorts of pretty font and sizes and not have to rely on the skin defining them like now which makes them look crap and all font 13
Reply

Logout Mark Read Team Forum Stats Members Help
blank infotext for edit control?0