<br><br><div class="gmail_quote">On Fri, Jul 4, 2008 at 12:10 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/7/4 Michael van der Gulik &lt;<a href="mailto:mikevdg@gmail.com">mikevdg@gmail.com</a>&gt;:<br>
<br><div class="Ih2E3d"><br>
&gt; Features of it are:<br>
&gt; * Some canvases can have child canvases, each with a z-index. These could be<br>
&gt; used, e.g., to implement movable windows, sprites, clipped scrollable areas,<br>
&gt; or flyweight graphics. This will use the underlying graphics system&#39;s<br>
&gt; capabilities.<br>
&gt;<br>
</div>mmm.. i like this idea in general, but please, lets make it more<br>
general: no z-index (or any early binding to coordinate system).<br>
Simply child canvas concept.</blockquote><div><br><br>A parent canvas could have multiple children. When the Canvas architecture wants to render these, it needs to know the distance each child is from the shared parent. You also need to know the distance between child and parent if you want to add relection, shadows and lighting in the OpenGL version :-D.<br>
<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">&gt; * An event handling system will also be part of this package. Mouse events<br>

&gt; will have a canvas (or sub-canvas) coordinate; keyboard events will be sent<br>
&gt; to the canvas that has the &quot;keyboard focus&quot;.<br>
&gt;<br>
<br>
</div>Please don&#39;t. An event subsystem should not be connected directly with canvases.<br>
It should be a separate layer for applications.<br>
Any coordinate translations should come this way: Event -&gt;<br>
morph(widget) -&gt; canvas.<br>
But never Event-&gt;canvas.<br>
<br>
Suppose you moving a scrollbar knob. For this you would need 2<br>
different coordinates in result:<br>
- one to update hand position<br>
- second to update knob position<br>
<br>
Or, suppose you dragging something in 3D space. You may move mouse to<br>
the left or right, but movements will be translated in different way<br>
(dragging object(s) closer/farther from eye).<br>
<br>
It is up to morphs/UI how to deal with events and then how to update<br>
themselves on screen as a reaction on such event.</blockquote><div><br><br>Every Canvas has it&#39;s own coordinate system; they can be positioned
anywhere on the screen, but still have (0@0) in their bottom-left
corner. This means that mouse-based events with a position are relevant
only for a particular Canvas.<br><br>What I was considering doing was making the Canvas the source of events. Every Canvas has a model which must implement event handling methods and a #drawOn:bounds: method. A Canvas can ask the model to redraw itself when the Canvas becomes dirty (e.g. when sub-canvases move and the canvas has no cached state).<br>
<br>I&#39;ve implemented a scroll bar using this kind of system. The scroll bar just needs to remember where the original mouseDown event was. I don&#39;t understand what your point was here.<br><br>As with dragging things in 3-D space, I&#39;ll need to invent some way of making mouse capture secure.<br>
<br>Do you still think this is a bad design?<br><br>&nbsp;<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
&gt; I don&#39;t know how to handle fonts - I don&#39;t know what the pros/cons of having<br>
&gt; a font API built in to the canvas is, or whether it is better to have the<br>
&gt; font drawing done externally by each application.<br>
&gt;<br>
<br>
</div>Lets discuss that a bit, before you going to start implementing it.<br>
Recently, we discussed a lot of ideas with Gary about canvases/events.<br>
I think you should be aware of what conclusions we had, at least.<br>
Gary, can you refresh my memory about ordinates &amp; events ideas we discussed? :)<br>
<font color="#888888"></font></blockquote><div><br><br>This is why I posted here :-).<br><br>IRC logs would be good, if they can be found.<br><br>Gulik.&nbsp; <br></div></div><br><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br>
<a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a>