Re: Deprecated "Graphics" dropped
Jon Ogden <[email protected]> Sat, 22 Dec 2018 14:08:25 -0600
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Message-ID | <[email protected]> |
Create a Boolean property called MouseDwn. Set it to True in the MouseDown e= vent. Set it to False in MouseUp.=20 In the MouseDown event call refresh or invalidate after you set MouseDwn tru= e In Paint, use an If/Then block to check for MouseDwn and if true execute= your code.=20 The other option is to create a picture. You can access the graphics propert= y of the picture and draw there. Then draw the picture in the paint event.=20= This change has been at least three or four years in the making. Ever since X= ojo releases Cocoa framework.=20 Sent from my iPhone > On Dec 22, 2018, at 11:56 AM, Daniel Drijard <[email protected]> wrot= e: >=20 > Hello James,=20 >=20 > I accept this, but I need a correction for my problems.=20 > In this case, the MouseDown I mentioned is part of ColorButton, a Canvas= which has as well a Paint component which holds: >>>>>>>>>>>=20 > g.ForeColor=3DRGB(0,0,0) //black > g.DrawRect(0,0,g.Width-1,g.Height-1) > g.ForeColor=3DOutText.SelTextColor > g.FillRect(1,1,g.Width-2,g.Height-2) > <<<<<<<<<< > How can I unite these MouseDown and Paint ? Maybe I could transfer the Mou= seDown part into Paint, changing Me.Graphics to g ? I do not know the underl= ying logics which probably calls MouseDown then Paint.=20 >=20 > Thanks for your help >=20 > Cordially,=20 > Daniel >=20 >=20 >=20 >> On 22 12 2018, at 18:32, Jim Wagner <[email protected]> wrote: >>=20 >> Hello, Daniel - >>=20 >> I believe that graphics is only available in a paint event (for a canvas a= nd such). I think that this restriction was enforced just in the previous re= lease. >>=20 >> Jim >>=20 >> James Wagner >> Oregon Research Electronics >> http://www.orelectronics.net >>=20 >>=20 >>=20 >>=20 >>> On Dec 22, 2018, at 8:31 AM, Daniel Drijard <[email protected]> wro= te: >>>=20 >>> Dropping happened in version Xojo 2018 Release 3. I was not aware of th= e deprecation which happened a few years earlier. Now I would like to use ve= rsion Xojo 2018 Release 4, but this imposes multiple modifications of my pro= ject.=20 >>>=20 >>> My project spans a few thousands of lines of code. The =E2=80=9Cerrors=E2= =80=9D generated by the new version of Xojo are very numerous (a few hundred= s). Fortunately, I suspect they are only due to a small number of reasons, w= hich I have not identified yet.=20 >>>=20 >>> Here is a piece of code is refused, there are many other types of probl= em.=20 >>> MouseDown is here part of the ColorButton of a Controls, itself part of= a Window construct. The error mentioned is that =E2=80=9CType Canvas has no= member named Graphics=E2=80=9D neither Width and Height. >>>>>>>>>>>>>>>>>>=20 >>> MouseDown(X As Integer, Y As Integer) As Boolean >>> Dim c as Color >>> Dim b as Boolean >>> c=3Drgb(255,255,255) //default color >>> b=3DSelectColor(c,"Select a Text Color") >>> If b then >>> Me.Graphics.ForeColor=3Dc >>> Me.Graphics.FillRect(1,1,Me.Graphics.Width-2, Me.Graphics.Height-2)=20 >>> TextField.SelTextColor=3Dc >>> End if >>> <<<<<<<<<<<<<<< >>>=20 >>> I am told to look into the Documentation of Release 3, page 825 and, s= eparately, into Graphics and Multimedia a part of Example Projects. I did my= best but this is not really helpful. I find there no hint on how this shoul= d be modified.=20 >>>=20 >>> Cordially,=20 >>> Daniel >>>=20 >>>=20 >>> Daniel Drijard >>> Thoiry t=C3=A9l=C3=A9phone :=20 >>> 04 50 41 22 75 >>> international >>> +33/4 50 41 22 75 >>> Courriel : >>> [email protected] >>> Thoiry F-01710 >>> 48, rue des Savoies >>>=20 >>=20 >=20 > Daniel Drijard > Thoiry t=C3=A9l=C3=A9phone :=20 > 04 50 41 22 75 > international > +33/4 50 41 22 75 > Courriel : > [email protected] > Thoiry F-01710 > 48, rue des Savoies >=20