Hey,
i try to work it out by myself but i'm getting frustrated -_- I need to make something to simply change FontSize according to the text Width and Height for the Weather Reader. That's what i got. Any help?
Ziettol wrote:I need to make something to simply change FontSize according to the text Width and Height for the Weather Reader. That's what i got. Any help?
We can't test the provided code, because it uses a few files which we don't have (like Styles.inc, Variables.inc or WeatherMeasures.inc - all of them are included through some @Include options).
However, take care that the IfCondition option can't be used on meters, just on measures. Move the IfCondition / IfTrueAction options pair from the [CurrentDesc] meter, to a measure, eg to a measure included into the WeatherMeasures.inc file (the provided code doesn't have measures, probably all of them are included into the mentioned .inc file). Just take care to also add a DynamicVariables=1 to the same measure, if it doesn't have it yet.
Ziettol wrote:I added the conditions to MeaserWeatherTemp but still no effect
As usually, you can't use twice (or more times) the same option into one single section. You have two IfCondition and two IfTrueAction options in the [MeasureWeatherTemp] measure. Number them:
Add an UpdateDivider=-1 option to the [InvisibleBackground] meter, because doesn't worth to update this meter continuously.
This question was discussed many times here on the forum: the Unit variable should have to be either m (metric, eg for temperatures in Celsius), or i (imperial - temperatures in Fahrenheit). The f value works only because if there is added any other value then m, Weather.com returns the results in the imperial units (you have commented out the f value, but I suppose you used it, at least for tryouts).
Although this definitely isn't a mistake and the code works same way, newly WebParser became measure. It's not any more a plugin. That's why I suggest to replace the
So i tried everything you said in the post but still can't get it to work. I want to make the longer descriptions as "Light Shower Rain" smaller as they wrap and take more space and short descriptions of weather as "Fair" larger so they look nice on the desktop. Here is the code that i tried to use after yours advices.
Ziettol wrote:So i tried everything you said in the post but still can't get it to work. I want to make the longer descriptions as "Light Shower Rain" smaller as they wrap and take more space and short descriptions of weather as "Fair" larger so they look nice on the desktop. Here is the code that i tried to use after yours advices.
A few more problems:
The measures (doesn't matter what type) don't have a FontSize option, you can't set their font size. [MeasureWeatherDesc] is a measure, so you can't apply a FontSize option to it, through the !SetOption bangs of the IfTrueAction and IfTrueAction2 options (of the [MeasureWeatherTemp] measure). You should have to apply this option to a String meter (however I'm not sure to which one you would like).
The IfCondition options of the [MeasureWeatherTemp] measure don't include the case when the width of the [CurrentDesc] meter would be exactly 100 (100 is nor less, nor higher then 100). I probably would modify those options, creating a single IfCondition, one single IfTrueAction and one IfFalseAction. This way every possible value of the variable would be included somewhere (but also see below another problem).
Even if the IfConditions would be applied correctly and would work, the [CurrentDesc] meter has a fixed width (through its W=#FrameW# option). This makes always true the IfCondition and false the IfCondition2 (the value of the FrameW variable is set to 270 in the [Variables] section). See below a solution.
One solution would be to add a second String meter, with exactly the same settings as the first one, excepting its size and color. It should have to be(almost) transparent (to not disturb). After this you can rewrite the IfConditions, to compare the width of this new meter with 100.
If you don't succeed rewriting all this, please first decide what String meter you would like to apply the new font size to. If this will be clarified, I'll try to rewrite the code.
But I see two more mistakes: in the [MeasureWeatherTemp] measure you have two IfCondition2 and two IfTrueAction2 options. The second ones should have to be IfCondition3 and IfTrueAction3.
Also, although the conditions are working, instead of the posted IfTrueAction2, I'd use the following one: IfCondition2=(([CurrentDesc2:W]<=200)&&([CurrentDesc2:W]>120)). The posted IfConditions, as you had them, wasn't completely clear, because if for example the width of the [CurrentDesc2] meter is 100, it can be included into both conditions (IfCondition2 and IfCondition3).
(Just as a side note, here I also replaced the Measure=Plugin and Plugin=Plugins\WebParser.dll options with Measure=WebParser. As I said before, WebParser became a measure, it's not any more a plugin, so this would be the correct form of the option(s). However the plugin form, due backward compatibility, still works).