It is currently September 21st, 2020, 3:07 am

Help: Switching wallpapers with a button

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 2564
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote: June 14th, 2020, 2:13 pmI'm trying to create a calendar skin, that shows the whole month + a few days before or before depending of the month (like the microsoft calendar).
And I'm completely lost with the formulas, measures.
The only thing particular i'd like on the calendar is to show clearly the current day with an orange rectangle behind the number.
Or, for a pure Rainmeter example (original work, no Lua involved), you can check MYiniMeter suite. It's a bit outdated now in terms of visuals (didn't yet released version 1.4.0 of my suite), since I nowadays use my custom tooltips instead of the OS tooltips to show the calendar, but it can provide some insight into how it can be done. It has no events (didn't need those) and doesn't highlight today, but it can be made to do both, I think. The current version (the one using custom tooltips) does the latter, for example:
Basic Calendar.jpg
P.S. This is provided for reference only. If you want to modify something you'd have to do it yourself, as I'm busy with my own skin suite at the moment.
balala wrote: June 14th, 2020, 8:30 pmSorry I'm self promoting again my work, but you should take a look on the Calendar skin of my Mirage suite (recommend version 1.1). On this calendar (beside being fully functional) events, reminders, holidays can be easily added, by clicking / right-clicking onto the appropriate day. Take a look please and let me know if this is similar as what you need for.
Apart from the size of the .ini files themselves (which is a bit too much for my taste, but then, you probably had your reasons), only your calendar skin takes 6-8% of my CPU. That's about 10 times as much as my entire suite (bar my Audio skin that you know of) - just saying... O.O
You do not have the required permissions to view the files attached to this post.
Mino_el_Nukenin
Posts: 224
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote: June 14th, 2020, 11:13 pm Or, for a pure Rainmeter example (original work, no Lua involved), you can check MYiniMeter suite. It's a bit outdated now in terms of visuals (didn't yet released version 1.4.0 of my suite), since I nowadays use my custom tooltips instead of the OS tooltips to show the calendar, but it can provide some insight into how it can be done. It has no events (didn't need those) and doesn't highlight today, but it can be made to do both, I think. The current version (the one using custom tooltips) does the latter, for example:
Basic Calendar.jpg

P.S. This is provided for reference only. If you want to modify something you'd have to do it yourself, as I'm busy with my own skin suite at the moment.
Thanks I'll check it too.
Actually the only part I need are the numbers of the days in the calendar and have it automatic accordingly to the current month all the rest is already done.

EDIT:
So I've just went through both of your skins but it's way too complicated to understand. Too much code and too many fonctions I don't really need... I got lost in all of it.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: June 14th, 2020, 2:13 pm EDIT :
I'm also wrokign on another skin, and i'm having a trouble with a sliding meter that doesn't slide at all. I don't get where is the problem since it's a copy from all my other skins with sliding meters.
Here is the code with the part needed :
The problem is in the LeftMouseUpAction option of the [MeterButton] meter, which is mistakenly written as LeftMouseAction (instead of LeftMouseUpAction). Add the missing Up term into the name of the option and try again. Does it work?
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Yincognito wrote: June 14th, 2020, 11:13 pm Apart from the size of the .ini files themselves (which is a bit too much for my taste, but then, you probably had your reasons), only your calendar skin takes 6-8% of my CPU. That's about 10 times as much as my entire suite (bar my Audio skin that you know of) - just saying... O.O
Yeah, it might be a little bit too large, but I did it so because I added a lot of features I never saw into a Rainmeter skin. For instance the ability to add events or holidays (by left-, respectively right clicks onto the day you want to add the event to) or the possibility of scrolling the month with the mouse. I tested my skin before I uploaded it and for me didn't take so much CPU usage. I assume on a weaker computer (please don't misunderstand me) this might increase.
Yeah, everybody can decide if want to use my suite or not. I suppose as usually some users are using it, others don't like, don't want or can't use it. Finally it's up to each...
Mino_el_Nukenin
Posts: 224
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

balala wrote: June 15th, 2020, 5:19 pm The problem is in the LeftMouseUpAction option of the [MeterButton] meter, which is mistakenly written as LeftMouseAction (instead of LeftMouseUpAction). Add the missing Up term into the name of the option and try again. Does it work?
Yeah perfect, I found teh error by redoing all this part. I really need to be more precise.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote: June 15th, 2020, 6:10 pm I really need to be more precise.
Yeah, this always helps. But don't worry, it happens to all of us from time to time.
User avatar
Yincognito
Posts: 2564
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

