It is currently March 28th, 2024, 11:22 am

DIGI DayNightClock

Clocks and timer skins
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:Updated code :
Here is the, let's say, re-updated code:

Code: Select all

[Rainmeter]
Update=-1

[Variables]
@include=#@#Location.inc

[MeterBg]
Meter=Shape
X=0
Y=0
Shape=Rectangle 1,1,800,40 | Fill Color 13,13,13 | Stroke Color 255,255,255,255

[MeterBg2]
Meter=Shape
X=0
Y=40
Shape=Rectangle 1,1,800,300 | Fill Color 32,64,132 | Stroke Color 255,255,255,255

[MeterLocation]
Meter=Shape
X=25
Y=190
Shape=Rectangle 1,1,750,30 | Fill Color 0,0,0,1 | Stroke Color 255,255,255,255
LeftMouseUpAction=[!CommandMeasure "MeterInput" "ExecuteBatch 1"]

[MeterClose]
Meter=Shape
X=325
Y=277
Shape=Rectangle 1,1,150,30 | Fill Color 0,0,0,1 | Stroke Color 255,255,255,255

[MeterTitle]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontColor=255,255,255
StringStyle=Bold
FontSize=15
X=400
Y=22
Text=SETTINGS : LOCATION
AntiAlias=1

[MeterInstruction1]
Meter=String
StringAlign=Left
FontFace=century gothic
FontColor=255,255,255
FontSize=12
X=40
Y=80
Text=1.Go to website Foreca.com   >>>
InlinePattern=Foreca.com
MouseOverAction=[!SetOption #CURRENTSECTION# InlineSetting "Underline"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# InlineSetting "None"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=["https://www.foreca.com/"]
AntiAlias=1

[MeterInstruction2]
Meter=String
StringAlign=Left
FontFace=century gothic
FontColor=255,255,255
FontSize=12
X=0r
Y=-2R
Text=2.Write the name of the city and select it from the list that appears.#CRLF#3.When you are on the page with your city, copy the entire address.#CRLF#4.Insert the copied address in the field below and press the "Enter" key to apply changes.
AntiAlias=1

;[MeterWebsite]
;Meter=Image
;ImageName=#@#Location.png
;X=280r
;Y=60
;AntiAlias=1

[MeterAddress]
Meter=String
StringAlign=Left
FontFace=century gothic
FontColor=255,255,0
FontSize=10
X=30
Y=197
Text=#LocationURL#
AntiAlias=1
ToolTipText=Click and paste address

[MeterInput]
Measure=Plugin
Plugin=InputText
StringAlign=Left
FontFace=century gothic
FontSize=10
FontColor=0,0,0
X=30
Y=197
W=740
H=20
AntiAlias=1
FocusDismiss=1
Command1=[!WriteKeyValue Variables LocationURL "$UserInput$" "#@#Location.inc"][!Refresh][!Refresh "DIGI DayNightClock"]
DefaultValue=#LocationURL#

[MeterCloseButton]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
FontColor=255,255,255
X=400
Y=293
Text=Close Settings
SolidColor=0,0,0,1
AntiAlias=1
MouseOverAction=[!ShowMeter MeterCloseButtonActive][!HideMeter MeterCloseButton][!Redraw]

[MeterCloseButtonActive]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
StringStyle=Bold
FontColor=255,255,255
X=r
Y=r
Text=Close Settings
SolidColor=0,0,0,1
AntiAlias=1
Hidden=1
LeftMouseUpAction=[!DeactivateConfig]
MouseLeaveAction=[!ShowMeter MeterCloseButton][!HideMeter MeterCloseButtonActive][!Redraw]
Your last posted code is definitely ok now, I made just a few minor adjustments:
  • I don't have the Location.png image file, used into the [MeterWebsite] meter (it isn't included, not even in your original package, posted in your first, original post). So, I moved the LeftMouseDownAction option of the Image meter to the newly added [MeterInstruction1] meter (see below) and I also replaced it with LeftMouseUpAction. Here is why have I made this replacement: https://docs.rainmeter.net/manual/mouse-actions/#LeftMouseUpAction.
  • Not having the needed image file, I also commented out the [MeterWebsite] meter.
  • I split the [MeterInstruction] meter into two meters: [MeterInstruction1] and [MeterInstruction2]. I did this because I added a LeftMouseUpAction option to [MeterInstruction1]. I also added an InlinePattern and through some MouseOverAction and MouseLeaveAction, an InlineSetting. If you take a look at the appropriate meter, you can see what I'm talking about.
  • I moved the LeftMouseUpAction option from [MeterAddress] to the [MeterLocation] meter. It's easier I think to click it this way.
  • I removed the parameter from the !DeactivateConfig option of the [MeterCloseButtonActive] (but even leaving it, the bang works, so, that's just a "shorten the code" design).
  • I replaced the [!Update] bangs of the LeftMouseUpAction options of [MeterCloseButton] and [MeterCloseButtonActive] meters, with [!Redraw]. Completely enough.
Just to say it again, your code is completely ok. These are just my thoughts on how the code can be a bit more improved.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

:thumbup:
Thank you so much for all your help ! :bow:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

You're welcome.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

Updated

*A new interface for settings.

Updated file in first post
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:Updated

*A new interface for settings.

Updated file in first post
:17good Now it works well. Congratulations, looking good.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote::17good Now it works well. Congratulations, looking good.
Thank you, I'm glad you like it.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote: These are just my thoughts on how the code can be a bit more improved.
Hi,
I added 2 buttons in the settings to select the skin version.
I would like that the text of the skin button that is selected (becomes active) ,changes to red.
When it becomes inactive, the text becomes white again.

Thanks

Code: Select all

[Rainmeter]
Update=-1

[Variables]
@include=#@#Location.inc

[MeterBg]
Meter=Shape
X=0
Y=0
Shape=Rectangle 1,1,800,40 | Fill Color 13,13,13 | Stroke Color 0,0,0,0

[MeterBg2]
Meter=Shape
X=0
Y=40
Shape=Rectangle 1,1,800,210 | Fill Color 0,51,102 | Stroke Color 0,0,0,0

[MeterBg3]
Meter=Shape
X=0
Y=250
Shape=Rectangle 1,1,800,250 | Fill Color 0,60,102 | Stroke Color 0,0,0,0
;32,64,132
[MeterLocation]
Meter=Shape
X=25
Y=190
Shape=Rectangle 1,1,750,30 | Fill Color 0,0,0,1 | Stroke Color 255,255,255,255
LeftMouseUpAction=[!CommandMeasure "MeterInput" "ExecuteBatch 1"]

[MeterClose]
Meter=Shape
X=325
Y=445
Shape=Rectangle 1,1,150,30 | Fill Color 0,0,0,1 | Stroke Color 255,255,255,255
-------------------------------------------------------------------------------------
[MeterSkin1]
Meter=Shape
X=50
Y=327
Shape=Rectangle 1,1,100,30 | Fill Color 0,0,0,1 | Stroke Color 255,255,255,255

[MeterSkin2]
Meter=Shape
X=200
Y=327
Shape=Rectangle 1,1,100,30 | Fill Color 0,0,0,1 | Stroke Color 255,255,255,255

------------------------------------------------------------------------------
[MeterTitle]
Meter=String
StringAlign=CENTER
FontFace=century gothic
FontColor=255,255,255,200
FontSize=15
StringStyle=Bold
X=400
Y=10
Text=S  E  T  T  I  N  G  S
AntiAlias=1

[MeterInstruction]
Meter=String
StringAlign=Left
FontFace=century gothic
FontColor=255,255,255,255
FontSize=12
X=40
Y=80
Text=1.Go to website Foreca.com   >>>#CRLF#2.Write the name of the city and select it from the list that appears.#CRLF#3.When you are on the page with your city, copy the entire address.#CRLF#4.Insert the copied address in the field below and press the "Enter" key to apply changes.
AntiAlias=1

[MeterWebsite]
Meter=Image
ImageName=#@#home.png
X=280r
Y=70
AntiAlias=1
LeftMouseUpAction=["https://www.foreca.com/"]

[MeterAddress]
Meter=String
StringAlign=Left
FontFace=century gothic
FontColor=255,255,0
FontSize=10
X=30
Y=197
Text=#LocationURL#
AntiAlias=1
ToolTipText=Click and paste address

[MeterInput]
Measure=Plugin
Plugin=InputText
StringAlign=Left
FontFace=century gothic
FontSize=10
FontColor=0,0,0
SolidColor=215,215,215,255
X=30
Y=196
W=740
H=20
AntiAlias=1
FocusDismiss=1
Command1=[!WriteKeyValue Variables LocationURL "$UserInput$" "#@#Location.inc"][!Refresh][!Refresh "WeatherTimeBar HD\English\Forecast7Day"]
DefaultValue=#LocationURL#

[MeterCloseButton]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
FontColor=255,255,255
X=401
Y=461
Text=Close Settings
SolidColor=0,0,0,1
AntiAlias=1
MouseOverAction=[!ShowMeter MeterCloseButtonActive][!HideMeter MeterCloseButton][!Redraw]

[MeterCloseButtonActive]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
StringStyle=Bold
FontColor=255,255,255
X=r
Y=r
Text=Close Settings
SolidColor=0,0,0,1
AntiAlias=1
Hidden=1
LeftMouseUpAction=[!DeactivateConfig]
MouseLeaveAction=[!ShowMeter MeterCloseButton][!HideMeter MeterCloseButtonActive][!Redraw]

----------------------------------------------------------------------

[MeterButtonSkin1]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
FontColor=255,255,255
X=100
Y=343
Text=12H
SolidColor=0,0,0,1
AntiAlias=1
MouseOverAction=[!ShowMeter MeterButtonSkin1Active][!HideMeter MeterButtonSkin1][!Redraw]

[MeterButtonSkin1Active]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
StringStyle=Bold
FontColor=255,255,255
X=r
Y=r
Text=12H
SolidColor=0,0,0,1
AntiAlias=1
Hidden=1
LeftMouseUpAction=[!ActivateConfig "DIGI DayNightClock" "12H.ini"]
MouseLeaveAction=[!ShowMeter MeterButtonSkin1][!HideMeter MeterButtonSkin1Active][!Redraw]

[MeterButtonSkin2]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
FontColor=255,255,255
X=250
Y=343
Text=24H
SolidColor=0,0,0,1
AntiAlias=1
MouseOverAction=[!ShowMeter MeterButtonSkin2Active][!HideMeter MeterButtonSkin2][!Redraw]

[MeterButtonSkin2Active]
Meter=String
StringAlign=Centercenter
FontFace=century gothic
FontSize=12
StringStyle=Bold
FontColor=255,255,255
X=r
Y=r
Text=24H
SolidColor=0,0,0,1
AntiAlias=1
Hidden=1
LeftMouseUpAction=[!ActivateConfig "DIGI DayNightClock" "24H.ini"]
MouseLeaveAction=[!ShowMeter MeterButtonSkin2][!HideMeter MeterButtonSkin2Active][!Redraw]

--------------------------------------------------------------------------------------------------------


User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:I added 2 buttons in the settings to select the skin version.
I would like that the text of the skin button that is selected (becomes active) ,changes to red.
When it becomes inactive, the text becomes white again.
For this you'll need the ConfigActive 2.1 plugin and at least Rainmeter 4.2 r3097. Check the installed version of Rainmeter and upgrade if you have an older version. Then install the plugin. As usual the simplest way would be to download and install the ConfigActive_2.1.rmskin skin, posted by jsmorley. This installs the appropriate version of the plugin and the ConfigActive config. You can take a look to the installed skin, to see how does it work, but you also can remove it, because for our purposes it's not needed.
If you got installed both, the first issue with your old code of the Settings.ini is that its Update value is set to -1, so the skin isn't updated. Change this to the default Update=1000, otherwise the skin won't react to closing the loaded skin of your config.
Now add the following Plugin measure to the code of the Settings.ini skin:

Code: Select all

[MeasureActive]
Measure=Plugin
Plugin=ConfigActive
ConfigName=DIGI DayNightClock
IfMatch=12H.ini
IfMatchAction=[!SetOption MeterButtonSkin1 FontColor "255,0,0"][!SetOption MeterButtonSkin2 FontColor "255,255,255"][!UpdateMeter "MeterButtonSkin1"][!UpdateMeter "MeterButtonSkin2"][!Redraw]
IfMatch2=24H.ini
IfMatchAction2=[!SetOption MeterButtonSkin1 FontColor "255,255,255"][!SetOption MeterButtonSkin2 FontColor "255,0,0"][!UpdateMeter "MeterButtonSkin1"][!UpdateMeter "MeterButtonSkin2"][!Redraw]
IfMatch3=^$
IfMatchAction3=[!SetOption MeterButtonSkin1 FontColor "255,255,255"][!SetOption MeterButtonSkin2 FontColor "255,255,255"][!UpdateMeter "MeterButtonSkin1"][!UpdateMeter "MeterButtonSkin2"][!Redraw]
The appropriate IfMatchAction will set the red font color to the appropriate button.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote:For this you'll need the ConfigActive 2.1 plugin and at least Rainmeter 4.2 r3097. Check the installed version of Rainmeter and upgrade if you have an older version. Then install the plugin. As usual the simplest way would be to download and install the ConfigActive_2.1.rmskin skin, posted by jsmorley. This installs the appropriate version of the plugin and the ConfigActive config. You can take a look to the installed skin, to see how does it work, but you also can remove it, because for our purposes it's not needed.
If you got installed both, the first issue with your old code of the Settings.ini is that its Update value is set to -1, so the skin isn't updated. Change this to the default Update=1000, otherwise the skin won't react to closing the loaded skin of your config.
Now add the following Plugin measure to the code of the Settings.ini skin:

Code: Select all

[MeasureActive]
Measure=Plugin
Plugin=ConfigActive
ConfigName=DIGI DayNightClock
IfMatch=12H.ini
IfMatchAction=[!SetOption MeterButtonSkin1 FontColor "255,0,0"][!SetOption MeterButtonSkin2 FontColor "255,255,255"][!UpdateMeter "MeterButtonSkin1"][!UpdateMeter "MeterButtonSkin2"][!Redraw]
IfMatch2=24H.ini
IfMatchAction2=[!SetOption MeterButtonSkin1 FontColor "255,255,255"][!SetOption MeterButtonSkin2 FontColor "255,0,0"][!UpdateMeter "MeterButtonSkin1"][!UpdateMeter "MeterButtonSkin2"][!Redraw]
IfMatch3=^$
IfMatchAction3=[!SetOption MeterButtonSkin1 FontColor "255,255,255"][!SetOption MeterButtonSkin2 FontColor "255,255,255"][!UpdateMeter "MeterButtonSkin1"][!UpdateMeter "MeterButtonSkin2"][!Redraw]
The appropriate IfMatchAction will set the red font color to the appropriate button.
:thumbup: Thank you very much
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote::thumbup: Thank you very much
Could you get it to work?
Post Reply