Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 703

Need a little help with getting an If Condition to do a different Mouse Click Action

$
0
0
So, I've been working on my first skin (a mashup of a bunch of others) as I learn the Rainmeter and, essentially, how to program sorta, I guess. Context: I have zero coding knowledge, but nevertheless I've mostly succeeded and it works great!

The skin displays the shortform date and time by default, but when you mouse over it (I've done this by implementing a transparent hitbox---fun!), it expands to show the longform date, time with seconds, and some system info (CPU usage, RAM usage, and CPU Average Temp); when you mouse away, it reverts to the simple view (just the shortfrom date and time). I've also set it so that when I click on the skin, it stays in the expanded view until I click again. All this works perfectly, except that I want to implement a feature (a mostly UX thing, I guess) that when I click the expanded, "frozen" view, it immediately collapses to the simple view, bypassing the mouseover hover feature. This is the beginning of my issues.

Now, I've been learning the ropes, and successfully implemented a "ClickCounter" Measure into the skin that, when I click the widget's hitbox, the counter changes for "0" to "1" and resets to again after the second click (it's fun to watch it work in the log) BUT the main toruble I'm having is setting an IfCondtion that if the counter equals 1, ONLY THEN should it collapse the view, but NOT if the skin is in its default state, i.e the counter equals 0.

This is where I need the help, please! What I've got (minus irrelevant meters and measures, etc) is:

Code:

[Rainmeter]...[Variables]ClickCount=0MaxClickCount=1;Measures...[MeasureClickCount]Measure=CalcFormula=(MeasureClickCount)%(#MaxClickCount#+1)DynamicVariables=1UpdateDivider=-1;Meters...[MeterHitBox]...LeftMouseUpAction=[!ToggleMouseAction MeterHitBox "MouseOverAction|MouseLeaveAction"] [!SetOption MeasureClickCount Formula "(MeasureClickCount+1)%(#MaxClickCount#+1)"] [!UpdateMeasure MeasureClickCount]IfCondition=MeasureClickCount = 1IfTrueAction=[!SetOption MeterHitBox LeftMouseUpAction "[!ToggleMouseAction MeterHitBox "MouseOverAction"] [!PauseMeasureGroup System] [!ToggleMeterGroup Expand] [!ToggleMeterGroup Simple] [!UpdateMeasureGroup Simple] [!Redraw]"]
I'm not sure why, but it's not working :( If any one could have a look and let me know what I'm doing wrong, I would be much appreciative!

Please and thank you :)

Statistics: Posted by mmmajorthommm — Today, 12:24 pm — Replies 4 — Views 32



Viewing all articles
Browse latest Browse all 703

Trending Articles