It is currently March 28th, 2024, 5:19 pm

Need Help with Mouse control on Shapes.

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Need Help with Mouse control on Shapes.

Post by Yincognito »

death.crafter wrote: August 16th, 2021, 7:37 pmPersonally I would prefer a gdrive or mega link since mediafire doesn't feel safe to me. Just personal opinion. Ofc it helped.
I had the account there for a long time, and at that time gdrive wasn't available (or I didn't know about it) and for me it produced the fastest upload and download speeds while being relatively "clean" compared to other more "shady" sharing sites. Never had a problem with it.
death.crafter wrote: August 16th, 2021, 7:37 pmI don't quite follow. Are both the skin variants different? Because they do the same thing.
Re-sequencing should be something like this
They are intended to be different approaches / implementations of the same thing, more or less. The OP didn't prefer the "old", "arbitrary" variant because he needed to scroll and such and the "gaps" of hidden hexes made that difficult (though not impossible), so the idea was to recreate what that variant did, but leaving no hidden hexes in the "sequence". The difference is in terms of code, not necessarily functional.

Yeah, I had the same ideas about resequencing, just didn't know which variant to choose (or which of them the OP would prefer), i.e. the "last" or the "current" one, when it came to texts and images, which is why I left that part unfinished.

As you could see, the "last" variant produces a visible "shift" of hexes and associated info (e.g. 1 <- 2, 2 <- 3, 3 <- 4), which might not be desirable, depending on what is the expected behavior. On the other hand, the "current" variant looks more natural on the visual side, but you could argue that it visually leaves gaps as well (although technically it doesn't), since removing an "inside" hex like 2 from a 1,2,3,4 list basically means that subsequent numbering / imaging the hexes would start at 5 and number 2 would be impossible to place again.

On top of that, there is the problem of where to continue the numbering from after you remove 2 from 1,2,3,4: while for the "last" variant that is clear because the list becomes both technically and visually 1,2,3 so it would continue at 4, for the "current" one, since the list visually becomes 1,3,4 (although technically it's still 1,2,3 in terms of shown meters) it isn't clear if subsequent numbering should start at 2 (in effect toggling it before going further with future placements) or at 5 (meaning continuing after 4, but without being able to put back the 2 on screen ever again unless you start over).

The original "gap" / "arbitrary" variant was much more clear / natural from that point of view and honestly I didn't fully understood why the OP wanted an "uninterrupted" list since it's a fact of life that if you remove something from the "middle", you'll have gaps as a result. The scrolling / selecting / whetever he talked about could have been done even with gaps being present, and if he wanted to write / save somewhere an uninterrupted list he could have done so, both of them by having a string list with the "active" / "shown" hex indexes, in which the "resequenced" / "uninterrupted" index would be the position of the active hex in the list, e.g. removing 2 from an 1,2,3,4 list results in an active hex index list of 1,3,4 so the "resequenced" index of 3 is its position in 1,3,4, aka 2.

Also, his workaround of removing the last hex no matter which hex you click on presented in the last code he posted feels a bit unnatural to me as well - but then, if he feels it's good, then that's it, I'm not the one that decides on this. :confused:
death.crafter wrote: August 16th, 2021, 7:37 pmBut the fact is, Lua IS native to Rainmeter. But RunCommand is not.
I disagree. Lua is a scripting language whose evolution / features / etc. are totally independent from Rainmeter, and the syntaxes differ considerably. Lua is not native to Rainmeter just as it isn't native to C or any other "main" language using its scripting / embedding capabilities. RunCommand, on the other hand, is a plugin that can be used in Rainmeter just like any other plugin, despite the fact that it triggers running external programs. Saying Lua is native to Rainmeter and RunCommand is not is like saying 3rd party software that does, say, painting, e.g. Photoshop, is "native" to Windows while MSPaint is not. Anyway, that's not particularly important, it's more like a semantical / technical thing to debate on, and doesn't affect in any way the fact that Lua (or any scripting language) is quite useful to any "main framework" that embeds it (including Rainmeter). ;-)
User avatar
KryptOnyx
Posts: 19
Joined: July 28th, 2021, 10:18 am

Re: Need Help with Mouse control on Shapes.

Post by KryptOnyx »

Hi All, I'll try to explain what my goal with this Project is.
The initial concept was to clear my Desktop of all the Shortcuts I have accumulated over the years.
There are several 'fence' apps that constrain Shortcuts (but still fill the Desktop), and a few Launchers that require hard coding the File Path and Custom Image association.
I came across the Rainmeter FileView example and simplified it down to its base Tile and Icon Image Meters reading from a Desktop Folder where my Shortcuts are Sorted into SubFolders.
From there it was a matter of changing the shape of the Tile to Hex and coding various patterns.
Thinking forward to (hopefully) a multitude of Users wanting different Patterns, and the hard coding loses its appeal.
I decided to make a Variant as a Configurator, in which Users can set Tile Size, Orientation, and Position the Tiles where they want.
I tried the screen sized Hex Grid to enable/disable the Tiles, but on my 1920x1080 screen the 300+ Meters caused some problems.
Placing Tiles from a hidden Stack of, say, 20, performs better, but led to the Mouse/Update Cycle problem.
Many thanks for the assistance in solving that issue, and the MaxTile limiter, and the Tile removal process.

ONLY the Orientation, Number of Tiles, Radius (size), and XY positions IN SEQUENCE are saved to File.
The Launcher variation will read the File and display the Icons from the FilePath onto the Tiles.
The Sequence is important because of the way FileView works.
If the list of files in the given path outnumbers the Meters to display the Icons, the Mouse Wheel can 'scroll' the Icons through the available Meters.
You can imagine the affect of missing Icons because Tile #? was removed from the Sequence.
Hence the need to re-sequence a linear progression...which is a lot of trouble when the User just wants to 'move' Tiles to other positions.
If that flexibility were desired, it would be easier to have the User place the Tiles THEN apply the Sequence.

Anyhoo...on a side note, I had earlier looked into Dynamic Meters only to discover they are not possible.
This led to an attempt at 'saving' Meter data into a String then reading only the parts required...a simple String Database.
RegEx can do this, as Yincognito has demonstrated, but it requires more familiarity with RegEx that I possess.
With a simple PUT and GET measures, a basic Database can be made to store information in a few Variables.
The 'Database' String can also be Written to File as non-volatile storage.
May be worth looking into... :D
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Need Help with Mouse control on Shapes.

Post by Yincognito »

KryptOnyx wrote: August 17th, 2021, 11:06 am Hi All, I'll try to explain what my goal with this Project is.
The initial concept was to clear my Desktop of all the Shortcuts I have accumulated over the years.
There are several 'fence' apps that constrain Shortcuts (but still fill the Desktop), and a few Launchers that require hard coding the File Path and Custom Image association.
I came across the Rainmeter FileView example and simplified it down to its base Tile and Icon Image Meters reading from a Desktop Folder where my Shortcuts are Sorted into SubFolders.
From there it was a matter of changing the shape of the Tile to Hex and coding various patterns.
Thinking forward to (hopefully) a multitude of Users wanting different Patterns, and the hard coding loses its appeal.
I decided to make a Variant as a Configurator, in which Users can set Tile Size, Orientation, and Position the Tiles where they want.
I tried the screen sized Hex Grid to enable/disable the Tiles, but on my 1920x1080 screen the 300+ Meters caused some problems.
Placing Tiles from a hidden Stack of, say, 20, performs better, but led to the Mouse/Update Cycle problem.
Many thanks for the assistance in solving that issue, and the MaxTile limiter, and the Tile removal process.

ONLY the Orientation, Number of Tiles, Radius (size), and XY positions IN SEQUENCE are saved to File.
The Launcher variation will read the File and display the Icons from the FilePath onto the Tiles.
The Sequence is important because of the way FileView works.
If the list of files in the given path outnumbers the Meters to display the Icons, the Mouse Wheel can 'scroll' the Icons through the available Meters.
You can imagine the affect of missing Icons because Tile #? was removed from the Sequence.
Hence the need to re-sequence a linear progression...which is a lot of trouble when the User just wants to 'move' Tiles to other positions.
If that flexibility were desired, it would be easier to have the User place the Tiles THEN apply the Sequence.

Anyhoo...on a side note, I had earlier looked into Dynamic Meters only to discover they are not possible.
This led to an attempt at 'saving' Meter data into a String then reading only the parts required...a simple String Database.
RegEx can do this, as Yincognito has demonstrated, but it requires more familiarity with RegEx that I possess.
With a simple PUT and GET measures, a basic Database can be made to store information in a few Variables.
The 'Database' String can also be Written to File as non-volatile storage.
May be worth looking into... :D
Ok, I was actually looking for a more compact and to the point answer regarding only how hex tiles should behave when removing one from the "middle", e.g. tile 2 from tiles 1,2,3,4, but it's good this way too as it explains the whole process. :thumbup: So, what I would like to ask is:
- are you happy with your current implementation of simply removing the last hex tile, irrespective of which hex tile was clicked on? If so, even if a bit awkward from my point of view, that makes things a lot easier, as you could see, no need to resequence as the hex tiles' sequence will always be an "uninterrupted" one, e.g. hex meter 0, hex meter 1, ..., "last" hex meter.
- do you need help with the "database" writing process?
User avatar
KryptOnyx
Posts: 19
Joined: July 28th, 2021, 10:18 am

Re: Need Help with Mouse control on Shapes.

Post by KryptOnyx »

I have always started with a basic goal on a project, and once that is achieved, expanded to improve looks/usability.
At this time it is quicker and easier to remove the last Tile regardless which Tile is clicked.
The next version can allow removing the clicked Tile, but the Sequence MUST be unbroken when Saving the data.
As mentioned, splitting the process into Placing Tiles and Creating the Sequence gives all decisions to the User while ensuring the end result required. :thumbup:
I would very much be interested in the String Database concept as it will allow storing a lot of data in a few Variables. :bow:
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Need Help with Mouse control on Shapes.

Post by death.crafter »

This one does exactly what you want, and you can just format the template.inc file. You can see the formatted file to know ho to.

It also covers deleting last one or the one you clicked on.
HexLattice_1.1.0.rmskin
(2.7 MiB) Downloaded 4 times
Okay, a few points tho.

Keep the first meter named Shape$index$. I will change it later to make it universal.

Also, if you want to change how hexes are positioned, you have to change the lua a little bit. At the X, Y.

Now I put variables instead of hardcover values so you can change the dimensions later.

Currently I am using FilePath since they are images. You can change it to Icon and other needed things.

Let me know if you want to use it and I will make the changes.
Last edited by death.crafter on August 17th, 2021, 11:52 pm, edited 2 times in total.
User avatar
KryptOnyx
Posts: 19
Joined: July 28th, 2021, 10:18 am

Re: Need Help with Mouse control on Shapes.

Post by KryptOnyx »

Thanks everyone for the assistance.
I will look into your code after work.
Here's wishing everyone a great day! :welcome: :D :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Need Help with Mouse control on Shapes.

Post by Yincognito »

KryptOnyx wrote: August 17th, 2021, 11:06 am - I came across the Rainmeter FileView example and simplified it down to its base Tile and Icon Image Meters reading from a Desktop Folder where my Shortcuts are Sorted into SubFolders
- From there it was a matter of changing the shape of the Tile to Hex and coding various patterns
- I decided to make a Variant as a Configurator, in which Users can set Tile Size, Orientation, and Position the Tiles where they want
- ONLY the Orientation, Number of Tiles, Radius (size), and XY positions IN SEQUENCE are saved to File
- The Launcher variation will read the File and display the Icons from the FilePath onto the Tiles
- The Sequence is important because of the way FileView works
- If the list of files in the given path outnumbers the Meters to display the Icons, the Mouse Wheel can 'scroll' the Icons through the available Meters.
KryptOnyx wrote: August 17th, 2021, 10:34 pm - At this time it is quicker and easier to remove the last Tile regardless which Tile is clicked. The next version can allow removing the clicked Tile, but the Sequence MUST be unbroken when Saving the data.
- As mentioned, splitting the process into Placing Tiles and Creating the Sequence gives all decisions to the User while ensuring the end result required.
- I would very much be interested in the String Database concept as it will allow storing a lot of data in a few Variables.
I see. So, this is basically a FileView-based file browser, where the position / properties of each displayed file (or hex tile, if you like, since I assume the text will be the file's wrapped/clipped name and the image will be the file's icon) is configurable, all over the screen? Cause if so, a hypothetical "resequencing" is made easier since the properties of each tile (i.e. text and image) would be independent of the tile's position and will be entirely based on FileView's output, hence it's just a matter of deleting the hex attributes from the hex list and resequencing the S... meter numbers. The configurator and launcher variants can be merged as well, by simply making some Open (for the launcher part) and Move (for the configurator part) buttons somewhere to toggle between placing the tiles and executing them. The saving part will probably have to include the attributes of all the tiles, irrespective if they're hidden or not, especially to be able to set the hidden status properly for all of them on skin load, from some Variables.inc file.

I'll take a look at the whole thing later on.
User avatar
KryptOnyx
Posts: 19
Joined: July 28th, 2021, 10:18 am

Re: Need Help with Mouse control on Shapes.

Post by KryptOnyx »

Yincognito wrote: August 18th, 2021, 5:26 am I see. So, this is basically a FileView-based file browser, where the position / properties of each displayed file (or hex tile, if you like, since I assume the text will be the file's wrapped/clipped name and the image will be the file's icon) is configurable, all over the screen?
Not exactly a file browser...and no Text info (not enough room). I have put the File Name in a ToolTip though.
FileView can extract and use the Icon (image) from a Shortcut (.LNK) file, as well as the File Path.
Hence a Desktop of Shortcuts can be put in a Folder and navigated with FileView configured ONLY with the Icon (image).
Yincognito wrote: August 18th, 2021, 5:26 am The configurator and launcher variants can be merged as well, by simply making some Open (for the launcher part) and Move (for the configurator part) buttons somewhere to toggle between placing the tiles and executing them. The saving part will probably have to include the attributes of all the tiles, irrespective if they're hidden or not, especially to be able to set the hidden status properly for all of them on skin load, from some Variables.inc file.
It would be possible to combine Launcher and Config into one Skin, and probably will end up that way. :D
As mentioned before, this is the first 'circular' variant in 'expanded' form...
HexIcon.Circular.variant.png
Hover over the Images and a ToolTip shows the FileName.
Left Click the HexIcon Tile to toggle all other Tiles Hidden/Unhidden.
Right Click the HexIcon Tile will drop one Folder level (but not past the Base Path set in the Skin).
Eventually the Config will also allow options on the Hex Tile like Colors, Border, Alpha, etc.
User avatar
KryptOnyx
Posts: 19
Joined: July 28th, 2021, 10:18 am

Re: Need Help with Mouse control on Shapes.

Post by KryptOnyx »

Hi Everyone...well I finally managed to put it all together.
Instructions are in the MetaData and I have commented in the Code if people want to look through it.
The most important thing is to have a Folder on your Desktop called SHORTCUTS (or edit the code to point the BaseFolderPathTemplate Variable anywhere).
The Launcher variant will use that to collect Icons and FilePaths.
HexIcon_1.0.rmskin
(12.04 KiB) Downloaded 5 times
Apologies if anything has gone astray...it's 3:15am and I'm off to bed.
Cheers! :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Need Help with Mouse control on Shapes.

Post by Yincognito »

KryptOnyx wrote: August 28th, 2021, 5:46 pm Hi Everyone...well I finally managed to put it all together.
Instructions are in the MetaData and I have commented in the Code if people want to look through it.
The most important thing is to have a Folder on your Desktop called SHORTCUTS (or edit the code to point the BaseFolderPathTemplate Variable anywhere).
The Launcher variant will use that to collect Icons and FilePaths.
HexIcon_1.0.rmskin
Apologies if anything has gone astray...it's 3:15am and I'm off to bed.
Cheers! :great:
Nice work! :thumbup:

As far as I could test, the configurator works fine, it correctly writes the data to the launcher (I had a similar writing process prepared to post after your previous reply, but gave up as you seemed in control and I didn't integrated it with the FileView part on my side), but in the launcher it sometimes doesn't show all the files / folders in the current path (most of the times it does, yet the issue seems to happen on a random basis), so you might want to check that little bug out in the future and correct it.

It was fun playing with the skin (with the help of your "manual" in the comments, of course), as soon as I got which click does what I started making the hex pattern and start browsing on my C:\ 8-)
Post Reply