It is currently December 1st, 2020, 6:55 pm

Plugin QuickLink

Share and get help with Plugins and Addons
User avatar
jsmorley
Developer
Posts: 21563
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin QuickLink

Post by jsmorley »

I think that approach you are using is the best and probably only way to do it. Using that, it seems you can have one meter react to having another meter dropped on it (in a sense) and what actions you take based on that will be entirely up to the skin author. What you will know is that [MeterOne] was dropped on [MeterTwo]. What you do with that information is another matter. Since meters don't have "values", what you can do is probably somewhat limited, and I'm not at all sure what happens if the two meters are in different skins.

I'll go ahead and be the skunk at the picnic here. I've always been, and still remain, skeptical about drag and drop capabilities in Rainmeter. Let me explain why.

First, I am confident that NOBODY uses Windows as if it were 1984 and this is the original Macintosh. Nobody works in Windows by opening explorer, finding a file, and dragging a .txt file to a Notepad++ icon to edit it, dragging a .mp3 file to a Winamp icon to play it, or dragging a file to the trash icon to delete it. Nobody. I will cheerfully accept disagreement with this, since I will be sure that I am right and you are wrong... The whole idea of dragging a file to an application icon barely even exists as a thing in modern operating systems like Android, iOS and Windows 8.1.

Drag and drop is useful in 3rd-party "dual pane" file managers, and things like FTP clients. Rainmeter is not, and never will be, either of those.

Assuming that this is true, and it is, then there is one, and only one, really practical purpose for drag and drop in Rainmeter. That is to create some "configuration tool" for skin suites. For instance, to allow a user to drag and drop an image on some meter to set the meter to that image, or drag and drop an executable on some meter to set the "action" of the meter to the executable. It's all about configuring "launchers", and really very, very few other uses.

Nothing wrong with that in principle. It has a lot of charm for that purpose, and I'm all for it. However, I see this as a slippery slope. It will take about 2 minutes for this capability, which is entirely possible, to lead to request for functionality that is entirely impossible. The mythical "drag and drop skin designer" needs to die once and for all. It's entirely impossible, and if it were possible, I'd oppose it.

My fears are two-fold.

First is that this just encourages hideously complicated configuration tools that lead to skins (like Enigma and Omnimo) that become so complex that users, even Rainmeter veterans, are completely unable to manually edit the skins or understand how they work. While this is just my opinion, and in this I make no claim to be "right", as there is no "right and wrong", this is not how I envision Rainmeter. I think skins that go to great lengths to "isolate the user from the code" are well-meaning, and just terrible.

Second is that this is just going to lead to endless requests for things that Rainmeter is not capable of, and worse yet horrible "hacks" that try, mostly unsuccessfully, to replicate the behavior of things that Rainmeter has no business with. Replicating File Explorer, the Windows Taskbar, the Windows Notification area, the Windows "shell" and how Windows interacts with files and folders. No matter what you come up with, Rainmeter is going to replicate these poorly at the very best.

Even drag and drop in this implementation is sorta "crippled" isn't it... What happens when you drag and drop multiple files on a skin? Does it create some kind of "loop" that takes the "action" on each of them in turn? Nope. Does it intelligently react to having a "shortcut" or "file" or "folder" dropped on something? Nope. So it really only "sorta" replicates the drag and drop capabilities of Windows.

Make no mistake, I'm not criticizing what you have done, and I think you have done it in a way that makes a lot of sense. For the limited practical purposes I can see, I think it is great. I just hope we can keep our heads about us with this. I don't want to see functions that are properly a part of Windows replicated in a way that are broken, crippled, half-baked and feel like hacks. I don't think it reflects well on Rainmeter to create crippled functionality just because you can.
User avatar
Active Colors
Moderator
Posts: 625
Joined: February 16th, 2012, 3:32 am

Re: Plugin QuickLink

Post by Active Colors »

fonpaolo wrote:I must thank Active Colors for have posted the question, I was afraid to ask it myself...
I was afraid too, but you are welcome :D
fonpaolo wrote:I think we had the same intuition, this will give the chance to move strings (paths) from a meter to another, an easy way to set up launchers or anything else.

Correct me if I'm wrong, Active Colors.
Close enough. I will give my explanations under cfixd's quote.
cfixd wrote:What do you want to do with drag-and-droppable meters?
What I had in mind is to move meters like image meters, string meters, or Groups of image and string meters inside skin in one of chosen direction - X or Y.
Reading jsmorley's message about the problems of implementing "moving" itself gave me a hunch how we can trick Rainmeter and make moving effect. I don't know your programming and coding possibilities, but if I were in your shoes I wouldn't make "real" movement effect due to some Rainmeter's incapabilities. What I would do is only outward appearance of moving.
For the task of making pluging that would give us possibility to "drag" meter I would implement these functions (they are listed in chronological fashion):

/ Action from the plugin side which tracks if the cursor is moved when left mouse button is pressed on the skin area. (Further I will call this action "The moving");

/ Action from the plugin side which gets on which meter "The moving" was done;

/ Action from the plugin side which reads X and/or Y of the meter on which "The moving" was done;

