TodayPlus Boards v2

TodayPlus for the Pocket PC Forums => HammerSkin => Topic started by: Daan on March 17, 2005, 04:34:18 AM

Title: On the wishlist
Post by: Daan on March 17, 2005, 04:34:18 AM
I have a wish for the Hammerskin. I want to make it possible to start radar pictures other then starting with the top-left corner. Sometimes the relevant part of the picture is the bottom-right part or some other part. This makes that var3 and var23 in the skin should be calculated according to wich city your loading and which x,y postion is relevant with that city.

This implies that you need (at the beginning of the skin; someplace else?) a list of starting positions (x,y) per picture. Are there vars free in the skin?

@Witchel or UKSkinner: can you give me a help?
Title: Re: On the wishlist
Post by: Broesel on March 17, 2005, 04:55:50 AM
Quote from: DaanI have a wish for the Hammerskin. I want to make it possible to start radar pictures other then starting with the top-left corner. Sometimes the relevant part of the picture is the bottom-right part or some other part. This makes that var3 and var23 in the skin should be calculated according to wich city your loading and which x,y postion is relevant with that city.

This implies that you need (at the beginning of the skin; someplace else?) a list of starting positions (x,y) per picture. Are there vars free in the skin?

Could be simple, if I understand that right:

in the Skin (Radar-Section) you will find the lines:
load,city,%var9%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif


after the load,city,...
you could insert:

if,var,var9,,=,1
initvar,var3,x
initvar,var23,y
else
if,var,var9,,=,2
initvar,var3,x2
initvar,var23,y2
.
.
.
endif
endif


where x,x2 y,y2 .... has to be defined for the x-y-position of the pics.

Regards Broesel
Title: On the wishlist
Post by: Daan on March 17, 2005, 05:26:06 AM
Exactly what I had in mind.

I was more for code like:
Quote
initvar,var3,x%var9% where var9 is the city number
Can this be done?

Its a little bit more complicated with the button to reset the image position.

Quote
imagebutton,226,472,refresh.png,t,-1,6,var3=-16,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=36,7  //Reset Image Position

should be something like

Quote
imagebutton,226,472,refresh.png,t,-1,6,?var3=x%var9%,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=y%var9%,7  //Reset Image Position

Can you use variables called x1 etc. or only var1 till varxx?
Title: On the wishlist
Post by: Broesel on March 17, 2005, 05:58:09 AM
Quote from: DaanExactly what I had in mind.

I was more for code like:
Quote
initvar,var3,x%var9% where var9 is the city number
Can this be done?

Its a little bit more complicated with the button to reset the image position.

Quote
imagebutton,226,472,refresh.png,t,-1,6,var3=-16,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=36,7  //Reset Image Position

should be something like

Quote
imagebutton,226,472,refresh.png,t,-1,6,?var3=x%var9%,7  //Reset Image Position
   button,226,472,26,26,-1,6,var23=y%var9%,7  //Reset Image Position

Can you use variables called x1 etc. or only var1 till varxx?

No sorry, all the things you have in mind, are not possible. The only thing
you could do, is to create registry-keys under ..... TodayPlus/var/

f.ex. xpos1, xpos2, ... for each city and ypos1, ypos2, ...
and then call it in the skin before displaying the picture like:

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

then display the image with:

image,%var3%,%var23%,%var9%.jpg

To reset the images to the right positon you have to do the calculation
from the registry-key again.

(all lines are only examples without testing, so maybe they are not correct in the syntax)


Regards Broesel
Title: On the wishlist
Post by: Daan on March 17, 2005, 06:43:49 AM
Quote from: Broeself.ex. xpos1, xpos2, ... for each city and ypos1, ypos2, ...
and then call it in the skin before displaying the picture like:

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

then display the image with:

image,%var3%,%var23%,%var9%.jpg

To reset the images to the right positon you have to do the calculation
from the registry-key again.

Regards Broesel

Maybe as elegant as well. I will try to implement the code tonight.

The reset is still a problem. How to force to do a calculation when pressing a button?
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 07:18:50 AM
Quote from: Daan
Quote from: Broeself.ex. xpos1, xpos2, ... for each city and ypos1, ypos2, ...
and then call it in the skin before displaying the picture like:

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

then display the image with:

image,%var3%,%var23%,%var9%.jpg

To reset the images to the right positon you have to do the calculation
from the registry-key again.

Regards Broesel

Maybe as elegant as well. I will try to implement the code tonight.

The reset is still a problem. How to force to do a calculation when pressing a button?

