It is currently March 28th, 2024, 7:54 pm

The bases for a multi-tab skin?

Get help with creating, editing & fixing problems with skins
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: The bases for a multi-tab skin?

Post by StArL0rd84 »

Repackaged:
Tabs_1.1.rmskin
Illustration:
Tabs.gif
The code, just in case:

Code: Select all

[Rainmeter]
 Update=1000
 DynamicWindowSize=1

[Metadata]
 Name=Tabs Example Skin
 Author=StArL0rd84
 Information=Hubba Hubba
 Version=1.0
 License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]

[TextStyle]
 Meter=String
 FontColor=255,255,255
 FontSize=10
 StringStyle=Normal
 StringAlign=Center
 AntiAlias=1
 SolidColor=0,0,0,200


[Tab1]
 Meter=String
 MeasureName=mShow1
 LeftMouseUpAction=[!ShowMeterGroup Tab1Content][!HideMeterGroup Tab2Content][!HideMeterGroup Tab3Content][!UpdateMeter *][!Redraw]
 Text=Tab1
 X=40
 Y=0
 MeterStyle=TextStyle
[Tab2]
 Meter=String
 MeasureName=mShow1
 LeftMouseUpAction=[!ShowMeterGroup Tab2Content][!HideMeterGroup Tab1Content][!HideMeterGroup Tab3Content][!UpdateMeter *][!Redraw]
 Text=Tab2
 X=50r
 Y=r
 MeterStyle=TextStyle
[Tab3]
 Meter=String
 MeasureName=mShow1
 LeftMouseUpAction=[!ShowMeterGroup Tab3Content][!HideMeterGroup Tab1Content][!HideMeterGroup Tab2Content][!UpdateMeter *][!Redraw]
 Text=Tab3
 X=50r
 Y=r
 MeterStyle=TextStyle


[Tab1Content]
 Meter=String
 MeasureName=mShow1
 MouseLeaveAction=[!HideMeterGroup Tab1Content][!UpdateMeter *][!Redraw]
 Text=Tab 1 Content
 X=85
 Y=50
 MeterStyle=TextStyle
 Group=Tab1Content
 Hidden=1
[Tab2Content]
 Meter=String
 MeasureName=mShow1
 MouseLeaveAction=[!HideMeterGroup Tab2Content][!UpdateMeter *][!Redraw]
 Text=Tab 2 Content
 X=r
 Y=r
 MeterStyle=TextStyle
 Group=Tab2Content
 Hidden=1
[Tab3Content]
 Meter=String
 MeasureName=mShow1
 MouseLeaveAction=[!HideMeterGroup Tab3Content][!UpdateMeter *][!Redraw]
 Text=Tab 3 Content
 X=r
 Y=r
 MeterStyle=TextStyle
 Group=Tab3Content
 Hidden=1
You do not have the required permissions to view the files attached to this post.
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: The bases for a multi-tab skin?

Post by balala »

StArL0rd84 wrote:Repackaged:
Have I (we) understand that the previous package you've posted earlier, was a wrong one?
Zaragan
Posts: 58
Joined: January 10th, 2015, 3:14 pm

Re: The bases for a multi-tab skin?

Post by Zaragan »

Sorry for don't answering before, i really appreciate the help but i have afew questions now XD
  • For what is the mShow1 measure you're using on the code?
  • Do i have to "!updatemeter *" everytime? and why the "*"?
  • Why the content doesn't really "hide" on the gifv?
https://i.imgur.com/pLRbbIx.gifv

Again, thank you so much guys!!

PD: whoops, forgot the code.

Code: Select all

[Rainmeter]
Update=1000
Background=#@#\Images\Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=
Author=
Information=
License=
Version=

[Variables]
@includeSettings=#@#\Options\Variables.inc
@includeStyles=#@#\Options\Styles.inc

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
X=100
Y=12
W=190
H=18
Text="#Test#"

[RefreshButton]
Meter=Button
X=168
Y=14
ButtonImage=#@#Images\Refresh.png
ButtonCommand=!Refresh
ToolTipText="#Refresh#"

[CloseButton]
Meter=Button
X=185
Y=14
ButtonImage= #@#Images\Close.png
ButtonCommand=!DeactivateConfig
ToolTipText="#Hideskin#"

; ----------------------------------

[meterCity]
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=40
W=60
H=14
Text="Text 1"
LeftMouseUpAction=!Execute [!ShowMeterGroup Group1][!HideMeterGroup Group2][!Redraw]

[meterLabel0]
Meter=STRING
MeterStyle=styleRightText
X=200
Y=0r
W=60
H=14
Text="Text 2"
LeftMouseUpAction=!Execute [!ShowMeterGroup Group2][!HideMeterGroup Group1][!Redraw]

[meterCity1]
Group=Group1
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=60
W=130
H=14
Text="T1"

[meterLabel01]
Group=Group2
Meter=STRING
MeterStyle=styleRightText
X=200
Y=0r
W=200
H=14
Text="T2"
Hidden=1
[meterCity11]
Group=Group1
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=80
W=130
H=14
Text="T2"
[meterCity121]
Group=Group1
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=100
W=130
H=14
Text="T3"
[meterCity21]
Group=Group1
Meter=STRING
MeterStyle=styleLeftText
X=10
Y=120
W=130
H=14
Text="T4"
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: The bases for a multi-tab skin?

Post by balala »

Zaragan wrote:
  • For what is the mShow1 measure you're using on the code?
A such measure doesn't exist in StArL0rd84's code. Probably he copied that code from an existing skin and those options remaind there. You can modify those meters as you want, to show what you want.
Zaragan wrote:[*]Do i have to "!updatemeter *" everytime?
In a code which has the default Update=1000 set, you don't have to necessary use !UpdateMeter bangs, however, many times this can be a good idea. After each update cycle, the meters are automatically updated, but in a LeftMouseUpAction option is a good practice to update the meters "manually" (through !UpdateMeter bangs), to get an immediate respons and don't have to wait for the next update cycle, to see the meters updated.
Zaragan wrote:[*]and why the "*"?
While for example [!UpdateMeter "SomeMeter"] will update the SomeMeter meter, [!UpdateMeter *] updates all meters of the actual skin. It's a kind of "replacement character" (or how those are named) (exactly like in the Windows OS).
Zaragan wrote:[*]Why the content doesn't really "hide" on the gifv?[/list]
If you would like to hide the T1, T2, ... string if they are visible and you click Text 1 (and similarly for T2 / Text 2), replace the !ShowMeterGroup ... bangs in the LeftMouseUpAction options of the [meterCity] and [meterLabel0] meters, with corresponding !ToggleMeterGroup ... bangs:

Code: Select all

[meterCity]
...
LeftMouseUpAction=!Execute [!ToggleMeterGroup Group1][!HideMeterGroup Group2][!Redraw]

[meterLabel0]
...
LeftMouseUpAction=!Execute [!ToggleMeterGroup Group2][!HideMeterGroup Group1][!Redraw]
Zaragan
Posts: 58
Joined: January 10th, 2015, 3:14 pm

Re: The bases for a multi-tab skin?

Post by Zaragan »

Ok, but i want to hide that little black zone without any info when i pressed "Text 2" That zone is streched because the "T1-T2-T3-T4" characters that are on "Text 1"
Image

Thank you for the responses before!!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: The bases for a multi-tab skin?

Post by balala »

Zaragan wrote:Ok, but i want to hide that little black zone without any info when i pressed "Text 2" That zone is streched because the "T1-T2-T3-T4" characters that are on "Text 1"
I don't have that black zone. But I don't have neither the image used as background, so first please post that image (@Resources\Images\Background.png).
Zaragan
Posts: 58
Joined: January 10th, 2015, 3:14 pm

Re: The bases for a multi-tab skin?

Post by Zaragan »

attachments
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: The bases for a multi-tab skin?

Post by balala »

That black zone is caused, as you said, by the [meterCity1], [meterCity11], [meterCity121] and [meterCity21] meters, which even if hidden, are still there, sized to 0. Because they are absolutely positioned (having a given and well defined vertical position - Y option), when you hide them, the vertical size of the skin is given by the position of the last meter - [meterCity21].
The simplest solution - but definitely not the only one - would be to position those meters relatively. This way, when you hide them, they won't take space and the skin will be as small as possible.
If you want to try this, first you have to reorder the meters. Move them in the following order and replace their Y options with the following ones:

Code: Select all

[meterCity]
...
Y=40
...

[meterLabel0]
...
Y=0r
...

[meterCity1]
...
Y=0R
...

[meterCity11]
...
X=10
...

[meterCity121]
...
Y=0R
...

[meterCity21]
...
Y=0R
...

[meterLabel01]
...
Y=60
...
Zaragan
Posts: 58
Joined: January 10th, 2015, 3:14 pm

Re: The bases for a multi-tab skin?

Post by Zaragan »

Yeah it works now but im gonna need to search another solution because that doesnt fit on the rows of the skin (discs skin for comparison)
Image
thank you anyways!!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: The bases for a multi-tab skin?

Post by balala »

Zaragan wrote:Yeah it works now but im gonna need to search another solution because that doesnt fit on the rows of the skin (discs skin for comparison)
Ok, here is another solution: first put back everything as you had them initially:

Code: Select all

[meterCity1]
...
Y=60

[meterLabel01]
...
Y=0r

[meterCity11]
...
Y=80

[meterCity121]
...
Y=100

[meterCity21]
...
Y=120
Add the following two variables to the [Variables] section (obviously also leave there the existing @includeSettings and @includeStyles options):

Code: Select all

[Variables]
ShowGroup1=0
ShowGroup2=0
...
Replace the LeftMouseUpAction options of the [meterCity] and [meterLabel0] meters, as it follows and also add the appropriate DynamicVariables=1 options to that meters:

Code: Select all

[meterCity]
...
LeftMouseUpAction=[!SetVariable ShowGroup1 "(1-#ShowGroup1#)"][!SetVariable ShowGroup2 "0"][!UpdateMeter "meterCity"][!UpdateMeter "meterLabel0"][!UpdateMeasure "MeasureGroup1"][!UpdateMeasure "MeasureGroup2"]
DynamicVariables=1

[meterLabel0]
...
LeftMouseUpAction=[!SetVariable ShowGroup2 "(1-#ShowGroup2#)"][!SetVariable ShowGroup1 "0"][!UpdateMeter "meterCity"][!UpdateMeter "meterLabel0"][!UpdateMeasure "MeasureGroup1"][!UpdateMeasure "MeasureGroup2"]
DynamicVariables=1
And finally add the following two measures, anywhere to your code:

Code: Select all

[MeasureGroup1]
Measure=Calc
Formula=#ShowGroup1#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "meterCity1"][!HideMeter "meterCity11"][!HideMeter "meterCity121"][!HideMeter "meterCity21"][!SetOption meterCity1 Y "0"][!SetOption meterCity11 Y "0"][!SetOption meterCity121 Y "0"][!SetOption meterCity21 Y "0"][!UpdateMeter "meterCity1"][!UpdateMeter "meterCity11"][!UpdateMeter "meterCity121"][!UpdateMeter "meterCity21"][!Redraw]
IfFalseAction=[!ShowMeter "meterCity1"][!ShowMeter "meterCity11"][!ShowMeter "meterCity121"][!ShowMeter "meterCity21"][!SetOption meterCity1 Y "60"][!SetOption meterCity11 Y "80"][!SetOption meterCity121 Y "100"][!SetOption meterCity21 Y "120"][!UpdateMeter "meterCity1"][!UpdateMeter "meterCity11"][!UpdateMeter "meterCity121"][!UpdateMeter "meterCity21"][!Redraw]
DynamicVariables=1

[MeasureGroup2]
Measure=Calc
Formula=#ShowGroup2#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "meterLabel01"][!SetOption meterLabel01 Y "0"][!UpdateMeter "meterLabel01"][!Redraw]
IfFalseAction=[!ShowMeter "meterLabel01"][!SetOption meterLabel01 Y "0r"][!UpdateMeter "meterLabel01"][!Redraw]
DynamicVariables=1