It is currently February 25th, 2021, 10:30 pm

New Shape Meter

Changes made during the Rainmeter 4.0 beta cycle.
User avatar
Yincognito
Posts: 3015
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

Youkai1977 wrote: January 30th, 2021, 1:41 am My problem is this:

In the meter [MenuPoint] the Shape = Rectangle 0,4,18,0 | StrokeWidth 9 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient | StrokeEndCap Triangle | Offset 0, #CURRENTSECTION# should always move to the menu item where the mouse is is on it.
That works great too.
But the Shape2 = Rectangle 2,0,2,506 | StrokeWidth 1 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient should stay on its coordinates. It also moves with what it should NOT.
Of course that doesn't work.
Sure, I could do an extra meter for the 2nd shape and it would be done.
But then what I plan to do doesn't work out.
Namely Shape3 = Combine Shape | Union Shape2 which should still be installed.
Because if Shape2 has an extra meter, I can hardly do the latter command.

The main actors in my skin are currently: [Style6] & [MenuPoint]

I hope I have expressed myself clearly and you understand what I want to achieve in my skin.
Who can help me here?

PS: I have included the (still) necessary graphics, if they are needed when you are testing / correcting the skin

OK, at least I'm going to do eye care first. It's 2:35 in the morning and at the weekend it's family first. So answer from me could take time.
Well, almost. You did include the code, but didn't include the external entities, like include files, images, etc. Anyway, for me it doesn't really matter, because in the simulated basic example below, all works out well:

Code: Select all

[Variables]
Offset=0

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Meters---

