It is currently April 27th, 2024, 11:44 am

[CANCELED] Fileview Scrollbar...

Get help with creating, editing & fixing problems with skins
User avatar
exper1mental
Posts: 269
Joined: January 9th, 2013, 7:52 pm
Location: Clemson University

[CANCELED] Fileview Scrollbar...

Post by exper1mental »

***NOTICE: I've decided to drop the ball on this one until I get some other stuff completed for this skin.***



Important: Bear in mind I am still a novice at RM scripting.

Current Issue:
I'm having a little trouble though getting the Bar to work correctly in displaying the percentage of the folder being displayed. Instead of showing the percentage of the folder it shows 100% being viewed all the time.

Note: Once I get this working I'll move on to getting Y to move accordingly.

Here is the bar and measures in question:

Code: Select all

[ScrollPosition]
Meter=Bar
MeasureName=MeasureScrollBarHeight
BarColor=150,150,150,200
SolidColor=100,100,100,255
x=r
y=(0*10)+#MenuY#+16
h=420
w=9
BarOrientation=Vertical
Flip=1
AntiAlias=1
Hidden=1

[MeasureScrollBarHeight]
Measure=Calc
Formula=(100 / ((MeasureFolderCount + MeasureFileCount) / #ItemCount#))
Disabled=1
FinishAction=[!UpdateMeter ScrollPosition]

[MeasureFolderCount]
Measure=Plugin
Plugin=FileView
Path=[MeasurePath]
Type=FolderCount
Disabled=1
Group=StartMenuMeasure

[MeasureFileCount]
Measure=Plugin
Plugin=FileView
Path=[MeasurePath]
Type=FileCount
Disabled=1
Group=StartMenuMeasure

[MeasurePath]
Measure=Plugin
Plugin=FileView
Path="#StartMenuPath#"
ShowHidden=0
HideExtensions=1
Count=#ItemCount#
FinishAction=[!EnableMeasure MeasureScrollBarHeight][!ShowMeter ScrollPosition][!UpdateMeterGroup StartMenu]
Disabled=1
Group=StartMenuMeasure
Variables (in case they are relevant):

Code: Select all

StartMenuPath=%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs
MenuY=66
ItemCount=25
Stripped version of program is included in this RMskin (fileview won't display correctly if using XP):
Start Menu Scrolling Issue_3.0.rmskin
Once the skin is loaded, click the arrow bar. You should see a stripped bar with arrows pointing in opposite directions. This is the background for the scrolling bar.

Move your mouse to the left of it and it should turn a solid dark grey (this is a bug relating to the striped down version, but not the full), which is supposed to be the secondary color of the bar (when I get the bar working this will be transparent).

If you try scrolling the bar will turn a solid light gray, but not in proportion to the amount of files being shown. This is the problem in question that I need help with.



Old Issue (ignore):
Is it possible to measure the number of folders and/or files in a folder fileview is displaying (not the number of slots that fileview can show something in, the number that is in the folder)?

This is what I'm trying to work out:

Code: Select all

[MeasureScrollPosition]
Measure=Calc
Formula=(MeasureFolderCount + MeasureFileCount)
Hidden=1
Group=StartMenu
Which is used for

Code: Select all

[ScrollPosition]
Meter=Bar
MeasureName=MeasureScrollPosition
x=r
y=r
BarOrientation=Vertical
BarImage=#@#Images\Scroll.png
Imagetint=123,123,123,255
Flip=1
AntiAlias=1
Hidden=1
Group=StartMenu

Thanks!
You do not have the required permissions to view the files attached to this post.
Last edited by exper1mental on February 9th, 2013, 2:52 am, edited 8 times in total.
Image
User avatar
Brian
Developer
Posts: 2686
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fileview Measures...

Post by Brian »

At this time there is no way for the FileView plugin to "know" the position of what items are in the "list". This was a feature of the FileList plugin that I did not implement into the FileView plugin. The main reason is because scrollbars are not really doable with Rainmeter at this time. You can "fake" it with a Bar meter, but it still does not really behave like a true scrollbar.

Although I don't have any plans to include this feature at this time, who knows what the future may hold...

-Brian
User avatar
exper1mental
Posts: 269
Joined: January 9th, 2013, 7:52 pm
Location: Clemson University

Re: Fileview Measures...

Post by exper1mental »

Brian wrote:At this time there is no way for the FileView plugin to "know" the position of what items are in the "list". This was a feature of the FileList plugin that I did not implement into the FileView plugin. The main reason is because scrollbars are not really doable with Rainmeter at this time. You can "fake" it with a Bar meter, but it still does not really behave like a true scrollbar.

Although I don't have any plans to include this feature at this time, who knows what the future may hold...

-Brian
Right now I'm not worried about knowing the position, I simply want to know how many items (preferably individually files and folders) are in the folder that FileView is aimed at.

The part that's not possible based on what your saying is to know where something is on the list. However, I'd still like to give it a shot as I might be able to "know" positions via detecting scrolling or the pushing of scrolling buttons.
Image
User avatar
Brian
Developer
Posts: 2686
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fileview Measures...

Post by Brian »

exper1mental wrote:Right now I'm not worried about knowing the position, I simply want to know how many items (preferably individually files and folders) are in the folder that FileView is aimed at.
Check out the types FileCount and FolderCount.

You basically will use them like this:

Code: Select all

[MeasureFolderCount]
Measure=Plugin
Plugin=FileView
Path=[YourParentMeasure]
Type=FolderCount

[MeasureFileCount]
Measure=Plugin
Plugin=FileView
Path=[YourParentMeasure]
Type=FileCount
Obviously, [YourParentMeasure] is the measure that contains the real path to your folder.

exper1mental wrote:The part that's not possible based on what your saying is to know where something is on the list. However, I'd still like to give it a shot as I might be able to "know" positions via detecting scrolling or the pushing of scrolling buttons.
Hmm. That is something that I did not think about. I guess if you keep track of the amount of IndexUp/Down and PageUp/Down commands that are sent, you could know the position, although it might be harder than I am thinking.

-Brian
User avatar
exper1mental
Posts: 269
Joined: January 9th, 2013, 7:52 pm
Location: Clemson University

Re: Fileview Measures...

Post by exper1mental »

Brian wrote:Check out the types FileCount and FolderCount.

You basically will use them like this:

Code: Select all

[MeasureFolderCount]
Measure=Plugin
Plugin=FileView
Path=[YourParentMeasure]
Type=FolderCount

[MeasureFileCount]
Measure=Plugin
Plugin=FileView
Path=[YourParentMeasure]
Type=FileCount
Obviously, [YourParentMeasure] is the measure that contains the real path to your folder.
k, I'll browse through that. [YourParentMeasure] causes RM 2.5 to crash, as I have that Measure named [MeasurePath], which works fine when I corrected the Measures to look at it instead. Not sure why it would cause RM to break though...
Brian wrote:Hmm. That is something that I did not think about. I guess if you keep track of the amount of IndexUp/Down and PageUp/Down commands that are sent, you could know the position, although it might be harder than I am thinking.

-Brian
Using buttons it should be a snap. However, there may be a dirty little catch for using [MouseScrollDownAction] and [MouseScrollUpAction], that someone might also be viewing a webpage or something that has scrolling while having the list open, which would problematic if you couldn't set it up to only take into account scrolling on [MouseOverAction].

The fun part is trying to get both of them to work with each other. xP
Image
User avatar
Brian
Developer
Posts: 2686
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fileview Measures...

Post by Brian »

exper1mental wrote:k, I'll browse through that. [YourParentMeasure] causes RM 2.5 to crash, as I have that Measure named [MeasurePath], which works fine when I corrected the Measures to look at it instead. Not sure why it would cause RM to break though...
Actually, the reason why Rainmeter crashed was because "YourParentMeasure" did not exist. This was a bug in my plugin. I have fixed this for the next beta release.

exper1mental wrote:Using buttons it should be a snap. However, there may be a dirty little catch for using [MouseScrollDownAction] and [MouseScrollUpAction], that someone might also be viewing a webpage or something that has scrolling while having the list open, which would problematic if you couldn't set it up to only take into account scrolling on [MouseOverAction].

The fun part is trying to get both of them to work with each other. xP
This shouldn't be a problem since scroll actions only work while the mouse is hovering over the meter.

-Brian
User avatar
exper1mental
Posts: 269
Joined: January 9th, 2013, 7:52 pm
Location: Clemson University

Re: Fileview Measures...

Post by exper1mental »

Update:

I can't get [MeasureFolderCount] and [MeasureFileCount] to work right with the calc.

Keeps giving out Error - Calc: Division by 0 in [MeasureScrollBarHeight]

Here they are:

Code: Select all

[MeasureFolderCount]
Measure=Plugin
Plugin=FileView
Path=[MeasurePath]
Type=FolderCount
Disabled=1
Group=StartMenuMeasure

[MeasureFileCount]
Measure=Plugin
Plugin=FileView
Path=[MeasurePath]
Type=FileCount
Disabled=1
Group=StartMenuMeasure
Here is [MeasurePath]:

Code: Select all

[MeasurePath]
Measure=Plugin
Plugin=FileView
Path="#StartMenuPath#"
ShowHidden=0
HideExtensions=1
Count=#ItemCount#
FinishAction=[!UpdateMeterGroup StartMenu]
Disabled=1
Group=StartMenuMeasure
And here is the calc:

Code: Select all

[MeasureScrollBarHeight]
Measure=Calc
Formula=(420 / ((MeasureFolderCount + MeasureFileCount) / 25))
Disabled=1
Group=StartMenuMeasure
What am I doing wrong?
Image
User avatar
Brian
Developer
Posts: 2686
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fileview Measures...

Post by Brian »

Based on the code you provided, I would say the problem lies in your "FinishAction".

You have: FinishAction=[!UpdateMeterGroup StartMenu], but your group names are: StartMenuMeasure, and it should probably be a !EnableMeasureGroup, since they are disabled.

-Brian
User avatar
exper1mental
Posts: 269
Joined: January 9th, 2013, 7:52 pm
Location: Clemson University

Re: Fileview Measures...

Post by exper1mental »

Brian wrote:Based on the code you provided, I would say the problem lies in your "FinishAction".

You have: FinishAction=[!UpdateMeterGroup StartMenu], but your group names are: StartMenuMeasure, and it should probably be a !EnableMeasureGroup, since they are disabled.

-Brian
Nope, not that.

I enable them using:

Code: Select all

[MetroButton]
Meter=Image
SolidColor=0,0,0,1
X=206
Y=4
H=50
W=50
ToolTipType=0
ToolTipText=Show Start Programs
LeftMouseUpAction=[!ShowMeter MetroButton2][!HideMeter MetroButton][!EnableMeasureGroup StartMenuMeasure][!ShowMeterGroup StartMenu][!HideMeterGroup Launcher][!Update]
The error only displays after I click the button and hence the measures are activated.

I also tried doing what you said and adding [!UpdateMeasureGroup StartMenuMeasure] or [!EnableMeasureGroup StartMenuMeasure] to FinishAction=, no luck. :headbang:


EDIT:
In case its relevant:
StartMenuPath=%SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs
ItemCount=25
(which is why in the calc formula it divided by 25 on the far right, although now that I think of it 25 should be replaced with #ItemCount#, but that won't fix the issue I'm having.)
Image
User avatar
Brian
Developer
Posts: 2686
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fileview Measures...

Post by Brian »

I believe what is happening is your calc measure MeasureScrollBarHeight is trying to read the measures MeasureFolderCount and MeasureFileCount before the plugin is done gathering that information. So in essence, you are trying to divide by 0 because those measure are 0 until the plugin is done gathering the information.

Here is what I would suggest you do. Remove the group from your Calc measure, like this:

Code: Select all

[MeasureScrollBarHeight]
Measure=Calc
Formula=(420 / ((MeasureFolderCount + MeasureFileCount) / 25))
Disabled=1
Then in your FinishAction (on your MeasurePath measure), manually update the Calc measure. Like this:

Code: Select all

[MeasurePath]
Measure=Plugin
Plugin=FileView
Path="#StartMenuPath#"
ShowHidden=0
HideExtensions=1
Count=#ItemCount#
FinishAction=[!EnableMeasure MeasureScrollBarHeight][!UpdateMeterGroup StartMenu]
Disabled=1
Group=StartMenuMeasure
Hopefully that does it for you, if not, could you please post your entire skin (in .rmskin format) so that I (or others :)) can take a better look?

-Brian