It is currently April 9th, 2020, 1:50 am

FileView plugin 2.1

Share and get help with Plugins and Addons
User avatar
XANCI
Posts: 106
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: FileView plugin 1.1

Post by XANCI »

Here is a test skin:

Code: Select all

[MeasureScript]
Measure=Script
ScriptFile="#CURRENTPATH#test.lua"

[m1]
Measure=Plugin
Plugin=FileView
Count=2
Index=2
Type=Icon
IconSize=Large

[t1]
MeasureName=m1
Meter=IMAGE
SolidColor=ffffff
test.lua:

Code: Select all

function Initialize()
	bSO='!SetOption'
	SKIN:Bang(bSO,'m1','Path','E:\\Program Files (x86)\\foobar2000')
	SKIN:Bang(bSO,'m1','WildcardSearch','foobar2000.exe')
	SKIN:Bang(bSO,'m1','IconPath','#CURRENTPATH#Icon1.ico')
	i=0
end

function Update()
	i=i+1
	if i==5 then
		SKIN:Bang(bSO,'m1','Path','E:\\Program Files (x86)\\Notepad++')
		SKIN:Bang(bSO,'m1','WildcardSearch','notepad++.exe')
		SKIN:Bang(bSO,'m1','IconPath','#CURRENTPATH#Icon2.ico')
		SKIN:Bang('!UpdateMeasure','m1')
	end
end
User avatar
Brian
Developer
Posts: 1968
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: FileView plugin 1.1

Post by Brian »

I am sorry, I should have been more clear. What you need to do is send the "Update" command.

Setting an option, then updating the measure (though !UpdateMeasure) does nothing. When dynamically changing options (through !SetOption), you need to tell the plugin to retrieve the new options by sending Update to the plugin.

For your example, your .lua code would look like this:

Code: Select all

function Initialize()
   bSO='!SetOption'
   SKIN:Bang(bSO,'m1','Path','C:\\Program Files (x86)\\iTunes')
   SKIN:Bang(bSO,'m1','WildcardSearch','iTunes.exe')
   SKIN:Bang(bSO,'m1','IconPath','#CURRENTPATH#Icon1.ico')
   i=0
end

function Update()
   i=i+1
   if i==5 then
      SKIN:Bang(bSO,'m1','Path','C:\\Program Files (x86)\\Notepad++')
      SKIN:Bang(bSO,'m1','WildcardSearch','notepad++.exe')
      SKIN:Bang(bSO,'m1','IconPath','#CURRENTPATH#Icon2.ico')
      SKIN:Bang('!CommandMeasure','m1', "Update")
   end
end
Sorry for not being clear before, I hope this helps you out!

-Brian
User avatar
XANCI
Posts: 106
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: FileView plugin 1.1

Post by XANCI »

Brian wrote:I am sorry, I should have been more clear. What you need to do is send the "Update" command.

Setting an option, then updating the measure (though !UpdateMeasure) does nothing. When dynamically changing options (through !SetOption), you need to tell the plugin to retrieve the new options by sending Update to the plugin.

For your example, your .lua code would look like this:

Code: Select all

function Initialize()
   bSO='!SetOption'
   SKIN:Bang(bSO,'m1','Path','C:\\Program Files (x86)\\iTunes')
   SKIN:Bang(bSO,'m1','WildcardSearch','iTunes.exe')
   SKIN:Bang(bSO,'m1','IconPath','#CURRENTPATH#Icon1.ico')
   i=0
end

function Update()
   i=i+1
   if i==5 then
      SKIN:Bang(bSO,'m1','Path','C:\\Program Files (x86)\\Notepad++')
      SKIN:Bang(bSO,'m1','WildcardSearch','notepad++.exe')
      SKIN:Bang(bSO,'m1','IconPath','#CURRENTPATH#Icon2.ico')
      SKIN:Bang('!CommandMeasure','m1', "Update")
   end
end
Sorry for not being clear before, I hope this helps you out!

-Brian
Well that finally works
User avatar
jsmorley
Developer
Posts: 20460
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: FileView plugin 1.1

Post by jsmorley »

I have added a new "Important Note" section to the manual for FileView to clarify this issue of how to use the !CommandMeasure MeasureName Update plugin command to properly update the measure when options are changed dynamically.

http://docs.rainmeter.net/manual-beta/plugins/fileview
User avatar
Virginityrocks
Posts: 510
Joined: February 26th, 2011, 10:22 pm

Re: FileView plugin 1.1

Post by Virginityrocks »

I've finally gotten my fileview skin back on DeviantArt. Thanks a lot, Brian.
I need to know what page to link to on the page description for your name. Do you have a deviantart page or website?
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
User avatar
Brian
Developer
Posts: 1968
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: FileView plugin 1.1

Post by Brian »

Glad you got it back up! Although I do have a DA account, I don't really use it, so you could just link to this thread if you want to. ;-)

-Brian
dragonmage
Developer
Posts: 1286
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: FileView plugin 1.1

Post by dragonmage »

Brian, I have an issue with changing Path with !SetOption and then !CommandMeasure Update.
It does change the path and it does update, however it retains the "position" from the former path, even if the new path does not have as many items. I would post my skin for you to view this problem with but the HD holding it thinks it is dead.
Scenario:
Skin displays 8 FileView items.

I have 4 meters that when clicked change the path and update
dir1 contains 4 files
dir2 contains 41 files
dir3 contains 349 files
dir4 does not matter right now

Click dir2.
Scroll 2 ticks.
Click dir1

dir1 displays the 3rd and 4th file in positions 1 and 2.

Click dir3
Scroll 50 ticks
Click dir1 or dir2

nothing displays

I think when Path is changed the main measure should go to the beginning of the "table" or whatever it is in C++.

Ok, off to try to recover a HD. Wish me luck.
User avatar
Brian
Developer
Posts: 1968
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: FileView plugin 1.1

Post by Brian »

This will be fixed in the next beta. Thanks for reporting.

-Brian
User avatar
Brian
Developer
Posts: 1968
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: FileView plugin 1.1

Post by Brian »

Some people have been trying to figure out a good way to make a "functional" scrollbar, so I thought I would post a mostly functional scrollbar to use with the FileView plugin (and any other list). I say mostly functional because you cannot grab the scrollbar and move it with the mouse since Rainmeter cannot drag and drop meters (yet!).

I first posted this scrollbar idea in this thread, but I have since expanded on the idea and fixed the problem with that initial one (see the bottom of the linked thread).

So, here you go!
FileViewTestWithScrollbar.rmskin
Basically there are 5 meters to making a functional scrollbar. 2 meters that run the IndexUp and IndexDown commands (they are String meters with display a up and down arrow). 1 meter that represents the "current" position relative to the items being displayed in your list. And 2 meters that run the PageUp/Down commands (they are the dark grey meters located in between the arrows and the "current" position meter).

You will notice that the "current" position meter will grow/shrink depending on the amount of items in the list. If the number of items in your list is smaller than your count, the scrollbar disappears.

Anyway, the scrollbar meters are located at the bottom of the .ini file, and there is also a Lua script to help with the calculations. Tear it up and make one for yourself.

Enjoy!

-Brian
You do not have the required permissions to view the files attached to this post.
User avatar
Virginityrocks
Posts: 510
Joined: February 26th, 2011, 10:22 pm

Re: FileView plugin 1.1

Post by Virginityrocks »

Awesome work on the scrollbar. Implementing it now. Here is the current progress. I'm stuck. I can't figure out why the bar doesn't move when scrolling up or down. What am I doing wrong? I have the attached test rmskin below. I edited the variable names of the lua for my skin. Maybe I screwed something up there?

https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B-vmK7nNkjE8YmRNVy1uSjcteTA

Other questions:

Would it be unfeasible for the plugin to output a variable that takes in the number of blank indexes? This would be to prevent blank items from displaying a highlight effect when hovered over, similar to the way my #NumberOfItems# variable works, but this would be easier to do if I just had an easy way to calculate the total number of blank strings.

For instance, output the number of the first blank string. So that if...

String1= Albatros
String2= Bagel
String3= Crabcakes
String4= Donuts
String5=
String6=
String7= Albatros
String8= Bagel
etc.

The output number would be 5.

Hence strings using Hidden= (5 <= STRINGNUMBER ? 1 : 0)

Therefor strings 1 through 4 would show, while 5, 6, 7, 8, 9, 10, etc. would hide. I've thought of using Substitute="":"0" on each mIndexName measure, with each corresponding string having Hidden= (mIndexName = 0 ? 1 : 0) but because excess strings cause repetitions, it's not simple. If the plugin could output a number representing the first blank string within the bounds of Count=, it would simplify the implementation of using FileView with dynamic background sizes, and prevent blank strings from causing a redundant highlight effect.
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter