It is currently April 19th, 2024, 11:20 pm

New "Tooltip" functionality in Rainmeter 1.3

Tips and Tricks from the Rainmeter Community
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

New "Tooltip" functionality in Rainmeter 1.3

Post by jsmorley »

Here is a sample skin that demonstrates some of the capabilities of JamesAC's new Tooltip function in the Rainmeter 1.3 beta http://Rainmeter.net
TestTip.rmskin

Code: Select all

[Rainmeter]
Update=500
DynamicWindowSize=1

; ToolTipText [REQUIRED]
;   Any text, including variables, #CRLF#, and if used with
;   DynamicVariables=1, the results of measures and dynamic variables
; ToolTipType
;   0 = Normal (default) 
;   1 = Bubble
; ToolTipTitle
;   Same as ToolTipText's capabilities except #CRLF# is not allowed
; ToolTipIcon
;   INFO, WARNING, ERROR, QUESTION, SHIELD (Shield only in Vista/Win7)

[MeterOne]
Meter=String
X=0
Y=0
SolidColor=150,150,150,150
FontColor=255,255,255,255
FontSize=15
Text=Meter 1
ToolTipText="This is Tip One#CRLF#With a second line#CRLF#And using the bubble sytle"
ToolTipType=1
ToolTipTitle="Rainmeter"
ToolTipIcon=INFO

[MeterTwo]
Meter=String
X=0
Y=20R
SolidColor=150,150,150,150
FontColor=255,255,255,255
FontSize=15
Text=Meter 2
ToolTipText=This is Tip Two#CRLF#With a second line#CRLF#And using the normal sytle
ToolTipType=0
ToolTipTitle=Rainmeter
ToolTipIcon=WARNING

[MeterThree]
Meter=String
X=0
Y=20R
SolidColor=150,150,150,150
FontColor=255,255,255,255
FontSize=15
Text=Meter 3
ToolTipText=This is Tip Three#CRLF#With no icon#CRLF#A title#CRLF#And using the normal sytle
ToolTipType=0
ToolTipTitle=Rainmeter

[MeterFour]
Meter=String
X=0
Y=20R
SolidColor=150,150,150,150
FontColor=255,255,255,255
FontSize=15
Text=Meter 4
ToolTipText=This is a simple one line plain tooltip
ToolTipType=0

[MeasureTime]
Measure=Time
Format=%#I:%M:%S %p

[MeasureDay]
Measure=Time
Format=%A

[MeterFive]
Meter=String
X=0
Y=20R
SolidColor=150,150,150,150
FontColor=255,255,255,255
FontSize=15
Text=Meter 5
ToolTipText=This tooltip displays#CRLF#the results of a measure.#CRLF#But only on [MeasureDay]s
ToolTipType=1
ToolTipTitle=[MeasureTime]
ToolTipIcon=INFO
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
EliteLucker
Posts: 46
Joined: June 29th, 2012, 9:06 am

Re: New "Tooltip" functionality in Rainmeter 1.3

Post by EliteLucker »

How can i use them from a lua script?

Do i need to toogle hide/see tooltip or can i set them in script?

Code: Select all

[TextDay1]
Meter						=	String
MeterStyle					=	StyleCalendarDay | StyleCalendarNewWeek

[TextDay2]
Meter						=	String
MeterStyle					=	StyleCalendarDay


[StyleCalendarDay]	
StringAlign						=	Center
StringStyle						=	Italic
StringEffect					=	Shadow
FontEffectColor					= 	#Color.Text.Effect#
FontColor						=	#Color.Text#
FontFace						=	#Font.Name#
FontSize						=	#Font.Size.Calendar.Day#
AntiAlias						=	10
DynamicVariables				=	1
x								=	#Calendar.SpacingX#r
y								=	0r
	
[StyleCalendarNewWeek]
x								=	#Calendar.FirstX#
y								=	#Calendar.SpacingY#r
in the example above is it possible to add tooltip via lua script ?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: New "Tooltip" functionality in Rainmeter 1.3

Post by smurfier »

Of course you can add a tooltip using a Lua Script.

SKIN:Bang('!SetOption',MeterName,'ToolTipText',Text)
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
EliteLucker
Posts: 46
Joined: June 29th, 2012, 9:06 am

Re: New "Tooltip" functionality in Rainmeter 1.3

Post by EliteLucker »

Ok many THX for this fast answer

Code: Select all

SKIN:Bang('!SetOption "MeterName" "ToolTipText" Text')
works fine for me but now an other question

Substitute in lua for the dynamic set Tooltip?

Code: Select all

SKIN:Bang('!SetOption "MeterName" "Substitute" Substition')
do tis works?

i will do something like this

Code: Select all

SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "ToolTipText" "'..b..'"')
				SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "ToolTipType" 0')
				SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "Substitute" Substitute.Text')
b is an integer and in Substitute.Text get the value of b an string
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: New "Tooltip" functionality in Rainmeter 1.3

Post by Kaelri »

Meters do not use Substitute strings. However, you can perform substitutions within Lua, and then change the meter Text directly:

Code: Select all

Substitute.Text = string.gsub(Substitute.Text, 'Old Text', 'New Text')
SKIN:Bang('!SetOption "'..sMeterPrefix..'Day'..a..'" "Text" '..Substitute.Text)
(More about string.gsub here.)
EliteLucker
Posts: 46
Joined: June 29th, 2012, 9:06 am

[solved] New "Tooltip" functionality in Rainmeter 1.3

Post by EliteLucker »

OK some typing failure of me its working now