It is currently April 28th, 2024, 5:03 am

Modifying quote reader with mouse click action

Get help with creating, editing & fixing problems with skins
Merlinone
Posts: 12
Joined: January 31st, 2011, 4:39 am

Modifying quote reader with mouse click action

Post by Merlinone »

Ok heres the situation, I have a quote reader that extracts and displays quotes from a txt document every x amount of time, but sometimes I would like to be able to middle mouse click on it and have it bring up a new quote, is there any way to do this with my code?

Code: Select all

[Rainmeter]
Update=2000
DynamicWindowSize=1

[MeasureQuote]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="C:\Documents and Settings\New\My Documents\List of quotes.txt"
Separator="//"
UpdateDivider=600

[MeterQuote]
Meter=String
MeasureName=MeasureQuote
FontSize=11
FontColor=255,255,255,255
W=400
H=300
ClipString=1
AntiAlias=1

Also, I've looked at the rainmeter manual and it says sometimes it's useful to add SolidColor=0,0,0,1 to the meter to have a transparent background that means I don't have to be too precise with my clicks. Where would I put this into the code?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Modifying quote reader with mouse click action

Post by jsmorley »

Merlinone wrote:Ok heres the situation, I have a quote reader that extracts and displays quotes from a txt document every x amount of time, but sometimes I would like to be able to middle mouse click on it and have it bring up a new quote, is there any way to do this with my code?

Code: Select all

[Rainmeter]
Update=2000
DynamicWindowSize=1

[MeasureQuote]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="C:\Documents and Settings\New\My Documents\List of quotes.txt"
Separator="//"
UpdateDivider=600

[MeterQuote]
Meter=String
MeasureName=MeasureQuote
FontSize=11
FontColor=255,255,255,255
W=400
H=300
ClipString=1
AntiAlias=1

Also, I've looked at the rainmeter manual and it says sometimes it's useful to add SolidColor=0,0,0,1 to the meter to have a transparent background that means I don't have to be too precise with my clicks. Where would I put this into the code?

[MeterQuote]
Meter=String
MeasureName=MeasureQuote
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
W=400
H=300
ClipString=1
AntiAlias=1
MiddleMouseUpAction=!RainmeterRefresh #CURRENTCONFIG#
Merlinone
Posts: 12
Joined: January 31st, 2011, 4:39 am

Re: Modifying quote reader with mouse click action

Post by Merlinone »

I've done that but now it has a huge invisible area in which you have to click several times in different areas to get it to perform the mouse action
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Modifying quote reader with mouse click action

Post by smurfier »

Try using the !RainmeterUpdateMeasure bang on the measure in which you use the quote plugin.

Code: Select all

[MeterQuote]
Meter=String
MeasureName=MeasureQuote
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
W=400
H=300
ClipString=1
AntiAlias=1
MiddleMouseUpAction=!RainmeterUpdateMeasure MeasureQuote
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 . . .
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Modifying quote reader with mouse click action

Post by jsmorley »

Actually, MiddleMouseUpAction=!RainmeterUpdateMeasure MeasureQuote is probably a nicer way to go with this, as you get better "randomizing" that way instead of refreshing.

However, it has nothing at all to do with the problem you are describing with mouse clicks. Can you post your entire skin in "code" tags again?


Edit: Actually it might have something to do with it. In looking at it, Quote Plugin is actually kinda broken. If you refresh it more than once using !RainmeterRefresh, it seems to just get stuck on one quote and has to either be fully refreshed using the context menu or wait for UpdateDivider to hit before you can get another one. So it seems like it is not responding, but it really was just returning the same quote over and over. Using MiddleMouseUpAction=!RainmeterUpdateMeasure MeasureQuote doesn't have this issue.
Merlinone
Posts: 12
Joined: January 31st, 2011, 4:39 am

Re: Modifying quote reader with mouse click action

Post by Merlinone »

It's weird, I put the MiddleMouseUpAction=!RainmeterUpdateMeasure MeasureQuote into the code, and when I middle click I get an error message stating "Unknown !bang: !RainmeterUpdateMeasure"

Code: Select all

[Rainmeter]
Update=2000
DynamicWindowSize=1

[MeasureQuote]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName="C:\Documents and Settings\New\My Documents\List of quotes.txt"
Separator="//"
UpdateDivider=600

[MeterQuote]
Meter=String
MeasureName=MeasureQuote
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
W=400
H=300
ClipString=1
AntiAlias=1
MiddleMouseUpAction=!RainmeterUpdateMeasure MeasureQuote
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Modifying quote reader with mouse click action

Post by jsmorley »

What version of Rainmeter are you using?
Merlinone
Posts: 12
Joined: January 31st, 2011, 4:39 am

Re: Modifying quote reader with mouse click action

Post by Merlinone »

1.3, I should really update shouldn't I?
Merlinone
Posts: 12
Joined: January 31st, 2011, 4:39 am

Re: Modifying quote reader with mouse click action

Post by Merlinone »

Just upgraded, that fixed the problem, thanks guys