I can post the code if you need to see it...
Page 1 of 1
Layer position
#3
Posted 06 November 2006 - 01:37 PM
I'm using sth like:
and i have
But it does not seem to work... I tried without the parseInt , but does not work either...
function ApplyAdvSettings(){
this.parameters('FlipX').Value = parseInt(this.controls('FlipX').Value);
this.FlipTo(0);
this.ReDraw(true);
}and i have
<layer name="FrontFlip" x="%FlipX%" y="%FlipY%" width="13" height="13" src="flipit.png" onclick="!FLIP:1" mousecursor="crDefault" alpha="0" fontalign="LT" fullhittest="yes"/> }
But it does not seem to work... I tried without the parseInt , but does not work either...
#4
Posted 06 November 2006 - 01:45 PM
Ah, rebinding the parameter is not automatically, unfortunately. So, you'll need to modify to code with:
function ApplyAdvSettings(){
var newXval = parseInt(this.controls('FlipX').Value);
this.parameters('FlipX').Value = newXval;
this.layers("FrontFlip").x = newXval;
this.FlipTo(0);
this.ReDraw(true);
}
#5
Posted 06 November 2006 - 01:54 PM
I understand. Thanks you very much!!
But one question: why does this work?
But one question: why does this work?
function ApplySettings(){
var StampParam = this.parameters('StampImage');
var StampImage = this.controls('StampImage');
StampParam.Value = StampImage.Value;
this.FlipTo(0);
this.ReDraw(true);
}
...
<layer name="FrontBG" x="59" y="41" width="128" height="128" src="%StampImage%.png" fontalign="LT" mousecursor="crSizeAll"/>
#7
Posted 07 November 2006 - 02:40 PM
Position isn't auto rebounded. Actually position at first wasn't even allowed to be parameters. I added parameter option a couple of version ago so I would be able to have rebinding option available in the near future.
The image is auto rebinding.
The only reason was I was trying to conserve Memory space so I don't store the parameter information "string" value in memory but since the source is stored in string it is autorebinding.
The last version I introduced the option to force a "Rebind" on layers. Layers.ReloadSkin which makes all layers rebind.
I'm debating on making it more flexible at the cost of more memory for the future version.
The image is auto rebinding.
The only reason was I was trying to conserve Memory space so I don't store the parameter information "string" value in memory but since the source is stored in string it is autorebinding.
The last version I introduced the option to force a "Rebind" on layers. Layers.ReloadSkin which makes all layers rebind.
I'm debating on making it more flexible at the cost of more memory for the future version.
#8
Posted 07 November 2006 - 08:37 PM
Ok, i get it now. But what about refresh intervals? Is this OK?
<xmls>
<xml src="%SiteAddress%" interval="%RefreshDelay%" usewintmp="yes" ongetdata="UpdateMails();"/>
</xmls>
....
var RefreshParam = this.parameters('RefreshDelay');
var RefreshVal = this.controls('RefreshDelay');
RefreshParam.Value = parseInt(RefreshVal.Value);
#9
Posted 08 November 2006 - 02:02 PM
YEs that will work, BUT (always a but) you will need to call the Resettimer for the new value to take effect. For speed purpose I don't compare the timer every millisec doing a convert of string to a value so that I can see if its ok. I instead convert on start of a timer and use the converted value until the timer is reset.
#11
Posted 11 November 2006 - 02:36 PM
When you create a timer, you have an object that you can call, just like a layer.
So if you have a timer called 'EveryDayTimer'
You can do the following to reset
timer = desklet.timers('EveryDaytimer'); //Get the timer in question
timer.ResetTimer(); //To reset the timer
So if you have a timer called 'EveryDayTimer'
You can do the following to reset
timer = desklet.timers('EveryDaytimer'); //Get the timer in question
timer.ResetTimer(); //To reset the timer
#12
Posted 11 November 2006 - 03:12 PM
Ah, but i have no timer. I have:
Do I have to use a timer to change the interval attribute?
<xmls>
<xml src="%SiteAddress%" interval="%RefreshDelay%" usewintmp="yes" ongetdata="UpdateMails();"/>
</xmls>
....
<param name="RefreshDelay" default="2" save="yes" onupdate=""/>
.....
var RefreshParam = this.parameters('RefreshDelay');
var RefreshVal = this.controls('RefreshDelay');
RefreshParam.Value = parseInt(RefreshVal.Value);Do I have to use a timer to change the interval attribute?
Page 1 of 1








Sign In »
Register Now!
Help

MultiQuote