<div dir="ltr"><div>How can i make this please ?<br></div>I thought to add "color" and "size" commands as "clear" command in the custom menu code. After that, add "color" and "size" methods...<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-20 20:26 GMT+02:00 Ron Teitelbaum <span dir="ltr"><<a href="mailto:ron@usmedrec.com" target="_blank">ron@usmedrec.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Have you considered having a menu bar with colors and line sizes. The users can select the color and line size which will change your program to use those settings.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">All the best,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ron Teitelbaum<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:beginners-bounces@lists.squeakfoundation.org" target="_blank">beginners-bounces@lists.<wbr>squeakfoundation.org</a> [mailto:<a href="mailto:beginners-bounces@lists.squeakfoundation.org" target="_blank">beginners-bounces@<wbr>lists.squeakfoundation.org</a>] <b>On Behalf Of </b>roger mpouma<br><b>Sent:</b> Saturday, August 20, 2016 1:51 PM<br><b>To:</b> A friendly place to get answers to even the most basic questions about Squeak.<br><b>Subject:</b> Re: [Newbies] Project on squeak language<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">I have already implemented the canvas on which we draw, the possibility of drawing with the brush but with only a single color and a single size, a capacity to erase what we have already drawn with the "Clear" command on the custom menu code. <br>So, i'd like to add the possibility of changing the color and the size of the brush presenting the choices of color and brush size.<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">The differents methods are:<u></u><u></u></p></div><div><p class="MsoNormal">"Methods"<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">extent: aPoint<br> | newForm |<br> super extent: aPoint.<br> newForm := Form extent: self extent depth: 16.<br> newForm fillColor: Color veryLightGray.<br> form ifNotNil: [form displayOn: newForm].<br> form := newForm.<br> <br> <br>initialize<br> super initialize.<br> self extent: 500@350.<br> <br>drawOn: aCanvas<br> aCanvas image: form at: bounds origin.<br> <br>handlesMouseDown: evt<br> ^ true <br> <br>mouseDown: evt<br> brush := Pen newOnForm: form.<br> brush roundNib: 3.<br> brush color: Color red.<br> lastMouse := evt cursorPoint - bounds origin.<br> brush drawFrom: lastMouse to: lastMouse.<br> self invalidRect:<br> ((lastMouse - brush sourceForm extent corner:<br> lastMouse + brush sourceForm extent)<br> translateBy: bounds origin).<br> <br> <br>mouseMove: evt<br> | p |<br> p := evt cursorPoint - bounds origin.<br> p = lastMouse ifTrue: [^ self].<br> brush drawFrom: lastMouse to: p.<br> self invalidRect: ((<br> ((lastMouse min: p) - brush sourceForm extent) corner:<br> ((lastMouse max: p) + brush sourceForm extent))<br> translateBy: bounds origin).<br> lastMouse := p.<br> <br> <br>addCustomMenuItems: aCustomMenu hand: aHandMorph<br> super addCustomMenuItems: aCustomMenu hand: aHandMorph.<br> aCustomMenu add: 'clear' action: #clear.<br> <br> <br>clear<br> form fillColor: Color veryLightGray.<br> self changed.<u></u><u></u></p></div><p class="MsoNormal">"Class PaintMorph"<u></u><u></u></p><div><p class="MsoNormal" style="margin-bottom:12.0pt">Morph subclass: #PaintMorph<br> instanceVariableNames: 'form brush lastMouse'<br> classVariableNames: ''<br> poolDictionaries: ''<br> category: 'Morphic-Fun'<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">"Workspace"<br>PaintMorph new openInWorld.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thank you in advance.<u></u><u></u></p></div></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">2016-08-20 18:47 GMT+02:00 Bert Freudenberg <<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>>:<u></u><u></u></p><div><p class="MsoNormal">Sure. Just ask some specific questions - e.g. what you tried, what worked, what didn't etc.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">- Bert -<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal">On Sat, Aug 20, 2016 at 10:59 AM, roger mpouma <<a href="mailto:rmpouma@gmail.com" target="_blank">rmpouma@gmail.com</a>> wrote:<u></u><u></u></p></div></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">Hello, <br>I need help for a drawing project on Squeak. I'd like implement a canvas on which we draw with the possibility of drawing with brush changing the color and size of the brush. Is it possibile to have help ?<br><br>Thank you in advance. <u></u><u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt">______________________________<wbr>_________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.<wbr>squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.<wbr>squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div><br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.<wbr>squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>