If I understood your intention correctly, you trying to change the start (x,y) of radar image of each city.  Broesel's approach is a good one.  You only need to set %var9% to get the desired (x,y) for each city.  In hammerskin, the botton codes has already included to set %var9% when you tap right/left arrows, once your %var9% change, your (x,y) will be changed too (if you have created the registry key as broesel described).  So, you really don't need to do extra calculation.
Title: On the wishlist
Post by: Daan on March 17, 2005, 07:38:14 AM
Quote from: uk_skinnerIf I understood your intention correctly, you trying to change the start (x,y) of radar image of each city.  Broesel's approach is a good one.  You only need to set %var9% to get the desired (x,y) for each city.  In hammerskin, the botton codes has already included to set %var9% when you tap right/left arrows, once your %var9% change, your (x,y) will be changed too (if you have created the registry key as broesel described).  So, you really don't need to do extra calculation.

I think you understand the problem quiet well.

The code would be something like:

Quote
load,city,%var9%

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif

But now when pressing the reset button:
Code is like:
Quote
imagebutton,226,472,refresh.png,t,-1,6,var3=-16,7 //Reset Image Position
button,226,472,26,26,-1,6,var23=36,7 //Reset Image Position


And should be something like:
Quote

imagebutton,226,472,refresh.png,t,-1,6,"calcvar,var3,fromconfig,xpos%var9%" ,7 //Reset Image Position
button,226,472,26,26,-1,6,"calcvar,var23,fromconfig,ypos%var9%" ,7 //Reset Image Position

But how exactly?
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 07:53:12 AM
I think I only got half of your question right.  Let me rephrase again.

1)  When you go to a radar image of a particular city, you wish to load the preset (x,y) from the registry key.  Yes, then use

load,city,%var9%

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif


That is fine.

2) Then you will wondering the image and would like to go back the preset (x,y) by taping the reset botton.  If that is the case, the only way I can think about is to store your preset (x,y) after you retrive them from registry key.

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%
storevar,varxx,%var3%
storevar,varyy,%var23%



then you can have

imagebutton,226,472,refresh.png,t,-1,6,var3=%varxx% ,7 //Reset Image Position
button,226,472,26,26,-1,6,var23=%varyy% ,7 //Reset Image Position


The only thing needs to consider is to find the available vars.  This could be tricky.  The approach has been explored is "re-cycle" var.  I will take a look and give you some options.
Title: On the wishlist
Post by: Daan on March 17, 2005, 08:01:37 AM
Quote from: uk_skinner
2) Then you will wondering the image and would like to go back the preset (x,y) by taping the reset botton.  If that is the case, the only way I can think about is to store your preset (x,y) after you retrive them from registry key.

calcvar,var3,fromconfig,xpos%var9%
calcvar,var23,fromconfig,ypos%var9%
storevar,varxx,%var3%
storevar,varyy,%var23%



then you can have

imagebutton,226,472,refresh.png,t,-1,6,var3=%varxx% ,7 //Reset Image Position
button,226,472,26,26,-1,6,var23=%varyy% ,7 //Reset Image Position


The only thing needs to consider is to find the available vars.  This could be tricky.  The approach has been explored is "re-cycle" var.  I will take a look and give you some options.

Exactly. This was the exact problem I was thinking about.
Maybe not good enough decribed.
And storing it after retrieval of the original position in a (temp) var is also an option.  :wink:  :D

I wonder does a phrase like:

Quotevar3=%varxx%
works?

And second, indeed, which vars to use?
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 08:06:42 AM
var3=%varxx%
No, it will not work.  

correct usage
storevar,var3=%varXX%

And since you need to triger this with a botton, then you need put them in imagebotton or button code as I posted.
Title: On the wishlist
Post by: Daan on March 17, 2005, 08:34:21 AM
Sorry my fault.  :oops:
I was referring to
var3=%varxx%
as part of the line

imagebutton,226,472,refresh.png,t,-1,6,var3=%varxx%,7


Didn't see it before. Therefore my wondering  :wink:
So I understand it will work  :D
Title: On the wishlist
Post by: Daan on March 17, 2005, 08:44:31 AM
var30, var31, var38, var39?
Title: On the wishlist
Post by: Broesel on March 17, 2005, 09:25:15 AM
Quote from: Daanvar30, var31, var38, var39?

I think, var30 and var31 should work, can't remember, if var38 and var39
where "good" ones but they could work too. Try with 30 and 31 first ...


Regards Broesel
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 12:22:28 PM
Daan:

    You also can try var26 and var 27.  They were used in RSS section.  The idea to "recycle" them was they all are reset back to default value when you jump into RSS section, so the values they recieved in the weather section will not be carried over.  And when you jump to radar section, their value will be set to the preset (x,y) of city1 from registry keys.  This is the "recycle" strategy..
