It is currently April 19th, 2024, 2:49 am

DIGI DayNightClock

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

Re: DIGI DayNightClock

Post by balala »

xenium wrote:The code works, but I want the skin to be refreshed automatically when the Enter key is pressed.
It is, by the !Refresh bang of the Command1 option of the [MeterInput] meter.
xenium wrote:I would also like to know if I somehow skipped something in the code.
There are two greater errors in your code:
  • There is a missing space between the "$UserInput$" parameter and the file name ("#@#Location.inc"), into the !WriteKeyValue bang of the Command1 option of [MeterInput] meter. Put it back: Command1=[!WriteKeyValue Variables LocationURL "$UserInput$" "#@#Location.inc"][!Refresh].
  • The [MeterAddress] meter should have to show the LocationURL variable, not the Location (otherwise a Location variable doesn't even exist). So, I replaced the Text=#Location# option of the [MeterAddress] meter with: Text=#LocationURL#.
On the other hand, there still are a few less important errors, which doesn't prevent the skin to work, but still are important and should have to be fixed as well:
  • The !PluginBang bang (used into the LeftMouseUpAction option of the [MeterAddress] meter) is deprecated and should have to not be used. Instead you should have to use !CommandMeasure. The !PluginBang still works, but probably just for backward compatibility reasons. This means that you should have to replace the LeftMouseUpAction=[!PluginBang "MeterInput ExecuteBatch 1"] option of the [MeterAddress] meter with: LeftMouseUpAction=[!CommandMeasure "MeterInput" "ExecuteBatch 1"] (again, although !PluginBang still works, it is deprecated).
  • !Execute, same as !PluginBang, is a deprecated bang. Don't use it (eg in the MouseOverAction and MouseLeaveAction options of the [MeterCloseButton] and [MeterCloseButtonActive] meters).
  • There is not needed to include the value of any option into quotes (for example the "#LocationURL#" value of the DefaultValue option of the [MeterInput] meter): https://forum.rainmeter.net/viewtopic.php?p=144784#p144784
I also would add a link to the 1.Go to website Foreca.com string, to can click it to open the Foreca.com website. Would be easier for users.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote:It is, by the !Refresh bang of the Command1 option of the [MeterInput] meter.

There are two greater errors in your code:
  • There is a missing space between the "$UserInput$" parameter and the file name ("#@#Location.inc"), into the !WriteKeyValue bang of the Command1 option of [MeterInput] meter. Put it back: Command1=[!WriteKeyValue Variables LocationURL "$UserInput$" "#@#Location.inc"][!Refresh].
  • The [MeterAddress] meter should have to show the LocationURL variable, not the Location (otherwise a Location variable doesn't even exist). So, I replaced the Text=#Location# option of the [MeterAddress] meter with: Text=#LocationURL#.
On the other hand, there still are a few less important errors, which doesn't prevent the skin to work, but still are important and should have to be fixed as well:
  • The !PluginBang bang (used into the LeftMouseUpAction option of the [MeterAddress] meter) is deprecated and should have to not be used. Instead you should have to use !CommandMeasure. The !PluginBang still works, but probably just for backward compatibility reasons. This means that you should have to replace the LeftMouseUpAction=[!PluginBang "MeterInput ExecuteBatch 1"] option of the [MeterAddress] meter with: LeftMouseUpAction=[!CommandMeasure "MeterInput" "ExecuteBatch 1"] (again, although !PluginBang still works, it is deprecated).
  • !Execute, same as !PluginBang, is a deprecated bang. Don't use it (eg in the MouseOverAction and MouseLeaveAction options of the [MeterCloseButton] and [MeterCloseButtonActive] meters).
  • There is not needed to include the value of any option into quotes (for example the "#LocationURL#" value of the DefaultValue option of the [MeterInput] meter): https://forum.rainmeter.net/viewtopic.php?p=144784#p144784
I also would add a link to the 1.Go to website Foreca.com string, to can click it to open the Foreca.com website. Would be easier for users.
Thank you very much for the corrections.
But I still have to refresh manually for the skin to display the new data.
Action can not happen automatically when I press the Enter key ?
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:But I still have to refresh manually for the skin to display the new data.
Action can not happen automatically when I press the Enter key ?
As I said, it is refreshed every time you hit Enter. Just check the Log, where you can see when it is refreshed.
If doesn't work, please post the last code you have.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote:As I said, it is refreshed every time you hit Enter. Just check the Log, where you can see when it is refreshed.
If doesn't work, please post the last code you have.
I think it is my mistake that I did not specify that I would like 24H.ini to be refreshed automatically when the Enter key is pressed.

I tried [! Refresh *] but refreshes all the active skin.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

I think I found the solution: I added [! Refresh "DIGI DayNightClock"] after ! Refresh
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:I think it is my mistake that I did not specify that I would like 24H.ini to be refreshed automatically when the Enter key is pressed.
You can't refresh a specific skin (like 24H.ini), just a config. In this case doesn't matter which skin of the specified config is loaded, it will be refreshed.
xenium wrote:I tried [! Refresh *] but refreshes all the active skin.
Yes, normal. [!Refresh] refreshes just the current skin, while [!Refresh *] refreshes all loaded skins (including the current one).
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:I think I found the solution: I added [! Refresh "DIGI DayNightClock"] after ! Refresh
You mean both? Are they needed? I'd remove the !Refresh bang.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote:You mean both? Are they needed? I'd remove the !Refresh bang.
The first time ,I removed the !Refresh Bang, but the new link was not displayed, so I kept it.
Now, after pressing the Enter key, both the link and the skin data (24H or 12H) are updated.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: DIGI DayNightClock

Post by balala »

xenium wrote:The first time ,I removed the !Refresh Bang, but the new link was not displayed, so I kept it.
Now, after pressing the Enter key, both the link and the skin data (24H or 12H) are updated.
Oh, now I understand.
Ok, instead of refreshing all, I'd refresh just the current two configs: [!Refresh "DIGI DayNightClock"][!Refresh "DIGI DayNightClock\Settings"].

And one more detail I just saw in your last posted code: take care that the !DeactivateConfig bang, unlike !ActivateConfig, doesn't need two parameters. In the LeftMouseUpAction option of the [MeterCloseButtonActive] meter, you have this: LeftMouseUpAction=!DeactivateConfig "DIGI DayNightClock\Settings" [color=#FF0000]"Settings.ini"[/color]. But correctly this would be: LeftMouseUpAction=!DeactivateConfig "DIGI DayNightClock\Settings", because the !DeactivateConfig doesn't care which skin of the DIGI DayNightClock\Settings config is loaded, it will deactivate the loaded one.

If you want, post once more the updated package. I'd check it.
User avatar
xenium
Posts: 865
Joined: January 4th, 2018, 9:52 pm

Re: DIGI DayNightClock

Post by xenium »

balala wrote:Oh, now I understand.
Ok, instead of refreshing all, I'd refresh just the current two configs: [!Refresh "DIGI DayNightClock"][!Refresh "DIGI DayNightClock\Settings"].

And one more detail I just saw in your last posted code: take care that the !DeactivateConfig bang, unlike !ActivateConfig, doesn't need two parameters. In the LeftMouseUpAction option of the [MeterCloseButtonActive] meter, you have this: LeftMouseUpAction=!DeactivateConfig "DIGI DayNightClock\Settings" [color=#FF0000]"Settings.ini"[/color]. But correctly this would be: LeftMouseUpAction=!DeactivateConfig "DIGI DayNightClock\Settings", because the !DeactivateConfig doesn't care which skin of the DIGI DayNightClock\Settings config is loaded, it will deactivate the loaded one.

If you want, post once more the updated package. I'd check it.
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,0 | Stroke Color 255,255,255,255

[MeterClose]
Meter=Shape
X=325
Y=277
Shape=Rectangle 1,1,150,30 | Fill Color 0,0,0,0 | 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

[MeterInstruction]
Meter=String
StringAlign=Left
FontFace=century gothic
FontColor=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=#@#Location.png
X=280r
Y=60
AntiAlias=1
LeftMouseDownAction=["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
LeftMouseUpAction=[!CommandMeasure "MeterInput" "ExecuteBatch 1"]

[MeterInput]
Measure=Plugin
Plugin=InputText.dll
StringAlign=Left
FontFace=century gothic
FontSize=10
FontColor=255,255,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][!Update]

[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 "DIGI DayNightClock\Settings"
MouseLeaveAction=[!ShowMeter MeterCloseButton][!HideMeter MeterCloseButtonActive][!Update]