hello, please help about ccanvas, why it does reset all my globals variables.... ? :((

To add comments, please log in or register
boobyditbeber
48
boobyditbeber  

Hello,


I have a serious problem with ccanvas

If I use mycanvas.Destroy() in OnDeinit() it will reset all my globals variables.

If I don't use it I will keep all in same place but I loose all information about my canvas ofcourse. It must be created a new time by OnInit with a new object because it delete the object too. 

So very strange how ccanvas works. all is right, but I don't know why my global variables are modified ??

I hope you will understand what I speak about because it not so easy to explain it.


If an guru know how to keep my globals variables  without change.....

Thanks 

Ps: you can test it in mt4 or mt5 is you change in .mq5

luaunch the indicator as usually. now click one time on the object (top left) release the button and drag as you want . click a new time and your object will stay a that place. etc...

compare between those 2 guys. so if you change the color with Destroy() the object will always go back to the top left of the screen. reset the position. not what I want.

Without Destroy() the object stay at the same place if I change the color, BUT the COLOR DOES nOT change...


laurent

boobyditbeber
48
boobyditbeber  
boobyditbeber:

Hello,


I have a serious problem with ccanvas

If I use mycanvas.Destroy() in OnDeinit() it will reset all my globals variables.

If I don't use it I will keep all in same place but I loose all information about my canvas ofcourse. It must be created a new time by OnInit with a new object because it delete the object too. 

So very strange how ccanvas works. all is right, but I don't know why my global variables are modified ??

I hope you will understand what I speak about because it not so easy to explain it.


If an guru know how to keep my globals variables  without change.....

Thanks 

Ps: you can test it in mt4 or mt5 is you change in .mq5

luaunch the indicator as usually. now click one time on the object (top left) release the button and drag as you want . click a new time and your object will stay a that place. etc...

compare between those 2 guys. so if you change the color with Destroy() the object will always go back to the top left of the screen. reset the position. not what I want.

Without Destroy() the object stay at the same place if I change the color, BUT the COLOR DOES nOT change...


laurent

Hello,


I found a nice way to keep the x and y positions. All informations after the OnDeinit() are lost and Ccanvas free by itself or OnDeinit() the memory allocation done by :  myObject01.CreateBitmapLabel(.....)

So the way is to copy the x and y position into another LabelObject that is not a Ccanvas Object :))))

The problem was the Ccanvas object didn"t keep the x and y position when I changed the timeframe. 

NOW it is RIGHT.

As always keep the way to find a trick when you program, and the light will be after some hard work and test. never fall down, your mind always will win the game :))

you will find the file to compare it. use it if you want in your program ... you will need to clean a bit , but it works so .


Soon it will be a clock with transparency level, color and a full of possibilities..

A countdown timer is on the way too.

i will give a try for the end of january a think... bye

Laurent

I deleted the file I have to udpate it a little bit more thanks for your patience :))

To add comments, please log in or register