/ User-defined action when "The moving" is activated on meter;

/ Action from the plugin side which draws the meter (I mean it's image, how it looks) under cursor and keeps this image under cursor until "The moving" is finished;
(writing this message I recollected that Windows does exactly the same thing http://i.imgur.com/1lXXcIx.png
/ Action from the plugin side which reads X and/or Y points of skin where "The moving" was deactivated (where mouse button was unpressed) and keeps the number of pixels cursor moved in X and/or Y direction before releasing mouse button;

/ User-defined action when "The moving" is deactivated;

/ User-defined IF-THEN actions based regarding given numeric values.
IF number of pixels passed by cursor or defined X/Y is less than defined numeric value THEN fire some actions, and IF number of pixels passed by cursor or defined X/Y is more than defined numeric value THEN fire some other actions.


Basically that's it. As you see plugin doesn't really move meter inside skin. What it does is getting position value of meter and tracks cursor's passed path which makes possible making "moving" effect. How one is going to make a "movement" action is up to him. Fire actions can vary regarding different cases



In advance as example would be moving shortcuts in vertical launcher. Lets say if I want to move second shortcut on third place I do this:

/ My second shortcut has Y=120, and first one has Y=160.

/ Apparently it has to be moved by 40 pixels down in order to take place of the third shortcut;

/ In skin I define MoveByY=40;
; (160-120)

/ I say to plugin that it should track pixels passed by Y;

/When I start dragging meter plugin tracks how many pixels it has passed;

/When I release mouse button if cursor passed 40 or more pixels in Y dimension specific action is fired in order to "move" skin. Something like getting string from the second shortcut and writing it to the third using !WriteKeyValue and then clearing string from the second shortcut. The action vary depending on what user makes. If passed way is less than 40 it should do nothing.

I don't push you to write plugin, I'm just interested if you can do that :)
User avatar
fonpaolo
Moderator
Posts: 1397
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Plugin QuickLink

Post by fonpaolo »

Well, Active Color, we think almost in the same way. :D

My thought, however, is more limited.
I was thinking something to move just a string from one position to another.
As jsmorley said, some... let's say... more help, using a configuration tool.

For example, you have configured your launchers (or anything else), but then you realize that you need to move the second (or third, or fourth...) program at first place, and then move the others down.
I was thinking something like this:
- activate edit mode;
- click (right, left, middle...) on the string you want to move, the #Variable# (or link) is read and put in memory (clipboard?);
- "drag" the link on the other position and release it, or simply click on the position you want to "move" it, so the #Variable# (or link) is written there and deleted on the previous position.

In this way, you need to redo only one string, all the others are simply moved.

...but also Active Colors idea isn't bad.
User avatar
Active Colors
Moderator
Posts: 625
Joined: February 16th, 2012, 3:32 am

Re: Plugin QuickLink

Post by Active Colors »

Precisely. The difference between our suggestions is only convolutedness of parameters.

In your case the "listing" or "sorting" process is kinda done from plugin's side, right? I would like to manipulate all the actions by myself. Though usage to this plugin based on my directions will find only limited number of skinners.
cfixd
Posts: 31
Joined: September 1st, 2014, 1:38 am

Re: Plugin QuickLink

Post by cfixd »

jsmorley wrote:I'll go ahead and be the skunk at the picnic here. I've always been, and still remain, skeptical about drag and drop capabilities in Rainmeter. Let me explain why.
Sorry for taking you so much time to post the reply.

I wrote this plugin just because I was too lazy to change the shortcut after I've written a skin, then I may use it less for some link is not currently using. It's really a mass to put lots of shoutcuts on the desktop.

What I think is : Once some one want to write a plugin like this,here is the code and he don't need to waste time to do the same thing from the beginning.

I have to admit that taking over the windowproc seems not good enough for it may lead to a unstaible rainmeter.

To tell the truth it's hard for me to understand all your words.May be I need to look up the dictionary later for I'm busy these days.
User avatar
fonpaolo
Moderator
Posts: 1397
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Plugin QuickLink

Post by fonpaolo »

@ cfixd
You've done a great job with your plugin, it's exactly what I was searching for, using your plugin I don't need anything else to configure my skin suite, since some users have reported problems using other programs, blocked by the system/UAC and also your plugin can make thing easier, using less code.

My only concern, at the moment, is if it will be updated in future...

I concur with jsmorley that this should not become a sort of hack to mimic some Windows capabilities, but an help for us to build skins, yes.

I must admit that even my suite is somewhat complex, for this purpose I had to make one configuration utility to set almost everything, not really as Enigma and Omnimo, but the more you add, more complex it will be, so, a plugin like this may help, in many ways.

This is completely subjective and maybe others could think the opposite.
cfixd
Posts: 31
Joined: September 1st, 2014, 1:38 am

Re: Plugin QuickLink

Post by cfixd »

Active Colors wrote:/ Action from the plugin side which gets on which meter "The moving" was done;
Meters can only be defined by LeftMouseDownAction=[!CommandMeasure X "From#CurrentSection#"]
and LeftMouseUpAction=[!CommandMeasure X "To#CurrentSection#"]
For I can't get the list of meter or it costs too much.
Active Colors wrote:/ Action from the plugin side which tracks if the cursor is moved when left mouse button is pressed on the skin area. (Further I will call this action "The moving");
/ Action from the plugin side which reads X and/or Y points of skin where "The moving" was deactivated (where mouse button was unpressed) and keeps the number of pixels cursor moved in X and/or Y direction before releasing mouse button;
I think what I can do is to get the X&Y of cursor when LeftMouseDownAction and LeftMouseUpAction is done.
Then how much the cursor moved can be goten.
Active Colors wrote:/ Action from the plugin side which draws the meter (I mean it's image, how it looks) under cursor and keeps this image under cursor until "The moving" is finished;
Maybe the meter can be moved (with !MoveMeter) when the following meters’ position is fixed (without X=Nr/NR)
e.g. when the cursor is in 5,9 then move meter to 7,11
I'm not sure of it.
Active Colors wrote:/When I release mouse button if cursor passed 40 or more pixels in Y dimension specific action is fired in order to "move" skin. Something like getting string from the second shortcut and writing it to the third using !WriteKeyValue and then clearing string from the second shortcut. The action vary depending on what user makes. If passed way is less than 40 it should do nothing.
I think most of what you want can be done if the options to change is written in Variables, or funtion need to be written to read the ini file directly to get the options.

...........it seems interesting..........

Maybe I will test it in a boring day.........but I'm not sure if it really helps
cfixd
Posts: 31
Joined: September 1st, 2014, 1:38 am

Re: Plugin QuickLink

Post by cfixd »

When it comes to Enigma , I remembered taking hours to get the option of "Blur=1" by deleting codes several years ago.
I’m really stupid these days. :-( :-(
fonpaolo wrote:My only concern, at the moment, is if it will be updated in future...
The version control will really be a mess. Some one may replace a newer one with the old one.
So it's really hard to decide whether to add new options.
Personally I want to update it as I wish until version 1.0.0.
User avatar
jsmorley
Developer
Posts: 21563
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin QuickLink

Post by jsmorley »

cfixd wrote: The version control will really be a mess. Some one may replace a newer one with the old one.
So it's really hard to decide whether to add new options.
Personally I want to update it as I wish until version 1.0.0.
This is an issue with 3rd-party plugins. My take on it is:

Until the plugin reaches a "release" state of some kind, 1.0 or whatever, I think the plugin author can and should make whatever changes he likes. A brand-new plugin isn't like a new version of Rainmeter, it's a work-in-progress. The point is to get feedback, and that may well lead to radical changes.

Skin authors should be hesitant to release skins using the new plugin on deviantART or Customize.org. There is indeed a strong risk that a user who downloads and installs your skin a week or month or year from now is going to replace a newer version of the plugin with an older one. That runs the risk of breaking any newer skins using it that the user may have.

If you are going to release a skin with it, I think you need to be very clear that your release uses a version of the plugin from some defined point in time. I would do two things.

First, in the description I would provide a prominent link to the latest version of the plugin. That may well be just a link to the first post in this thread, or maybe some other link to the latest version if cfixd decides to host it somewhere. Tell folks that if they are using your skin, they should try to stay current with the plugin while it is in alpha / beta.

Second, I would keep the release on deviantART or Customize.org "current" with the latest release of the plugin. That will require some work on your part to update both the skin and the release from time to time, but if you do that, and prominently ask folks to set a "watch" on your release or otherwise stay current with it, everyone, the users and you, are going to be better off.

Once the plugin is "released" in some 1.0 version, then I think cfixd has some responsibility to ensure "backwards compatibility" with any changes. There are lots of ways to do this, but the long and the short of it is that any skin that worked with the 1.0 version of the plugin should work with the 2.0 version of the plugin. That might mean "deprecating" old options and replacing them with new ones when functionally changes, rather than just changing them.

It's not a "law" or anything, but we on the Rainmeter team take backwards compatibility to heart. If folks can't be confident that the stuff they download and install, old or new, will work EVERY time, they lose confidence in the entire experience. The library of skins on deviantART, new and old, is the life-blood of the Rainmeter community.

As I said, a new plugin is a work-in-progress. When you download and use it, in my opinion you are volunteering to take part in a development / testing cycle. If you download it once, release a skin using it to the wider world, and then never come back to it, you are a shit. cfixd has some responsibility to fix problems and release new versions based on your feedback, but you have a responsibility to provide feedback and stay current. Either that, or just don't use the plugin.
User avatar
fonpaolo
Moderator
Posts: 1397
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Plugin QuickLink

Post by fonpaolo »

cfixd wrote:When it comes to Enigma , I remembered taking hours to get the option of "Blur=1" by deleting codes several years ago.
I’m really stupid these days. :-( :-(
Sometimes I get lost opening my own code... so, I can understand you. ;-)

The "problem" with future updates is only limited to keep the plugin functionality up to date, when a new version of Rainmeter is released and/or some OS updates could break something.
...as jsmorley said in the previous post.

...and obviously, I'll wait to release any skin including this plugin still in a beta stage.