It is currently April 19th, 2024, 2:11 pm

move windows clicking

Get help with creating, editing & fixing problems with skins
Pechorin
Posts: 11
Joined: June 28th, 2010, 10:46 am

move windows clicking

Post by Pechorin »

hi! i started this topic before http://rainmeter.net/forum/viewtopic.php?f=5&t=4565 and i am already need help again :(

i would like to make a column with several titles: cpu, hdd, ram, etc... and when clicking on title, a new config appears below and displace everything below to fit the new information, and when clicking again, it restores the original position.

i got to move everything down when clicking (using a variable and a bang to set it), but i am not able to restore when clicking again. i tried a conditional like: if pos=0, set variable to 100 and when pos=100, set pos to 0, but i got lost on code :(

any idea, please?

thanks!
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: move windows clicking

Post by JpsCrazy »

There's actually a pretty simple way to do this.
If you post your code, we can help.

My way to do this:

Code: Select all

[MeterTitle1]
Meter=String ;(Image?)
SolidColor=00000001
Text=Title!
LeftMouseUpAction=!Execute [!RainmeterHideMeter MeterTitle1][!RainmeterShowMeter MeterTitle2][!RainmeterShowMeter Meter1][!RainmeterShowMeter Meter2][!RainmeterShowMeter Meter3]etc...
Hidden=0

[MeterTitle2]
Meter=String ;(Image?)
SolidColor=00000001
Text=Title!
LeftMouseUpAction=!Execute [!RainmeterShowMeter MeterTitle1][!RainmeterHideMeter MeterTitle2][!RainmeterHideMeter Meter1][!RainmeterHideMeter Meter2][!RainmeterHideMeter Meter3]etc...
Hidden=1
The idea is both titles are exactly the same in every way, but when you click one, it shows all the meters you want to show (to simulate a drop down) and at the same time hides itself and shows it's doppelganger - which hides all the meters which were just shown, then itself and shows the others.
To make this skin use even less CPU usage, you can have the same thing, but add [!RainmeterDisableMeasure Measure1] when you're hiding it, and [!RainmeterEnableMeasure Measure1] when showing it.


Hopefully it's a bit simpler than your idea for it. ;)
Pechorin
Posts: 11
Joined: June 28th, 2010, 10:46 am

Re: move windows clicking

Post by Pechorin »

i don't have a code yet and i know it is difficult in that way, but in this moment i am still learning how to do things with very messy and confused pieces of code.

that's a very interesting (and original) solution that could work in simple skins with two measures, i don't like very much to duplicate and hide things (for the cpu issue, you know) though, it could really work fine.

but in my case, i would have 7 or 8 configs, so the lowest one would have to be repeated 7 times, depending on how many configs above are open to show one or another, the just above, 6, then 5 and make combinations of all of them. it would be a chaos.

the way i had thought would be: if you click one, position = position+100 or position-100 in all lower configs, i am thinking about the relative position or a variable "position", but i am still stuck in how to make the click act in two different ways depending on the position of the measure.

i have been looking for information about conditionals, but i havent get it yet :(

at this moment, i think the appropriate condition would be: "if config active", because you can't trust in the position (it could be affected by any of the above configs) or the relative position of the current and next title.

i hope you could get the idea, because even for me is hard to understand what i have written... (and my english level doesn't help very much)

thanks!
Pechorin
Posts: 11
Joined: June 28th, 2010, 10:46 am

Re: move windows clicking

Post by Pechorin »

double post, sorry :(
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: move windows clicking

Post by JpsCrazy »

Well, as far as I know, more meters won't make Rainmeter's CPU usage go up much at all, if any.

Ohhh. I think I get it.
So it'd be:
|CPU|
|RAM|
|ETC|

Not: |CPU||RAM||ETC|

Alright. So let's do that.

Code: Select all

[Variables]
Hidden1=0
Hidden2=0
Hidden3=0
Hidden4=0
;etc...

YPos1=0
YPos2=25
YPos3=50
YPos4=75
;etc...

[meterCpuTitle]
Meter=String
Text=CPU
LeftMouseUpAction=!Execute [!RainmeterSetVariable Hidden1 1]
MiddleMouseUpAction=!Execute [!RainmeterSetVariable Hidden1 0]
;You could use the method before of it hiding itself and showing another with the alternate !bang
Y=#YPos1#

[meterCpu]
Meter=String
MeasureName=measureCPU
Hidden=#Hidden1#
Y=#YPos2#

[measurePostion1]
Measure=Calc
Formula=#Hidden1#
DynamicVariables=1
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterSetVariable (#YPos1#+100)][!RainmeterSetVariable (#YPos2#+100)][!RainmeterSetVariable (#YPos3#+100)][!RainmeterSetVariable (#YPos4#+100)][!RainmeterRedraw]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterSetVariable (#YPos1#-100)][!RainmeterSetVariable (#YPos2#-100)][!RainmeterSetVariable (#YPos3#-100)][!RainmeterSetVariable (#YPos4#-100)][!RainmeterRedraw]

[meterRAMTitle]
Meter=String
Text=RAM
LeftMouseUpAction=!Execute [!RainmeterSetVariable Hidden2 1]
MiddleMouseUpAction=!Execute [!RainmeterSetVariable Hidden2 0]
Y=#YPos3#

[meterRAM]
Meter=String
MeasureName=measureRAM
Hidden=#Hidden2#
Y=#YPos4#

[measurePostion2]
Measure=Calc
Formula=#Hidden2#
DynamicVariables=1
IfAboveValue=0
IfAboveAction=!Execute [!RainmeterSetVariable (#YPos2#+100)][!RainmeterSetVariable (#YPos3#+100)][!RainmeterSetVariable (#YPos4#+100)][!RainmeterRedraw]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterSetVariable (#YPos2#-100)][!RainmeterSetVariable (#YPos3#-100)][!RainmeterSetVariable (#YPos4#-100)][!RainmeterRedraw]

;etc, etc...
You just have to add a bang for every other meter you have.
Pechorin
Posts: 11
Joined: June 28th, 2010, 10:46 am

Re: move windows clicking

Post by Pechorin »

thank you!! now i think now it is just what i was looking for, with some little adjustments for my skin :)

i have thought also use the same idea for using always the leftmouse click action, something like this:

Code: Select all

[meterCpuTitle1]
Meter=String
Text=CPU
LeftMouseUpAction=!Execute [!RainmeterSetVariable Hidden1 1] [!RainmeterSetVariable Hidden2 0]
Y=#YPos1#
Hidden=#Hidden1#

[meterCpuTitle2]
Meter=String
Text=CPU
LeftMouseUpAction=!Execute [!RainmeterSetVariable Hidden2 1] [!RainmeterSetVariable Hidden1 0]
Y=#YPos1#
Hidden=#Hidden2#

what do you think?
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: move windows clicking

Post by JpsCrazy »

That should work great! Very smart.
Just keep in mind, now Hidden2 works for the title, so the next new meter would start with Hidden3.
Pechorin
Posts: 11
Joined: June 28th, 2010, 10:46 am

Re: move windows clicking

Post by Pechorin »

thanks! things are going pretty well at the moment.

the only thing is that i have had to use a background image with the total size, because if not, meters disappear or are cut out of the initial dimensions. o don't know if it is normal, but background image works well.

and another little problem, what can be wrong in this? (i have cut the unnecessary parts of the code)

Code: Select all

[Variables]
posYCPU=0
posYRAM=20
posYHDD=(#posYRAM#+20)

[CPUTitle0]
Y=#posYCPU#
LeftMouseUpAction=!Execute [!RainmeterSetVariable posYRAM (#posYRAM#+50)]

[RAMTitle0]
Y=#posYRAM#
LeftMouseUpAction=!Execute [!RainmeterSetVariable posYHDD (#posYHDD#+50)]

[HDDTitle0]
Y=#posYHDD#
everything works fine but the hdd title when i click cpu. ram title displace well, but hdd stays fixed

EDIT: i solved it more or less. it doesn't work with variables, but if i set Y=(#posYRAM#+20) instead of Y=#posYHDD# and posYHDD=(#posYRAM#+20), it works. it is a less elegant way, but i think i will leave it that way
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: move windows clicking

Post by JpsCrazy »

That'd probably work for the best.
Even 1 pixel can make a difference, so be sure to fine tune it.
Pechorin
Posts: 11
Joined: June 28th, 2010, 10:46 am

Re: move windows clicking

Post by Pechorin »

i am here again :)

my new problem is with dynamic variables in different configs, i mean, i have the variables in a variable.inc file, so i can use them from every ini file i have, but the problem is that i cant use them as dynamic variables, if i change one in the main config, changes are not applied to other configs using that variable. everything works fine if i put everything in the same ini file, but that way is too complicated, i would have to disable/enable measures, and they are a lot! about 10 per config, so !executes are too long to be clear.