Re: Deprecated "Graphics" dropped

Keith DeLong <keith-ga5nS8A/[email protected]> Sat, 22 Dec 2018 10:07:55 -0800
Newsgroups gmane.comp.lang.realbasic.user
Message-ID <[email protected]>
Hi Daniel,
What you want to do is create properties for any variables like color, font e=
tc that you want to set in your mouse down event.=20

You then use the graphics object in the paint event to draw the rectangle, a=
fter populating the graphics object with the variable properties that you se=
t your mousedown event.

It=E2=80=99s super simple to achieve the same functionality once you get the=
 hang of it.

Merry Christmas!
Keith DeLong

> On Dec 22, 2018, at 9:56 AM, Daniel Drijard <[email protected]> wrote=
:
>=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