Topic: xModule and xLabel questions
Is it possible to have a text within a text in a different color then the rest.
If i for example want to have "Your cpu is running at [cpu]." and then have [cpu] in a different color?
Found it =)
xPaintHTMLText
Please see this forum thread
view the old Litestep.info page
You are not logged in. Please login or register.
LiteStep Community Forums → Module Discussion → xModule and xLabel questions
Is it possible to have a text within a text in a different color then the rest.
If i for example want to have "Your cpu is running at [cpu]." and then have [cpu] in a different color?
Found it =)
xPaintHTMLText
Yes it is,
just add <font color=#B40404> [cpu] </font>, you can use <b></b> for bold etc ....
Question N° 2
I have three (x)Labels that i want to switch between by scrolling the mouse up and down.
Without any fancy animations for starter, is it possible without scripts (as i remember was used before)?
I'm guessing !LabelHide/Show can be used but i cant get it there.
Any hints and/or suggestions?
The label content is all text and no images used, just dark background (see Carbon 6 in theme-forum) so any tip on animations could be useful too, i thinking simple scroll like its all on a screen or something.
you will want only one label, with all text separeted by ";" (i dont remember very well, please read the xLabel docs) like this:
(LabelName)text "this is text 1;this is text 2;this is text 3"
and use !LabelNext/Previous to switch between contents "onscrollup/down".
Ah again.
That's perfect with one exception.
I have a lot of text that is formatted and the whole thing makes it hard to read.
Is there a way to make the text in multiple rows (not wordwrap)?
e. g.
Your System disk (Carrot) has 17.7GB of free space out of 74.5GB.
Your F: disk (Angua) has 11.11GB of free space out of 74.4GB.
Your G: disk (Vimes) has 49.7gb of free space out of 465GB.
Your I: disk (HDD I) has 5.18GB of free space out of 1.81TB.
Is
Your System disk (Carrot) has 17.7GB of free space out of 74.5GB. Your F: disk (Angua) has 11.11GB of free space out of 74.4GB. Your G: disk (Vimes) has 49.7gb of free space out of 465GB. Your I: disk (HDD I) has 5.18GB of free space out of 1.81TB.
And that's just one of the labels and with formatting its a lot more.
So, is there a way to have Text in multiple rows but in the same label?
Just make use of "<br>" html tag.
Like this:
some text <br>more text<br>anything you want
it will bring:
some text
more text
anything you want
Its not the result but the editing.
I want the text on different rows in the rc-file as well, for easier editing and overview.
This is a lot of text and without proper SyntaxHighlight is's hard see whats what and to edit (add,change,remove).
"The clock is <font color=#ffaf31>[time('ii:nn')]</font> on a <font color=#a7f390>[date('dddd')]</font>, <font color=#a7f390>[date('mmmm d')]</font>.<br>You've been online for <font color=#ffaf31>[uptime('ii')]</font> hours and <font color=#ffaf31>[uptime('nn')]</font> minutes.;Your <font color=#a7f390>CPU</font> is working at <font color=#ffaf31>[cpu]%</font>.<br>Your <font color=#fe6c6b>RAM</font> usage is <font color=#ffaf31>[memInUse(GB)]GB</font> out of your <font color=#ffaf31>[memTotal(GB)]GB</font> total.<br><br>Your <font color=#a7f390>System</font> disk (<font color=#a7f390>Carrot</font>) has <font color=#ffaf31>17.7GB</font> of free space out of <font color=#ffaf31>74.5GB</font>.<br>Your <font color=#fe6c6b>F:</font> disk (<font color=#fe6c6b>Angua</font>) has <font color=#ffaf31>11.11GB</font> of free space out of <font color=#ffaf31>74.4GB</font>.<br>Your <font color=#a7f390>G:</font> disk (<font color=#a7f390>Vimes</font>) has <font color=#ffaf31>49.7gb</font> of free space out of <font color=#ffaf31>465GB</font>.<br>Your <font color=#fe6c6b>I:</font> disk (<font color=#fe6c6b>HDD I</font>) has <font color=#ffaf31>5.18GB</font> of free space out of <font color=#ffaf31>1.81TB</font>.;Your <font color=#fe6c6b>Download</font> speed is <font color=#ffaf31>[netin('adapterindex')]</font> and your <font color=#fe6c6b>Upload</font> is <font color=#ffaf31>[netout('adapterindex')]</font>.<br>You have <font color=#a7f390>Downloaded</font> <font color=#ffaf31>[nettotalin('adapterindex')]</font> and <font color=#a7f390>Uploaded</font> <font color=#ffaf31>[nettotalout('adapterindex')]</font> since your last reboot.;label 3;label 4;label 5"
so all you need is this:
$ConfigDir$yourtext.txt
multiline text<br>some text
more text
anything you want
and:
(LabelName)Text "[line('$ConfigDir$yourtext.txt','1')];[line('$ConfigDir$yourtext.txt','2')];[line('$ConfigDir$yourtext.txt','3')]"
(LabelName)OnWheelUp !LabelNext (LabelName)
(LabelName)OnWheelDown !LabelPrevious (LabelName)
It seems like there is some trouble finding files for me with line() or fileExists().
This problem was salved with evars but it would be nice to know why i couldn't find any of the files.
Try fix this:
ConfigDir "$ThemeDir$cfg"
With this:
ConfigDir "$ThemeDir$cfg\"
btw...you can also put all of your formatting into evars if you want...might make it a little easier for maintenance.
DiamondXplosion:
Don't really need it anymore since i use evars but i will try it out just to see if it works.
DeViLbOi:
Evars for all the <font color=131313></font> you mean?
DeViLbOi sugested something like this:
Time "[time('ii:nn')]"
Date ...
System
and so on.
Actually...I was speaking to the <font> information.
"The clock is $ColorA$[time('ii:nn')]$ColorClose$ on a $ColorB$[date('dddd')]$ColorClose$, $ColorB$[date('mmmm d')]$ColorClose$.<br>
You've been online for $ColorB$[uptime('ii')]$ColorClose$ hours and $ColorA$[uptime('nn')]$ColorClose$ minutes.;
Your $ColorB$CPU$ColorClose$ is working at $ColorA$[cpu]%$ColorClose$.<br>"
I did some testing with $configdir$labels.txt and [line ('')] textescape sequence and if you put [time ('ii: nn')] within labels.txt, xlabel not recognized as textescape, but as normal text.
eg:
(Labelname)Text "[line('$ConfigDir$labels.txt', '1')]"
results (on Label):
Your time is [time('ii:nn')]
Ah, well then.
And I've put all the formatting into evars, works darn well.
Makes it a lot easier too change colors since i use the colorevars in the font-evars so now one only needs to change it on one place. very usefull!
LiteStep Community Forums → Module Discussion → xModule and xLabel questions
Powered by PunBB, supported by Informer Technologies, Inc.
The pun_posts_feed official extension is installed. Copyright © 2003–2010 PunBB.
Please see this forum thread
view the old Litestep.info page