It is currently March 28th, 2024, 8:33 pm

Create "scrollbar"

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Create "scrollbar"

Post by balala »

Schuim wrote: January 24th, 2019, 6:59 pm But somehow the meter disappears after showing the last image, regardless the amount of images used.
It's going to some where I can't find it, and only appears again after an refresh.
But I would like it to restart again from the first image.
No, in fact it disappears after the third image. This is caused by a mistake into the Hidden option of all meters from [MeterImage3], to [MeterImage9]. When the [MeasureImgNo] measure becomes 2, the third image is shown. But in paralel, all subsequent Image meters are shown as well, because in each of them you have a Hidden=([MeasureImgNo]<>2) option. Replace them accordingly to the meter where they are used:

Code: Select all

[MeterImage0]
...
Hidden=([MeasureImgNo]<>0)

[MeterImage1]
...
Hidden=([MeasureImgNo]<>1)

[MeterImage2]
...
Hidden=([MeasureImgNo]<>2)

[MeterImage3]
...
Hidden=([MeasureImgNo]<>3)

[MeterImage4]
...
Hidden=([MeasureImgNo]<>4)

[MeterImage5]
...
Hidden=([MeasureImgNo]<>5)

[MeterImage6]
...
Hidden=([MeasureImgNo]<>6)

[MeterImage7]
...
Hidden=([MeasureImgNo]<>7)

[MeterImage8]
...
Hidden=([MeasureImgNo]<>8)

[MeterImage9]
...
Hidden=([MeasureImgNo]<>9)
Also check carefully the images, to not have any mistake in the used ImageName options. If there is any mistake, the appropriate image isn't shown.
Schuim wrote: January 24th, 2019, 6:59 pm Another thing, the scrolling goes rough, it show Image 1, 3, and then 9, and then the meter disappears.
You have to update both the [MeasureImgNo] measure and the images, whenever you are scrolling. Add the appropriate bangs to the MouseScrollDownAction and MouseScollUpAction options of the [MeterScrollDown/Up] meter:

Code: Select all

[MeterScrollDown/Up]
...
MouseScrollDownAction=[!SetVariable ImgNo "((#ImgNo#+1)%10)"][!UpdateMeasure "MeasureImgNo"][!UpdateMeterGroup "Images"][!Redraw]
MouseScrollUpAction=[!SetVariable ImgNo "((#ImgNo#>0)?(#ImgNo#-1):9)"][!UpdateMeasure "MeasureImgNo"][!UpdateMeterGroup "Images"][!Redraw]
For the !UpdateMeterGroup bangs to work, add a Group=Images option to all Image meters (from [MeterImage0] to [MeterImage9]).
Schuim
Posts: 3
Joined: January 23rd, 2019, 9:04 pm

Re: Create "scrollbar"

Post by Schuim »

:oops: Oops, did totally miss that mistake :oops:
An easy one to screw up all. :x

But everything now works flawless, and I can pick up my plans from here.
Thank you Balala for your time and effort :thumbup: :thumbup: :thumbup: :D :D :welcome:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Create "scrollbar"

Post by balala »

I'm always happy to help, if I can.
However I'd add one thing: if you have ten similar Image meters, it is a good idea to create a Style section, where all common options of the ten meters would be included, then use this style on all meter. For example I'd create the following section:

Code: Select all

[ImageStyle]
X=0
Y=0
W=300
H=200
DynamicVariables=1
Group=Images
Then I'd replace these options on all ten meters with one single MeterStyle=ImageStyle option. The advantage is that if you modify later something, you have to modify it only once, on this Style section and this will have effect on all meters. Details here: https://docs.rainmeter.net/manual-beta/meters/general-options/meterstyles/
User avatar
limitless
Posts: 76
Joined: January 8th, 2017, 2:31 am
Location: Charlotte, NC

Re: Create "scrollbar"

Post by limitless »

Can you post fully working script? This is very interesting :D
Image
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Create "scrollbar"

Post by eclectic-tech »

limitless wrote: March 15th, 2019, 1:12 am Can you post fully working script? This is very interesting :D
What code are you interested in...
The one from 2 months ago?
The original from 4 years ago in May?
Or the follow up 4 years ago in June?

The latest one is a fairly simple stationary image that changes with mouse scrolls through 10 different images.
Here is a working code; you just need to have 10 images in the skin "@Resources\Images\Numbers" folder. You can set the variables for your image's width and height, and add LeftMouseUpActions to the image meters (only image0 has an action now).

Code: Select all

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

[Variables]
ImgNo=0
ImgWidth=75
ImgHeight=75

[ImageStyle]
Group=Images
X=0r
Y=0r
W=#ImgWidth#
H=#ImgHeight#
DynamicVariables=1

[MeterScrollDown/Up]
Meter=image
X=0
Y=0
W=#ImgWidth#
H=#ImgHeight#
SolidColor=0,0,0,1
StringAlign=CENTERCENTER
MouseScrollUpAction=[!SetVariable ImgNo "((#ImgNo#+1)%10)"][!UpdateMeterGroup "Images"][!Redraw]
MouseScrollDownAction=[!SetVariable ImgNo "((#ImgNo#>0)?(#ImgNo#-1):9)"][!UpdateMeterGroup "Images"][!Redraw]DynamicVariables=1
DynamicVariables=1

[MeterImage0]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\0.png
LeftMouseUpAction=["https://forum.rainmeter.net/"]
Hidden=(#ImgNo#<>0)

[MeterImage1]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\1.png
Hidden=(#ImgNo#<>1)

[MeterImage2]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\2.png
Hidden=(#ImgNo#<>2)

[MeterImage3]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\3.png
Hidden=(#ImgNo#<>3)

[MeterImage4]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\4.png
Hidden=(#ImgNo#<>4)

[MeterImage5]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\5.png
Hidden=(#ImgNo#<>5)

[MeterImage6]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\6.png
Hidden=(#ImgNo#<>6)

[MeterImage7]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\7.png
Hidden=(#ImgNo#<>7)

[MeterImage8]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\8.png
Hidden=(#ImgNo#<>8)

[MeterImage9]
Meter=Image
MeterStyle=ImageStyle
ImageName=#@#Images\Numbers\9.png
Hidden=(#ImgNo#<>9)
This probably close to the original although I did not look into that.
The follow up is probably available from Mr. Spock by searching for that image.
User avatar
limitless
Posts: 76
Joined: January 8th, 2017, 2:31 am
Location: Charlotte, NC

Re: Create "scrollbar"

Post by limitless »

This is what I needed! Thank you! I'll be implementing something like this to my skin soon
Image
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Create "scrollbar"

Post by eclectic-tech »

Happy to help! :great:
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Create "scrollbar"

Post by StArL0rd84 »

It does not wrap around to create the illusion of infinite scroll, but maybe it could be modified.
examplegif.gif
https://forum.rainmeter.net/viewtopic.php?f=27&t=31765
You do not have the required permissions to view the files attached to this post.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))