Strange PasteUpMorph>>drawOn:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange PasteUpMorph>>drawOn:

Hilaire Fernandes-5
I found this method a bit strange. As it is showed by its code sample
below, grid will be rendered only if gridding is on.

Do I miss something?


---
(self griddingOn and: [self gridVisible])
        ifTrue:
                [aCanvas fillRectangle: self bounds
[...]
---

Hilaire

Reply | Threaded
Open this post in threaded view
|

Re: Strange PasteUpMorph>>drawOn:

Tom Phoenix
On 3/20/06, Hilaire Fernandes <[hidden email]> wrote:

> I found this method a bit strange. As it is showed by its code sample
> below, grid will be rendered only if gridding is on.

That sounds like exactly what I'd expect. What's strange?

--Tom Phoenix

Reply | Threaded
Open this post in threaded view
|

Re: Strange PasteUpMorph>>drawOn:

Hilaire Fernandes-5
Tom Phoenix a écrit :
> On 3/20/06, Hilaire Fernandes <[hidden email]> wrote:
>
>
>>I found this method a bit strange. As it is showed by its code sample
>>below, grid will be rendered only if gridding is on.
>
>
> That sounds like exactly what I'd expect. What's strange?

griddingOn is a flag to know if point are to be locked to the grid
position (using the PasteUpMorph>>gridPoint: method)

gridVisible is a flag to tell if the grid is visible.

In the drawOn: method it looks to me a grid is display only if the 1.
gridding is activated, 2. the grid is set to be visible.

Indeed, this is the behavior I noted when I try to use the grid and the
gridding in my code. I try to get only one of these feature but I have
to take both. As a result I have to duplicate the griddingFlag in my
code to know if I want or not to use gridding.

>
> --Tom Phoenix
>


--
ADD R0,R1,R2,LSL #2

Reply | Threaded
Open this post in threaded view
|

Re: Strange PasteUpMorph>>drawOn:

Tom Phoenix
On 3/20/06, Hilaire Fernandes <[hidden email]> wrote:

> griddingOn is a flag to know if point are to be locked to the grid
> position (using the PasteUpMorph>>gridPoint: method)
>
> gridVisible is a flag to tell if the grid is visible.
>
> In the drawOn: method it looks to me a grid is display only if the 1.
> gridding is activated, 2. the grid is set to be visible.
>
> Indeed, this is the behavior I noted when I try to use the grid and the
> gridding in my code. I try to get only one of these feature but I have
> to take both.

It sounds as if you want to have the grid drawn even when it's not
active. Is that it? Although the code in PasteUpMorph>>drawOn: doesn't
currently support showing the grid when it's not active, as you've
found, it should not be difficult to make it possible.

> As a result I have to duplicate the griddingFlag in my
> code to know if I want or not to use gridding.

When you say "duplicate", do you mean that you are having your own
code draw the grid, duplicating some code from PasteUpMorph>>drawOn: ?
Or do you mean that you are unable to access the value of griddingOn?

I feel as if I'm missing your meaning. I can't be sure whether you're
asking how to do something, reporting a bug, or something else. If it
seems to you that you haven't been heard, feel free to repeat your
request in French (or whatever language you're best at). Although I
won't be able to answer in French, someone else on the list may be
able to help.

Good luck with it!

--Tom Phoenix

Reply | Threaded
Open this post in threaded view
|

Re: Strange PasteUpMorph>>drawOn:

Hilaire Fernandes-5
Tom Phoenix a écrit :

> It sounds as if you want to have the grid drawn even when it's not
> active. Is that it? Although the code in PasteUpMorph>>drawOn: doesn't
> currently support showing the grid when it's not active, as you've
> found, it should not be difficult to make it possible.

Hum, yes, it is that. May be the grid was design that way, which at
first looks to me as a wrong design. May be I am the first one to
display a grid without the gridding (magnetic grid feaure), then later I
 can activate gridding, wheter the grid is visible or not. Of course it
was not difficult to make it possible, but to do that I have to
duplicated in my own class the griddingFlag which I am not that much
happy with. But of course it is just a minor problem.


>>As a result I have to duplicate the griddingFlag in my
>>code to know if I want or not to use gridding.
>
>
> When you say "duplicate", do you mean that you are having your own
> code draw the grid, duplicating some code from PasteUpMorph>>drawOn: ?

No, I wrote: "I have to duplicate the griddingFlag", not to duplicate
code. The griddingOn as to be true if you want to display the grid, it
looks to me as a duplicated behavior of the gridVisible flag.


> Or do you mean that you are unable to access the value of griddingOn?
>
> I feel as if I'm missing your meaning. I can't be sure whether you're
> asking how to do something, reporting a bug, or something else. If it

I want to have some exchange regarding this strange situation with grid
and gridding. I know where to report bug, don't worry.

> seems to you that you haven't been heard, feel free to repeat your
> request in French (or whatever language you're best at). Although I

I am afraid you will have to get used with my English.

Thanks for your time,

Hilaire Fernandes