[MenuPoint]
Meter=Shape
X=0
Y=0
Shape=Rectangle 1,1,100,100 | StrokeWidth 1 | Stroke Color 0,0,0,255 | Fill Color 255,0,0,255 | Offset 0,#Offset#
Shape2=Rectangle 1,1,20,20 | StrokeWidth 1 | Stroke Color 0,0,0,255 | Fill Color 0,0,255,255  
UpdateDivider=-1
MouseOverAction=[!SetVariable Offset 50][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetVariable Offset 0][!UpdateMeter #CURRENTSECTION#][!Redraw]
DynamicVariables=1
So the fact that for you it doesn't work has nothing to do with how shape meters behave. Now that we took this possibility out, try to replace #Offset# with #CURRENTSECTION# in the first Shape - nothing happens. The reason is clear: Offset 0,#CURRENTSECTION# becomes Offset 0,MenuPoint. There isn't any value associated with MenuPoint, so the thing is just defaulted to 0 and basically nothing happens.

Now I don't know all the ins and outs in your skin, but it looks to me that you'd want the value of [Item_Number:Y] there, where Number would be the number of the currently hovered item meter. This only works using #CURRENTSECTION# if the Shape is part of the [Item_Number] section - which is not, as far as I can see. Otherwise, you'd need to identify somehow the Item that is hovered by the mouse. The thing is, mouse variables only work for clicks or scrolls, and not for hovering. For that, there are various mouse plugins where you can use mouse variables in the case of hover as well.

I have no idea if I understood what your actual goal is, so if I didn't or I missed something, let us know.

EDIT: If I think about it, you don't even need mouse variables, you only need to set some Index variable to the index of the item that is hovered, on hovering that meter. Basically, a MouseOverAction=[!SetVariable SomeIndex TheIndexOfThisItem] in all the item meters, then use SomeIndex in the above Shape, like Offset 0,[Item_#SomeIndex#:Y] or even Offset 0,[&Item_[#SomeIndex]:Y] if nesting variables help here.

EDIT2: On an even better look at the code, it looks like Style6, which you use in all the item meters, has [!SetOption MenuPoint Y [#CURRENTSECTION#:Y]], so that's why both shapes move ... because the meter itself moves.
User avatar
Youkai1977
Posts: 72
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: New Shape Meter

Post by Youkai1977 »

EDIT2: On an even better look at the code, it looks like Style6, which you use in all the item meters, has [!SetOption MenuPoint Y [#CURRENTSECTION#:Y]], so that's why both shapes move ... because the meter itself moves.
So, just for a moment, as I said, I'm actually on the family weekend and Rainmeter would have to wait.
But with the effort you have made, I wanted to answer briefly, because you have tried very hard to find a solution to my problem.
But ... unfortunately a little past the goal. Because only in your EDIT2: (quoted here) you have roughly hit what doesn't work for me.
And that's what it was all about. The entire meter should not move, only the (first) SHAPE contained therein.
It should always jump to the position where the mouse is when it is on a link (MouseOverAction). Everything in [Style6] under MouseOverAction.

But well, even if you missed the target with your proposed solution or even partially missed it, your effort should not be in vain for me.

I found the solution this morning, totally tired and feeling like Garfield without coffee.

Look here:

Code: Select all

[Style6]
InlineSetting=#GColor_1#
InlineSetting2=#SColor_1#
MouseOverAction=[!ShowMeter MenuPoint][!SetVariable "ShapeYCor" "(9 + [#CURRENTSECTION#:Y])"][!UpdateMeter MenuPoint][!SetOption #CURRENTSECTION#  InlineSetting "#GColor_2#"][!SetOption #CURRENTSECTION#  InlineSetting2 "#SColor_2#"][!SetOption #CURRENTSECTION# FontWeight "#BigFont#"][!SetVariable "Width" "#SetVarWidth#"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!HideMeter MenuPoint][!SetOption #CURRENTSECTION#  InlineSetting "#GColor_1#"][!SetOption #CURRENTSECTION#  InlineSetting2 "#SColor_1#"][!SetOption #CURRENTSECTION# FontWeight "#SmallFont#"][!SetVariable "Width" "#Width#"][!UpdateMeter #CURRENTSECTION#][!Redraw]

[MenuPoint]
Meter=Shape
X=0
Y=0
Shape=Line 0,0,12,0 | StrokeWidth 7 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient | StrokeEndCap Triangle | Offset 2,#ShapeYCor#
Shape2=Rectangle 2,0,2,502 | StrokeWidth 1 | Stroke LinearGradient StrokeGradient | Fill RadialGradient FillGradient
;Shape3=Combine Shape | Union Shape2
StrokeGradient=90 | #Color1##Alpha3# ; 0.0 | #Color5##Alpha3# ; 1.0
FillGradient=0,0,0,0,170,50 | #Color5##Alpha6# ; 0.0 | #Color1##Alpha5# ; 1.0
DynamicVariables=1
UpdateDivider=-1
Hidden=1
[!SetVariable "ShapeYCor" "(9 + [#CURRENTSECTION#:Y])"] <-> That was the part that had to be corrected by giving commands to set a variable. Called here by me "ShapeYcor" (for Shape Y Coordinate).
The (9 + [#CURRENTSECTION#:Y]) contains a "9" is only because otherwise the shape would not have been completely centered on the horizontal axis of the text. So for me a visual flaw which I could eliminate with the "9". :sly:

I don't know whether this is an optimal / correct or perfect solution, but at least one that works for me for the time being, and so I can now concentrate again on converting my slider-launcher.

If you or someone else has a better / cleaner solution, of course, I'll be all ears. :-)

The only thing that doesn't quite work now, and that's why I deactivated it again in the Meter [MenuPoint], is "Shape3", which is why I put all the effort into it. It works for the command, but unfortunately the graphic result is not what I wanted. But well ... I'll keep testing ... next week

PS .: I followed your tip with Notepad ++ and the RainLexer.
What can I say?! It takes a little getting used to for me. But I already wonder how I could ever work without Notepad ++
User avatar
Yincognito
Posts: 3015
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

Youkai1977 wrote: January 31st, 2021, 12:05 amBut ... unfortunately a little past the goal. Because only in your EDIT2: (quoted here) you have roughly hit what doesn't work for me. [...] But well, even if you missed the target with your proposed solution or even partially missed it, your effort should not be in vain for me.
[!SetVariable "ShapeYCor" "(9 + [#CURRENTSECTION#:Y])"] <-> That was the part that had to be corrected by giving commands to set a variable. Called here by me "ShapeYcor" (for Shape Y Coordinate).
Well, I guess it depends on how you look at it, LOL. Although the form of the solution I proposed wasn't precisely how you implemented it, the idea was the same. You had to get rid of #CURRENTSECTION# from Offset 0,#CURRENTSECTION# and replace it with a variable holding the Y position of the item; the only difference was that I proposed storing the item index as a variable and use it to get the [Item_ItemIndex:Y], which is why I said:
Yincognito wrote: January 30th, 2021, 2:04 pm...it looks to me that you'd want the value of [Item_Number:Y] there, where Number would be the number of the currently hovered item meter.
and further explored the approach in my first EDIT, while you, on the other hand, stored that Y directly as a variable in the snippet you mentioned from [Style6]'s MouseOverAction.

But yeah, the part where I talked about mouse variables was unnecessary, since you could get the item's Y without it - hence my edits and your eventual solution. Anyway, I think it's better when folks find solutions themselves (as opposed to copying or replicating stuff from others), cause doing so helps them get better at what they do, so it's all good - well done! :thumbup:
Youkai1977 wrote: January 31st, 2021, 12:05 amPS .: I followed your tip with Notepad ++ and the RainLexer.
What can I say?! It takes a little getting used to for me. But I already wonder how I could ever work without Notepad ++
Yep, the big advantage is the text's colors - it makes much easier identifying bits of the code. Add a dark theme to it and it will be softer on the eyes as well:
Notepad++ INI.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Youkai1977
Posts: 72
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: New Shape Meter

Post by Youkai1977 »

Yincognito wrote: January 31st, 2021, 1:46 am Well, I guess it depends on how you look at it, LOL. Although the form of the solution I proposed wasn't precisely how you implemented it, the idea was the same. You had to get rid of #CURRENTSECTION# from Offset 0,#CURRENTSECTION# and replace it with a variable holding the Y position of the item; the only difference was that I proposed storing the item index as a variable and use it to get the [Item_ItemIndex:Y], which is why I said:

and further explored the approach in my first EDIT, while you, on the other hand, stored that Y directly as a variable in the snippet you mentioned from [Style6]'s MouseOverAction.
As I said, I didn't criticize you or your approach. On the contrary, it was clear that you had made the right move.
And ultimately, who knows what it's good for, it shouldn't be a bad thing to have several solutions at hand. Because if Rainmeter taught me one thing, a solution doesn't always have to work twice. :???:
Anyway, I think it's better when folks find solutions themselves (as opposed to copying or replicating stuff from others), cause doing so helps them get better at what they do, so it's all good - well done! :thumbup:
Thank you for the praise.
Yes that's probably true, learn by doing it yourself.
But scouring the forum and other sources, and possibly copying first, I still like to use it.
However, this method has often been, and is current to me, precisely now also the undoing.
Because if you don't really deal with what code snippet / syntax etc. is actually there for what, then in the worst case it will be really tight with your own knowledge.
Because that's exactly what I actually took with my current SKIN suite. I started by copying it in 2014. And over the years I only changed the look and layout. Seldom has a function been added or something similar.
And so we are now writing in 2021, I have been using Rainmeter for 7 years now and basically don't really know anything about the code basics.
But that should change now, as I said, I really want to be able to say that "I" did and created it.
For me, however, really difficult, because there would still be the language barrier. Forums or something similar, certainly not such a good manual like "https://docs.rainmeter.net/" in my language "German" is almost an absurdity. Sometimes I have the feeling that nobody in Germany knows Rainmeter. Only Facebook, Instagram, Youtube ... and currently Corona -.-
Yep, the big advantage is the text's colors - it makes much easier identifying bits of the code. Add a dark theme to it and it will be softer on the eyes as well:
Yes with the colors is really a relief. I also set it so dark. Really nice. Also the tab function as with the browser.
But there are also a few things to which I still have to get used to and which I currently consider to be a hindrance. But let's see, I don't understand the Rainmeter syntax (always) and still use it * lol *
User avatar
Yincognito
Posts: 3015
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

Youkai1977 wrote: January 31st, 2021, 7:40 pm As I said, I didn't criticize you or your approach. On the contrary, it was clear that you had made the right move.
And ultimately, who knows what it's good for, it shouldn't be a bad thing to have several solutions at hand. Because if Rainmeter taught me one thing, a solution doesn't always have to work twice. :???:

Thank you for the praise.
Yes that's probably true, learn by doing it yourself.
But scouring the forum and other sources, and possibly copying first, I still like to use it.
However, this method has often been, and is current to me, precisely now also the undoing.
Because if you don't really deal with what code snippet / syntax etc. is actually there for what, then in the worst case it will be really tight with your own knowledge.
Because that's exactly what I actually took with my current SKIN suite. I started by copying it in 2014. And over the years I only changed the look and layout. Seldom has a function been added or something similar.
And so we are now writing in 2021, I have been using Rainmeter for 7 years now and basically don't really know anything about the code basics.
But that should change now, as I said, I really want to be able to say that "I" did and created it.
For me, however, really difficult, because there would still be the language barrier. Forums or something similar, certainly not such a good manual like "https://docs.rainmeter.net/" in my language "German" is almost an absurdity. Sometimes I have the feeling that nobody in Germany knows Rainmeter. Only Facebook, Instagram, Youtube ... and currently Corona -.-

Yes with the colors is really a relief. I also set it so dark. Really nice. Also the tab function as with the browser.
But there are also a few things to which I still have to get used to and which I currently consider to be a hindrance. But let's see, I don't understand the Rainmeter syntax (always) and still use it * lol *
Yes, you can approach things in various ways in Rainmeter. I probably should have been clearer in my reply in terms of the code, but as I said, I didn't have the skin dependencies and probably the fact that my resolution is just 1366 x 768 wouldn't have helped either, even if I was able to run it. ;-)

What I meant with doing stuff yourself is that personally, I'm satisfied when someone I tried to help is developing the idea and comes with a self-made improvement, variant or an original implementation. I'm not too fond of "serving things on a plate" (unless I see it as a challenge), if you know what I mean, and I think the best outcome is reached when both parties make an effort - that was the thing I was trying to convey, and the reason why I praised your effort.

Yep, if you only do something rarely or make a break from doing something, that thing is gradually forgotten or not quite mastered. I experienced this as well, having a break from coding in Rainmeter for a while, and then, when I got back to it, having some difficulties remembering why and how I did or I should do stuff... in my own code. :lol:

Regarding the language barrier, let's look at the bright side: apart from exercising with Rainmeter, you can exercise a bit with English as well. Since the manual is always subject to change, is difficult to maintain it in several languages, so it is what it is. And yes, Rainmeter is not as widely used as, say, Windows and others, but I think it does well nevertheless.
User avatar
Youkai1977
Posts: 72
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: New Shape Meter

Post by Youkai1977 »

Yincognito wrote: January 31st, 2021, 9:37 pm Yes, you can approach things in various ways in Rainmeter.
I noticed that though.
And that is also what sometimes confuses or doubts me, although the latter is probably unnecessarily worrying. Because if the fact that different ways / solutions bring the same goal, then the thought arises which solution might be the better one. To take up the topic of my visualizer again, e.g. when it comes to optimizing the CPU load, etc. Or for flexibility on different PC configurations etc.
I probably should have been clearer in my reply in terms of the code, but as I said, I didn't have the skin dependencies and probably the fact that my resolution is just 1366 x 768 wouldn't have helped either, even if I was able to run it. ;-)
In the case of my launcher, there is actually only the dependency that the colors should be the same as my other meters. So that the entire suite looks coherent and uniform later.
As for your resolution, that sounds like a laptop and then really not very high. Which brings us back to the subject of customizable / scalable skins ...
What I meant with doing stuff yourself is that personally, I'm satisfied when someone I tried to help is developing the idea and comes with a self-made improvement, variant or an original implementation. I'm not too fond of "serving things on a plate" (unless I see it as a challenge), if you know what I mean, and I think the best outcome is reached when both parties make an effort - that was the thing I was trying to convey, and the reason why I praised your effort.
It is true, if you always get everything served directly, the will to make an effort, e.g. to find solutions yourself, disappears. The exchange between "balala" and me is based on this when he said I should ask if the shoe pinches. But there is pride. You want to try it yourself first.
Yep, if you only do something rarely or make a break from doing something, that thing is gradually forgotten or not quite mastered. I experienced this as well, having a break from coding in Rainmeter for a while, and then, when I got back to it, having some difficulties remembering why and how I did or I should do stuff... in my own code. :lol:
Oh my god, yeah as I know it, or that's exactly what I meant.
You start again after an eternal break and you no longer understand your own skin that you once made.
I even had it the day before yesterday with my visualizer when I looked into the SHAPE meter again. I sat there like this -> O.O :???:
Regarding the language barrier, let's look at the bright side: apart from exercising with Rainmeter, you can exercise a bit with English as well. Since the manual is always subject to change, is difficult to maintain it in several languages, so it is what it is. And yes, Rainmeter is not as widely used as, say, Windows and others, but I think it does well nevertheless.
I also noticed that the manual changes or is updated frequently. And yes, English, I definitely have to kneel behind me again. Today, unfortunately, my attitude from school takes revenge. It read: "What should I do with English, I live in Germany"
So, don't just understand Rainmeter, English too. The latter if my child arrives soon and needs help with their English homework ... otherwise it could be embarrassing :oops:
User avatar
Yincognito
Posts: 3015
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

Youkai1977 wrote: January 31st, 2021, 10:03 pm I noticed that though.
[...]
I also noticed that the manual changes or is updated frequently. And yes, English, I definitely have to kneel behind me again. Today, unfortunately, my attitude from school takes revenge. It read: "What should I do with English, I live in Germany"
So, don't just understand Rainmeter, English too. The latter if my child arrives soon and needs help with their English homework ... otherwise it could be embarrassing :oops:
Agreed on all points. Your point about language is pragmatic indeed, but then nowadays nobody really lives isolated or restricted to his own country, so knowing some basics in a foreign language can sometimes be useful.
User avatar
Youkai1977
Posts: 72
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: New Shape Meter

Post by Youkai1977 »

Agreed on all points. Your point about language is pragmatic indeed, but then nowadays nobody really lives isolated or restricted to his own country, so knowing some basics in a foreign language can sometimes be useful.
It was pragmatic back then, which, as I said, I regret today and which is now becoming a serious disadvantage for me.
See what I just posted here -> https://forum.rainmeter.net/viewtopic.php?f=5&t=36847

This is not only due to my lack of knowledge of the Rainmeter syntax, but also to the fact that I do not understand the great online manual well enough to find a solution to my problem due to my poor English. :( :-(