Jump to content

Recommended Posts

Posted

As requested, a simple project showing some canvas drawing

with auto layout, in relation to calendar systems.

 

The JS itself is straightforward in these cases, as you do the

calculations, store the rects and then just repond to events.

 

Of course drag and drop makes things quite a bit more complex.

 

 

Notice that the javascript is loaded into a stringlist in unimainmodule.

 

This way it gets loaded on app reload, so you can edit the JS in

your favorite editor and just hit F5 on the browser to see the changes

as the unigui app reloads. No new compilation necessary, unless you

of course work with the server ajax responses.

 

Notice also the onresize event in ExtClientEvents, to trigger the

canvas update.

 

Another thing with loading the JS this way, is that you can add

stuff before you send it to the htmlframe, like variables etc.,

and at the end tuck on the </script> statement.

 

Notice that all JS loads into the same namespace, so use

different variable names to avoid creating funny little bugs.

 

 

Kaj

 

unigui canvas test.zip

post-980-0-89311000-1440503387_thumb.png

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...