Title: On the wishlist
Post by: Daan on March 17, 2005, 02:57:35 PM

load,city,%var9%

       calcvar,var26,fromconfig,xpos%var9%
       calcvar,var27,fromconfig,ypos%var9%

       storevar,var3=%var26%
       storevar,var23=%var27%

image,%var3%,%var23%,%var9%.png
image,%var3%,%var23%,%var9%.jpg
image,%var3%,%var23%,%var9%.gif


and

imagebutton,113,236,refresh.png,t,-1,6,var3=%var26%,7  //Reset Image Position
button,113,236,13,13,-1,6,var23=%var27%,7  //Reset Image Position


and enterxpos=-118 and ypos=-118 in the register.

It works.
But as a side effect you cannot scroll in the radar pictures  :cry:
Its not clear to me why not.
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 03:17:45 PM
QuoteBut as a side effect you cannot scroll in the radar pictures.
Its not clear to me why not.

Did you move the radar image or scroll from city1 to city2?
Title: On the wishlist
Post by: Daan on March 17, 2005, 03:25:58 PM
You can move from city1 to city2.

But within the picture you cannot scroll anymore.
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 03:32:05 PM
Daan:

 I see the problem.  Give me some time to find a solution.

Edit:

Daan:

  This is going to test your ability to "seek" the codes in Hammerskin.  Make a back-up, in case something goes wrong.  The new/changed codes are in red.

1. in region,3,0


             
Quote

      imagebutton,177,78,Radar.png,t,7,4,6,-1
      //button,177,78,32,32,-1,6,var3=-8,
      //button,177,78,32,32,-1,6,var23=18,
               button,177,78,32,32,-1,6,var2=1,
      button,177,78,32,32,-1,6,var25=0,
      button,177,78,32,32,3,4,999
      button,177,78,32,32,1,4,999

2 in region,7,6

   
Quoteload,city,%var9%

       if,var,var2,,=,1
          calcvar,var26,fromconfig,xpos%var9%
          calcvar,var27,fromconfig,ypos%var9%
          storevar,var3=%var26%
          storevar,var23=%var27%
          storevar,var2=0
       else
       endif

       

  image,%var3%,%var23%,%var9%.png
  image,%var3%,%var23%,%var9%.jpg
  image,%var3%,%var23%,%var9%.gif


3 near the bottom of region,7,6

       
Quoteimagebutton,153,236,Kalenderpfeil_rechts.png,t,7,13,var9_1,7
       button,153,236,70,12,-1,6,var2=1,7
   //button,153,236,70,12,-1,6,var3=-8,7  //Reset Image Position
   //button,153,236,70,12,-1,6,var23=18,7  //Reset Image Position

   imagebutton,17,236,Kalenderpfeil_links.png,t,7,13,var9_-1,7
       button,17,236,70,12,-1,6,var2=1,7
   //button,17,236,70,12,-1,6,var3=-8,7  //Reset Image Position
   //button,17,236,70,12,-1,6,var23=18,7  //Reset Image Position

Sorry, I did not test these codes.  Try it .  :wink:
Title: On the wishlist
Post by: Daan on March 17, 2005, 04:35:06 PM
Quote from: uk_skinnerDaan:

 I see the problem.  Give me some time to find a solution.

Edit:

Daan:

  This is going to test your ability to "seek" the codes in Hammerskin.  

I'm not that stupid. Maybe it seems a bit like it ...  :oops:  :D  :wink:

But i'm quit capable .. at least i think i am. (In version 9.8 I did wright my own skin)  :wink:

Tested it! The code I mean.
I'm sorry. Picture loads.
But scrolling means disappearing of the skin  :(  :(
Only reload makes it come back.
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 04:47:45 PM
QuoteBut i'm quit capable .. at least i think i am. (In version 9.8 I did wright my own skin)

Sorry, I just wanted to be more careful.  :wink:

QuoteBut scrolling means disappearing of the skin

That was bad... The total skin gone?
Title: On the wishlist
Post by: Daan on March 17, 2005, 04:57:34 PM
Quote from: uk_skinner

QuoteBut scrolling means disappearing of the skin

That was bad... The total skin gone?

Nope, just reload with "config", and the skin is there  :lol:

But still ... not a workable solution.

You try to recalculate var3,23 only when selecting a new picture by setting var2 on 1.

In that case I don't think we need 26,27 anymore?!

Only
if,var,var2,,=,1
       calcvar,var3,fromconfig,xpos%var9%
       calcvar,var23,fromconfig,ypos%var9%
       else
      end if


If i'm right.

But why does it crash ... :?:  :?
Title: On the wishlist
Post by: uk_skinner on March 17, 2005, 05:25:33 PM
QuoteYou try to recalculate var3,23 only when selecting a new picture by setting var2 on 1.

In that case I don't think we need 26,27 anymore?!

In fact, when scorlling/moving happened, var3 and var23 are calcualted using these codes:

imagebutton,98,236,links.png,t,-1,13,var3_50,7  //left

imagebutton,128,236,rechts.png,t,-1,13,var3_-50,7  //right

imagebutton,113,251,unten.png,t,-1,13,var23_-50,7  //down

imagebutton,113,221,oben.png,t,-1,13,var23_50,7  //up

imagebutton,128,221,rechts_oben.png,t,-1,13,var3_-50,7  //upright
button,128,221,13,13,-1,13,var23_50,7

imagebutton,98,221,links_oben.png,t,-1,13,var3_50,7  //upleft
button,98,221,13,13,-1,13,var23_50,7

imagebutton,128,251,rechts_unten.png,t,-1,13,var3_-50,7  //downright
button,128,251,13,13,-1,13,var23_-50,7

imagebutton,98,251,links_unten.png,t,-1,13,var3_50,7  //downleft
button,98,251,13,13,-1,13,var23_-50,7

imagebutton,113,236,refresh.png,t,-1,6,var3=-8,7  //Reset Image Position
button,113,236,13,13,-1,6,var23=18,7  //Reset Image Position


Supposedly the if/else/endif will only be executed when you change the city and after new var3/var23 are set, the var2 set to 0.  That prevent the var2/var23 get values from the registry key again.  The only time var will be set back to "1" is when you tap right/left arrow.  

If possible, can you just post the whole region,7,6 here, or better upload the whole skin here.  Sometimes, if you have some extra space after the codes, it will cuase unexpected effect.  This only can be examined when you have the text file.
Title: On the wishlist
Post by: Daan on March 18, 2005, 01:27:32 AM
I also tried this:
imagebutton,113,236,refresh.png,t,-1,6,var2=1,7  //Reset Image Position
       //imagebutton,113,236,refresh.png,t,-1,6,var3=%var26%,7  //Reset Image Position
//button,113,236,13,13,-1,6,var23=%var27%,7  //Reset Image Position


with the same effect as before ... crash.

Here's the skin ...
Title: On the wishlist
Post by: Daan on March 18, 2005, 01:42:42 AM
I noticed two other strange things. I updated this morning. Its friday and on my skin thursday (donderdag) still shows ...In the buffer there are only files from friday.

And after "Lucht:"  standing Haze. But I'm using the dutch forecasttext.txt Or is this in the registry too ?
Title: On the wishlist
Post by: Wichtel on March 18, 2005, 02:15:19 AM
That´s a problem with msnbc. Up to 10:00 in the Morning msnbc will show the Weatherforecast from the last day. When you sync at ~10:30 you get the weather forecast from today

Edit: the "haze" and all other information(Windirection, Windspeed ...) in this area is Branded in the City.txt and is not read from the forecast.txt
Title: On the wishlist
Post by: uk_skinner on March 18, 2005, 05:20:01 AM
Daan:

    I made some change to remove some extra space after some codes.  I don't know this made any difference or not but if you can try again, let me know the result.
Title: On the wishlist
Post by: Broesel on March 18, 2005, 05:38:16 AM
Thanks uk_skinner, for continue the help, had a little much work
the last days

@daan: let us know, if the solutioin from uk_skinenr helps

Regards Broesel
Title: On the wishlist
Post by: Daan on March 18, 2005, 05:47:18 AM
I actual think it works  :lol:

Testing a bit more ... still works. Works quiet well!!!  8)

What did you change?
Title: On the wishlist
Post by: Broesel on March 18, 2005, 05:53:57 AM
Quote from: DaanI actual think it works  :lol:

What did you change?

I think, as uk_skinner posted, he removed the "blank spaces" after some
lines.
When you copy code from the forum into your skin, it happens, that
there are "spaces" after some of the copied lines ant that can lead to
several problems in the skin, among other things it can cause a softreset,
like it did for you or the codelines don't work .....

Regards Broesel
Title: On the wishlist
Post by: uk_skinner on March 18, 2005, 06:06:01 AM
Quote from: Broesel
Quote from: DaanI actual think it works  :lol:

What did you change?

I think, as uk_skinner posted, he removed the "blank spaces" after some
lines.
When you copy code from the forum into your skin, it happens, that
there are "spaces" after some of the copied lines ant that can lead to
several problems in the skin, among other things it can cause a softreset,
like it did for you or the codelines don't work .....

Regards Broesel

broesel:

 I could not say better... :approve:

That exactly what I did, I found some extra space that I believed you copy/paste the code from here.  Sorry, I did not remind you for that.  :oops: