add control runtime

Hi, i would like to add some iOScanvases to the view in a row, runtime. I searched the forum and found some examples, but could not figure it out how to use them,
The goal is to create a custom calendar. (7 ioscanvases in a row, 6 in a column and when i press one of them i get back the name/text/caption/etc of it). I could create rectangles with the help of the examples in this topic, but not ioscanvases with Paint and PointerUp events.
I will appreciate any help.

why not just use ONE canvas and draw your grid appropriately?
you can always determine WHERE the user touched…
This way you have ONE control… not between 28 and 31…

Dave is right.

However, just to reply your question, you have to create the single canvas object, place on view as exposed and use addHandler to respond to the event
To replicate what you can do on a desktop app, you could add an index property to the canvas object and use it in the common eventHandler to understand what to do (you have the original object as parameter)

Antonio… I’m not sure for iOS its that easy (Desktop yes)… iOS needs constraints etc… but I’m just guessing

I have now perfectly reliable dynamic controls (reference to the link above).

I don’t really understand why you want to create canvases dynamically. Set your grid once and for all on a view or ContainerControl, and simply change what is displayed in each canvas.

I do concur with Dave, though. It would probably be easier to draw the entire grid on one canvas, and use pointerUp/PointerDown X and Y to know where the user touches.

[quote=293145:@Dave S]why not just use ONE canvas and draw your grid appropriately?
you can always determine WHERE the user touched…
This way you have ONE control… not between 28 and 31…[/quote]
Thank you Dave, that thought hadn’t occurred to me.

If you like…
I’ve written a Calender for my Golfapp. It’s a Canvas and all content is calculated. You can set different colors (Title, borders , weekend) and it resizes automatically depending on the size of the canvas in your views.
The only thing you have to change is the language, because it’s written for Germany.

Here is a little example project with full source code.
Beispielkalender

regards

[quote=293333:@Hans-Jürgen Müller]If you like…
I’ve written a Calender for my Golfapp. It’s a Canvas and all content is calculated. You can set different colors (Title, borders , weekend) and it resizes automatically depending on the size of the canvas in your views.
The only thing you have to change is the language, because it’s written for Germany.

Here is a little example project with full source code.
Beispielkalender

regards[/quote]
Can I modify and use it in my projects?

Of course, your welcome to use it.