Drag&Drop[V 3.1.3] - Drag and drop functionallity in Rainmeter, now with even more fancyness!
Posted: April 9th, 2016, 10:59 pm
Information
I'm back with a huge rewrite of the entire plugin to make it Cooler, Better, Faster, Stronger.
You can check the changelog at the bottom for all the changes between versions!
Download: Redistributable: You have full permission to include this with your skin
Warning!
the plugin will probably not work if rainmeter is run as administrator due to rainmeter.exe then being a higher priority than the user which stops the possibility to drop items into the window. This is probably dependent on system settings in rainmeter though
Future ideas:
Bugs:
Documentation, Rainmeter style!
Usage
To make a skin accept dropped do you only need Action, though you probably want some other options to make it usefull!
This is all you need to make it possible for files to be dropped!
The plugin uses the parent-child paradigm to reimplement bounds in a sane and powerful way.
An example of this:
Examples
Display the last item dropped. (Has to be something the image meter can display)
Simple launcher where you drop the file you want to use later. It is not remembered between sessions.
Here is a gif of how the fancy renderer looks in case you where wondering
If anything is unclear, missing or feel wrong, feel free to reply!
The source can be found at github!
Unlike earlier versions am i trying to preserve backwards compability, so if anything doesn't work like it did earlier, please reply and i'll try my best to make it work!
Warning
There are currently an issue where virustotal (Baidu) is having a false positive with my plugin. I have sent them a message with both source and built binaries, but i haven't gotten any response yet.
It is really odd because the 64-bit version is fine, but the 32-bit one is flagged. It is built with the exact same code...
Changelog
I'm back with a huge rewrite of the entire plugin to make it Cooler, Better, Faster, Stronger.
You can check the changelog at the bottom for all the changes between versions!
Download: Redistributable: You have full permission to include this with your skin
Warning!
the plugin will probably not work if rainmeter is run as administrator due to rainmeter.exe then being a higher priority than the user which stops the possibility to drop items into the window. This is probably dependent on system settings in rainmeter though
Future ideas:
To make a skin accept dropped do you only need Action, though you probably want some other options to make it usefull!
Code: Select all
[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
OnDropAction=[!log "Hey you dropped the file: $Directory$\$Name$.$Type$, or as i like to say $File$"]
The plugin uses the parent-child paradigm to reimplement bounds in a sane and powerful way.
An example of this:
Code: Select all
[DragNDropParent]
Measure=Plugin
Plugin=Drag&Drop
[DragNDropChild1]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=0,0,100,200
Action=Path
OnDropAction=[!Log "You dropped a file in the first child!"]
[DragNDropChild2]
Measure=Plugin
Plugin=Drag&Drop
Parent=DragNDropParent
Bounds=DropMeter2
Action=Path
OnDropAction=[!Log "You dropped a file in the secound child!"]
[DropMeter1]
Meter=Image
W=100
H=200
SolidColor=255,255,255
[DropMeter2]
Meter=Image
X=200
W=100
H=200
SolidColor=255,255,255
Display the last item dropped. (Has to be something the image meter can display)
Code: Select all
[Rainmeter]
Update=-1
[DragNDrop]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
OnDropAction=[!UpdateMeter Image][!Redraw]
[Image]
Meter=Image
MeasureName=DragNDrop
W=100
H=100
SolidColor=255,255,255
PreserveAspectRatio=2
Code: Select all
[Rainmeter]
Update=-1
[Variables]
Text1= Test
Text2= Test2
[DragNDropParent]
Measure=Plugin
Plugin=Drag&Drop
Action=None
[DragNDropChild1]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
Parent=DragNDropParent
Bounds=MeterBounds1
OnDropAction=[!SetVariable Text1 "$Name$"][!UpdateMeter MeterText1][!Redraw]
[DragNDropChild2]
Measure=Plugin
Plugin=Drag&Drop
Action=Path
Parent=DragNDropParent
Bounds=MeterBounds2
OnDropAction=[!SetVariable Text2 "$Name$"][!UpdateMeter MeterText2][!Redraw]
[MeterBounds1]
Meter=Image
W=100
H=100
SolidColor=255,255,255
LeftMouseUpAction=["[DragNDropChild1]"]
DynamicVariables=1
[MeterText1]
Meter=String
Text=#Text1#
X=([MeterBounds1:X] + [MeterBounds1:W] / 2)
Y=([MeterBounds1:Y] + [MeterBounds1:H] / 2)
StringAlign=CenterCenter
DynamicVariables=1
[MeterBounds2]
Meter=Image
X=100
W=100
H=100
SolidColor=255,255,255
LeftMouseUpAction=["[DragNDropChild2]"]
DynamicVariables=1
[MeterText2]
Meter=String
Text=#Text2#
X=([MeterBounds2:X] + [MeterBounds2:W] / 2)
Y=([MeterBounds2:Y] + [MeterBounds2:H] / 2)
StringAlign=CenterCenter
DynamicVariables=1
;It is just copying and renaming to create additional entries :P
;If you feel balsy can you extend this example to save a shortcut to the file to a folder in resources and use FileView to make a real launcher from it ;)
Here is a gif of how the fancy renderer looks in case you where wondering
If anything is unclear, missing or feel wrong, feel free to reply!
The source can be found at github!
Unlike earlier versions am i trying to preserve backwards compability, so if anything doesn't work like it did earlier, please reply and i'll try my best to make it work!
Warning
There are currently an issue where virustotal (Baidu) is having a false positive with my plugin. I have sent them a message with both source and built binaries, but i haven't gotten any response yet.
It is really odd because the 64-bit version is fine, but the 32-bit one is flagged. It is built with the exact same code...
Changelog