Re: Deprecated "Graphics" dropped
Emile SCHWARZ <[email protected]> Wed, 26 Dec 2018 13:27:33 +0100 (CET)
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Message-ID | <1352316382.1237197.1545827253204.JavaMail.open-xchange@opme11oxm21nd1.rouen.francetelecom.fr> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org=
/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml"><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=
"/>
</head><body style=3D"font-family: arial,helvetica,sans-serif; font-size: =
13pt"><p>>These types of errors happen on multiple other Modules. What =
should I do ?</p><p>Just before I closed the web tab, I noticed that.<br></=
p><p><br></p><p>I do not think you followed Xojo way of doing (the links I =
sent you).<br></p><p><br></p><p>In a simple sentence: you cannot anymore us=
e Graphics elsewhere of the Paint Event (so, not in a Module).<br></p><p>In=
a Module case, create a new Picture (say Pict1), draw into it, then in the=
place where you want to display the art, in the Paint Event use some code =
like:<br></p><p>If Pict1 <> Nil Then<br></p><p>g.DrawPicture Pict1,=
0,0</p><p>End If<br></p><p><br></p><p>I hope this helps.<br></p><p><br></p>=
<p>Have a happy new year.<br></p><p><br></p><blockquote type=3D"cite"><p>En=
voyé : 26 décembre 2018 à 12:40de : Daniel Drijard <Dani=
[email protected]><br>à : Nug <nug-Ktk10zIkF/Jvqtv/[email protected]><br>obj=
et : Re: Deprecated "Graphics" dropped<br><br><br>Jim, <br><br> I f=
ollowed your proposition and, indeed, some compilation errors disappeared. =
Some of them are, however, still present. In a Module ModWindow they protes=
t to my code<br> "Me.Graphics.clearRect Me.Left,Me.Top,MeWidth,Me.Heigh=
t”<br> by<br> "This method extends class Canvas, but the base exp=
ression is class ModWindow.ModWindow”<br> and to<br> "Graphics.cl=
earRect(0,0,1000,1000)”<br> by<br> “Static reference to instanc=
e method: call this on an instance of class Graphics.”<br><br> There =
are as well errors on other codes such as<br> "Me.Graphics.drawstring(s=
tr1,430,65,200)”<br><br> These types of errors happen on multiple oth=
er Modules. What should I do ?<br><br>Cordially, <br>Daniel<br><br></p><blo=
ckquote type=3D"cite"><p>On 23 12 2018, at 19:53, Jim McKay <jim@pidog.=
com> wrote:<br><br>My solution is very simple. You add a module to your=
project (via the menu Insert->Module), call it “GraphicsBandaid&=
#8221; or whatever. Add a single method. Now your old code works, unmodifie=
d. I'm not understanding how that is complex.<br><br>After you've a=
dded the new method, calls to canvas1.graphics will simply be forwarded to =
canvas1.backdrop.graphics<br><br>The only real solution is to rewrite your =
code to only access the graphics from inside the paint event.<br><br>On Dec=
23, 2018, at 6:34 AM, Daniel Drijard <[email protected]> wrot=
e:<br><br>I got later a new answer from [email protected] who proposes somethin=
g more complex to escape the problem, without solving it.</p></blockquote><=
p>Daniel Drijard<br>Thoiry téléphone : <br> 04 50 41 22 75<br> in=
ternational<br> +33/4 50 41 22 75<br>Courriel :<br> [email protected]<=
br>Thoiry F-01710<br> 48, rue des Savoies</p></blockquote></body></html>