balala wrote: June 15th, 2020, 5:27 pm Yeah, it might be a little bit too large, but I did it so because I added a lot of features I never saw into a Rainmeter skin. For instance the ability to add events or holidays (by left-, respectively right clicks onto the day you want to add the event to) or the possibility of scrolling the month with the mouse. I tested my skin before I uploaded it and for me didn't take so much CPU usage. I assume on a weaker computer (please don't misunderstand me) this might increase.
Yeah, everybody can decide if want to use my suite or not. I suppose as usually some users are using it, others don't like, don't want or can't use it. Finally it's up to each...
I'm all for the features you added to your skin, I think they're great, but that's not the issue. In my view all this could have been done using way less code and way less CPU (even when idle, not just when adding events). Of course, I wouldn't dare to tell you how to approach things in your skin (so please don't misunderstand me either), but both adding events and scrolling the month(s), could have been achieved easier if the month was a single string meter that you could then tweak it using inline settings on individual days and react on it either using the mouse variables if you only needed click reaction, or a plugin like MouseXY (I saw a mouse plugin in there, not sure if it was the same) if you needed hover reaction as well. Therefore, less code, less CPU usage. Even the way you did it (which is by no means wrong or anything like that), it shouldn't take that amount of resources on idle (i.e. no animation, no hover, no event or holidays added, etc). Anyway, that's just my take on the whole process from a technical point of view, and that doesn't conflict in any way with my impression that you've done a great job in terms of visuals and functionality / features in your skin(s).
Mino_el_Nukenin wrote: June 15th, 2020, 12:40 pm
EDIT:
So I've just went through both of your skins but it's way too complicated to understand. Too much code and too many fonctions I don't really need... I got lost in all of it.
It may be a bit complicated to understand, yes, but that's inherent to a calendar skin - you have to have a few formulas here and there to handle the particularities of a calendar, you know. I can't speak for balala, but in my example, except probably the spaces before or after the weekdays, there's absolutely nothing that isn't needed for a month calendar to work. In my view, just 375 lines of Rainmeter code (of which a significant part is just repetitive) in a 30 kb ini file isn't that much for a fully functional month calendar skin that can scroll to whatever month in the 1 AD to 9999 AD interval (and that's just because I wanted to limit the year to max 4 digits, LOL).

Bottom line, you'd have to use such sligthly complicated code for a calendar skin, whether you take an already made code like a Lua script and such from some place else, or you do it as an original work. There's no other way when it comes to calendars.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Yincognito wrote: June 15th, 2020, 6:35 pm I'm all for the features you added to your skin, I think they're great, but that's not the issue. In my view all this could have been done using way less code and way less CPU (even when idle, not just when adding events). Of course, I wouldn't dare to tell you how to approach things in your skin (so please don't misunderstand me either), but both adding events and scrolling the month(s), could have been achieved easier if the month was a single string meter that you could then tweak it using inline settings on individual days and react on it either using the mouse variables if you only needed click reaction, or a plugin like MouseXY (I saw a mouse plugin in there, not sure if it was the same) if you needed hover reaction as well. Therefore, less code, less CPU usage. Even the way you did it (which is by no means wrong or anything like that), it shouldn't take that amount of resources on idle (i.e. no animation, no hover, no event or holidays added, etc). Anyway, that's just my take on the whole process from a technical point of view, and that doesn't conflict in any way with my impression that you've done a great job in terms of visuals and functionality / features in your skin(s).
Thanks for the appreciations, mean a lot.
About the way I did it, as usually there are more way to achieve the same result. When I wrote the skin this is how I found the solutions to different things, but that was a few years back now. Yes, taking into account your suggestions, in future I might try to rewrite the whole code, but this is left as a future project. But anyway, it worth to think about it and I will.
User avatar
Yincognito
Posts: 2564
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

balala wrote: June 15th, 2020, 6:45 pm Thanks for the appreciations, mean a lot.
About the way I did it, as usually there are more way to achieve the same result. When I wrote the skin this is how I found the solutions to different things, but that was a few years back now. Yes, taking into account your suggestions, in future I might try to rewrite the whole code, but this is left as a future project. But anyway, it worth to think about it and I will.
I didn't imply that you'd have to consider rewriting the code, even as a future project - it was just a discussion about the pros and cons of the code, that's all. But yeah, thinking about something never hurts. ;-)
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Yincognito wrote: June 15th, 2020, 7:58 pm But yeah, thinking about something never hurts. ;-)
:thumbup: Completely agree...