It is currently June 23rd, 2024, 5:53 am

@include and relative positioning

General topics related to Rainmeter.
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

@include and relative positioning

Post by Jkon »

Hello all.I was wondering if someone could explain what is happening in this code as the @Include statements are not acting as i had expected them to.
[Rainmeter]

Author=
AppVersion=
Update=1000

; ====================

; [Meters]

[Image01]
Meter=Image
Solidcolor=0,0,0,100
X=0
Y=0
W=200
H=65

@Include=#CURRENTPATH#Inc1.inc

[String_0_1]
Meter=String
StringAlign=Center
X=100r
Y=30r
Text=Test01

[String_0_2]
Meter=String
StringAlign=Center
X=-70r
Y=r
Text=01

[String_0_3]
Meter=String
StringAlign=Center
X=140r
Y=r
Text=02


[Image02]
Meter=Image
Solidcolor=0,0,0,100
X=250
Y=0
W=200
H=65

@Include=#CURRENTPATH#Inc2.inc


[String_1_1]
Meter=String
StringAlign=Center
X=100r
Y=30r
Text=Test02

[String_1_2]
Meter=String
StringAlign=Center
X=-70r
Y=r
Text=01

[String_1_3]
Meter=String
StringAlign=Center
X=140r
Y=r
Text=02
With the red meters being the contents of the two Included files,I had expected them to be positioned relative to each of the image meters they follow,but the meters from the first include are positioning themselves relative to Image02 and the those of the second Include,positioning themselves relative to the first include.Obviously my understanding of how @Include works is wrong,so how does it work?
Image
crish29
Posts: 36
Joined: February 1st, 2011, 6:35 pm

Re: @include and relative positioning

Post by crish29 »

Code: Select all

;===========================================
;  Rainmeter configuration file
;===========================================

[Rainmeter]
Author=Crish29
Update=1000


;Metadata added by RainBrowser
;http://rainmeter.net/cms/Rainmeter101-EditingSkins

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata


[Variables]
@Include=#CURRENTPATH#Inc1.inc
@Include1=#CURRENTPATH#Inc2.inc


; [Meters]

[Image01]
Meter=Image
Solidcolor=0,0,0,100
X=0
Y=0
W=200
H=65

[String_0_1]
Meter=String
MeterStyle=Style1
StringAlign=Center
X=100r
Y=30r
Text=Test01

[String_0_2]
Meter=String
MeterStyle=Style1
StringAlign=Center
X=-70r
Y=r
Text=01

[String_0_3]
Meter=String
MeterStyle=Style1
StringAlign=Center
X=140r
Y=r
Text=02

[Image02]
Meter=Image
Solidcolor=0,0,0,100
X=250
Y=0
W=200
H=65

[String_1_1]
Meter=String
MeterStyle=Style2
StringAlign=Center
X=100r
Y=30r
Text=Test02

[String_1_2]
Meter=String
MeterStyle=Style2
StringAlign=Center
X=-70r
Y=r
Text=01

[String_1_3]
Meter=String
MeterStyle=Style2
StringAlign=Center
X=140r
Y=r
Text=02

end of skin.

@Include=#CURRENTPATH#Inc1.inc

[Style1]
FontColor=255,255,255,200
FontFace=Calibri
FontSize=8
AntiAlias=1
Hidden=0

@Include1=#CURRENTPATH#Inc2.inc

[Style2]
FontColor=255,255,255,200
FontFace=Calibri
FontSize=8
AntiAlias=1
Hidden=0
You do not have the required permissions to view the files attached to this post.
Last edited by crish29 on February 11th, 2011, 12:39 pm, edited 1 time in total.
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: @include and relative positioning

Post by Jkon »

I'm sorry but i dont understand the point you are trying to make in your post.As far as i understood,@include can be used under any section,I am therefore trying to understand why the 3 string meters included in each of the 2 included files are not positioning themselves relative to the meter they are placed after.
Image
crish29
Posts: 36
Joined: February 1st, 2011, 6:35 pm

Re: @include and relative positioning

Post by crish29 »

not really understand what you mean by positioning?., and the second thing., @Include=#CURRENTPATH#Inc1.inc must be place under variables and in order @include and @include1 ... so on

@Include=#CURRENTPATH#Inc1.inc
@Include1=#CURRENTPATH#Inc2.inc
Last edited by crish29 on February 11th, 2011, 1:29 pm, edited 1 time in total.
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: @include and relative positioning

Post by Jkon »

@include can be used under any [section],it does not have to be under [variables].A numerical postfix is only needed if i have more then 1 @include statement under the same section.As for "positioning",what i mean is that the 3 string meters in each of the @include inc files,all use X=r (relative positioning),yet they are not positioning themselves relative to the [Image#] section they are placed after.
Image
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: @include and relative positioning

Post by ~Faradey~ »

intresting...but at first look it should work... :???:
Maybe you forgot to add [Variables] in .inc file
and maybe try to add "2" to your second @include (i.e. @include2=.....)

i will look at it deeper... :???:
..or just use it like crish29 suggested using Styles...
crish29
Posts: 36
Joined: February 1st, 2011, 6:35 pm

Re: @include and relative positioning

Post by crish29 »

@include can be used under any [section],it does not have to be under [variables].A numerical postfix is only needed if i have more then 1 @include statement under the same section

yes you are right @include can be used under any [section],it does not have to be under [variables]

~Faradey~ Do not laugh. i make mistakes. I am not perfect
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: @include and relative positioning

Post by Jkon »

Hi there Fareday,there seems to be some confusion here as to what it is i am trying to achieve so I'll try to explain in full.The sample code i provided above is simplified from something i am working on.It is a dock with a user selected number of tabs on it and the user chooses what information each tab shows,mail,system etc,etc and that is where the @include statements come in.Each @include(the "Inc1.inc" in the sample above being replaced by a variable) links to an inc file containing nothing more then a few string meters and measures.So putting [variables] in the inc is not required and the numerical postfix makes no difference either.I just don't understand why the relevant positioning is messed up.
Image
User avatar
JamesAC
Developer
Posts: 318
Joined: July 14th, 2009, 5:57 pm

Re: @include and relative positioning

Post by JamesAC »

@include files are not "inserted" into the skin in the way you are assuming, they are read after the main file, and hence will appear as if the are at the end of the skin.

I don't think there is any way round it I'm afraid.
+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
Quis custodiet ipsos custodes?
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: @include and relative positioning

Post by Jkon »

That explains it alright.Ah well,suppose i'll have to find another route.Thanks for explaining it.Do you know if it is possible to import the value of a measure from one skin to another.@include="someconfig [section]",would be sweet:)
Image