Jump to content

Recommended Posts

Posted

I have a custom control based on TUniCustomHTMLFrame  which works with a <canvas> element.

 

I have a Javascript function called resizeCanv() which is as follows:

 

function resizeCanv(){
   var canvas = $( "canvas#'+JSName+'" )[0];
   canvas.width = canvas.parentElement.clientWidth;
   canvas.height = canvas.parentElement.clientHeight;
 }
 
In my TUniFAKECanvas controls .create the  HTML.Text is set to <canvas id="'+JSName+'"></canvas> 
and the resizeCanv() is called.
 
It all works great.
 
I then added the Align to allow me to use 'client' for sizing.
 
When the form is resized, the HTMLFrame resizes ok, but I need to call my resizeCanv() javascript function.
 
Inside the custom control, what should I hook / trap and whats the recommended way inside a custom control to trap a forms align=client
so the child controls can be resized/moved etc ?
 
Thanks
 
 
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...