Jump to content

htmlFrame/Canvas test


Recommended Posts

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.





unigui canvas test.zip


Link to comment
Share on other sites

Join the conversation

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

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...