EV_DRAWING_AREA

11 Messages Forum Options Options
Permalink
paskari
EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
I am trying to draw simple primitives in EV_DRAWING_AREA with the
following code, but I'm running into problems, namely the primitives
don't show up. It's as if they are being pushed off the edge of the
planet.

local
                drawing_area : EV_DRAWING_AREA
                info_box : EV_WIDGET
        do
                create drawing_area.default_create

                drawing_area.clear
                drawing_area.draw_ellipse (10,10, 10,10)

                info_box.set_height (800)
                info_box.set_width (800)
                info_box.set_position (10,50)

                info_box.show
                info_box.extend (drawing_area)
        end


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

larryliuming
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
Hi, Paskari007,

In your code:

> info_box.set_height (800)
> info_box.set_width (800)
> info_box.set_position (10,50)

It will not compile since EV_WIDGET don't have features: set_height,
set_width, set_position.

> info_box.extend (drawing_area)

It will not compile since only EV_CONTAINER and its descendants have
the feature `extend'.

After corrected the problems above, you should add an action hander
agent feature to {EV_DRAWING_AREA}.expose_actions. The
`expose_actions' will be called each time when Windows (or Linux)
desktop manager request a drawing on your {EV_DRAWING_AREA}. You
should not only draw it once since it will be cleared and no expose
actions to redraw the {EV_DRAWING_AREA}.

So you should write something like:

        your_feature is
                        --
                do
                        drawing_area.expose_actions.force_extend (agent on_expose_actions)
                end

        on_expose_actions is
                        --
                do
                        drawing_area.clear
                        drawing_area.draw_ellipse (10,10, 10,10)
                end

Also make sure your {EV_DRAWING_AREA} have enough width and height to
show. You can call {EV_DRAWING_AREA}.set_minimum_width,
set_minimum_height.

Hope it helps. Good luck.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

paskari
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
I'm sorry I didn't reply to this earlier. Thank you very much for your help. My problem is that I am not very good with the Vision2 library, and there is literally no where I can turn to. Everything I currently know I learned from the accompanying examples to Estudio.

turns out the problem was that I was not utilizing the expose actions.

Again, thank you very much


Paskari
larryliuming wrote:
Hi, Paskari007,

In your code:

> info_box.set_height (800)
> info_box.set_width (800)
> info_box.set_position (10,50)

It will not compile since EV_WIDGET don't have features: set_height,
set_width, set_position.

> info_box.extend (drawing_area)

It will not compile since only EV_CONTAINER and its descendants have
the feature `extend'.

After corrected the problems above, you should add an action hander
agent feature to {EV_DRAWING_AREA}.expose_actions. The
`expose_actions' will be called each time when Windows (or Linux)
desktop manager request a drawing on your {EV_DRAWING_AREA}. You
should not only draw it once since it will be cleared and no expose
actions to redraw the {EV_DRAWING_AREA}.

So you should write something like:

        your_feature is
                        --
                do
                        drawing_area.expose_actions.force_extend (agent on_expose_actions)
                end

        on_expose_actions is
                        --
                do
                        drawing_area.clear
                        drawing_area.draw_ellipse (10,10, 10,10)
                end

Also make sure your {EV_DRAWING_AREA} have enough width and height to
show. You can call {EV_DRAWING_AREA}.set_minimum_width,
set_minimum_height.

Hope it helps. Good luck.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@yahoogroups.com
    mailto:eiffel_software-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
paskari
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
is there any expose actions for setting up an animation? I have a sinusoid in my drawing area, but I want to make it transition through time (sort of like a snake slithering around). Is there a specific expose action for this? I can us on-click expose actions, but then I have to continuously click the screen. What I really want is an animation.

Thanks
Peter Horan
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
In reply to this post by paskari
paskari wrote:
> is there any expose actions for setting up an animation? I have a sinusoid in
> my drawing area, but I want to make it transition through time (sort of like
> a snake slithering around). Is there a specific expose action for this? I
> can us on-click expose actions, but then I have to continuously click the
> screen. What I really want is an animation.

Use EV_TIMER.

You can animate elements by adding agents to EV_TIMER's `actions'  
list. Your agent will need to step a parameter in each element and  
re-draw them.
--
Peter Horan             Faculty of Science and Technology
peter@...     Deakin University
+61-4-0831 2116 (Voice) Geelong, Victoria 3217, AUSTRALIA
+61-3-5227 2028 (FAX)   http://www.eit.deakin.edu.au/~peter

-- The Eiffel guarantee: From specification to implementation
-- (http://www.cetus-links.org/oo_eiffel.html)



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

jocelyn-2
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
Just a minor correction, Peter is talking about EV_TIMEOUT  (not
EV_TIMER which does not exist)


On 6/14/2008 07:27 AM, Peter Horan wrote:

> paskari wrote:
>  
>> is there any expose actions for setting up an animation? I have a sinusoid in
>> my drawing area, but I want to make it transition through time (sort of like
>> a snake slithering around). Is there a specific expose action for this? I
>> can us on-click expose actions, but then I have to continuously click the
>> screen. What I really want is an animation.
>>    
>
> Use EV_TIMER.
>
> You can animate elements by adding agents to EV_TIMER's `actions'  
> list. Your agent will need to step a parameter in each element and  
> re-draw them.
>  



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

paskari
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
Thank you very much for your help. This is really going to help me with my GUI

Paskari

=)
--- In eiffel_software@..., Jocelyn <eiffel@...> wrote:

>
> Just a minor correction, Peter is talking about EV_TIMEOUT  (not
> EV_TIMER which does not exist)
>
>
> On 6/14/2008 07:27 AM, Peter Horan wrote:
> > paskari wrote:
> >  
> >> is there any expose actions for setting up an animation? I have a sinusoid in
> >> my drawing area, but I want to make it transition through time (sort of like
> >> a snake slithering around). Is there a specific expose action for this? I
> >> can us on-click expose actions, but then I have to continuously click the
> >> screen. What I really want is an animation.
> >>    
> >
> > Use EV_TIMER.
> >
> > You can animate elements by adding agents to EV_TIMER's `actions'  
> > list. Your agent will need to step a parameter in each element and  
> > re-draw them.
> >
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

paskari
Re: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
I've noticed a problem with EV_TIMEOUT. If I have it set to carry out a series of actions at regular intervals, sometimes it just gives up after a certain number of iterations. Sometimes it doesn't even carry out the first iteration, making it appear as if it isn't working properly.

I have it set up such that I have a main window with several nodes (EG_SIMPLE_NODE) and every time the user hovers over one, an info box opens up (EV_WINDOW). I have put the EV_TIMEOUT class inside this info box. The info box then has an EV_V_BOX, which has an EV_DRAWING_AREA. The EV_TIMEOUT class has all the methods for refreshing the drawing areas. However, sometimes it just gives up refreshing the animation (in the drawing areas) and it turns into a static drawing area.

Can anyone give any insight as to what may be going on?

Thank You
rfo
RE: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
In reply to this post by paskari
It might be that the EV_TIMEOUT object you're creating is being
collected as it goes out of scope. Be sure that the timeout is not more
'temporary' than the you really want it to be.

     R

==================================================
Roger F. Osmond
----------------------------------------
Amalasoft Corporation
273 Harwood Avenue
Littleton, MA 01460

> -------- Original Message --------
> Subject: Re: [eiffel_software] EV_DRAWING_AREA
> From: paskari <paskari007@...>
> Date: Mon, June 16, 2008 4:05 pm
> To: eiffel_software@...
> I've noticed a problem with EV_TIMEOUT. If I have it set to carry out a
> series of actions at regular intervals, sometimes it just gives up after a
> certain number of iterations. Sometimes it doesn't even carry out the first
> iteration, making it appear as if it isn't working properly.
> I have it set up such that I have a main window with several nodes
> (EG_SIMPLE_NODE) and every time the user hovers over one, an info box opens
> up (EV_WINDOW). I have put the EV_TIMEOUT class inside this info box. The
> info box then has an EV_V_BOX, which has an EV_DRAWING_AREA. The EV_TIMEOUT
> class has all the methods for refreshing the drawing areas. However,
> sometimes it just gives up refreshing the animation (in the drawing areas)
> and it turns into a static drawing area.
> Can anyone give any insight as to what may be going on?
> Thank You
> --
> View this message in context: http://www.nabble.com/EV_DRAWING_AREA-tp16539407s16963p17872301.html
> Sent from the Eiffel Software Users mailing list archive at Nabble.com.


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

paskari
RE: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
Roger

I'll give it a try, however, I'm not sure if this will fix the problem, EV_TIMEOUT is a local variable inside of my info box (EV_WINDOW). the info box appears whenever I hover over a node, and disapears whenever I leave the node. Now if I leave the node, then it is true that the EV_TIMEOUT variable will be destroyed, however, under this circumstance the info box should also be destroyed. What's happening, in this case, is not that the animation is being removed/destroyed, it's that it is being converted into a static image.

Thanks for the help


paskari
rfo wrote:
It might be that the EV_TIMEOUT object you're creating is being
collected as it goes out of scope. Be sure that the timeout is not more
'temporary' than the you really want it to be.

     R

==================================================
Roger F. Osmond
----------------------------------------
Amalasoft Corporation
273 Harwood Avenue
Littleton, MA 01460

> -------- Original Message --------
> Subject: Re: [eiffel_software] EV_DRAWING_AREA
> From: paskari <paskari007@yahoo.ca>
> Date: Mon, June 16, 2008 4:05 pm
> To: eiffel_software@yahoogroups.com
> I've noticed a problem with EV_TIMEOUT. If I have it set to carry out a
> series of actions at regular intervals, sometimes it just gives up after a
> certain number of iterations. Sometimes it doesn't even carry out the first
> iteration, making it appear as if it isn't working properly.
> I have it set up such that I have a main window with several nodes
> (EG_SIMPLE_NODE) and every time the user hovers over one, an info box opens
> up (EV_WINDOW). I have put the EV_TIMEOUT class inside this info box. The
> info box then has an EV_V_BOX, which has an EV_DRAWING_AREA. The EV_TIMEOUT
> class has all the methods for refreshing the drawing areas. However,
> sometimes it just gives up refreshing the animation (in the drawing areas)
> and it turns into a static drawing area.
> Can anyone give any insight as to what may be going on?
> Thank You
> --
> View this message in context: http://www.nabble.com/EV_DRAWING_AREA-tp16539407s16963p17872301.html
> Sent from the Eiffel Software Users mailing list archive at Nabble.com.


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@yahoogroups.com
    mailto:eiffel_software-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
paskari
RE: EV_DRAWING_AREA
Reply Threaded More
Print post
Permalink
Roger it worked like a charm. Thanks for the advice

Paskari

Roger

I'll give it a try, however, I'm not sure if this will fix the problem, EV_TIMEOUT is a local variable inside of my info box (EV_WINDOW). the info box appears whenever I hover over a node, and disapears whenever I leave the node. Now if I leave the node, then it is true that the EV_TIMEOUT variable will be destroyed, however, under this circumstance the info box should also be destroyed. What's happening, in this case, is not that the animation is being removed/destroyed, it's that it is being converted into a static image.

Thanks for the help


paskari
rfo wrote:
It might be that the EV_TIMEOUT object you're creating is being
collected as it goes out of scope. Be sure that the timeout is not more
'temporary' than the you really want it to be.

     R

==================================================
Roger F. Osmond
----------------------------------------
Amalasoft Corporation
273 Harwood Avenue
Littleton, MA 01460

> -------- Original Message --------
> Subject: Re: [eiffel_software] EV_DRAWING_AREA
> From: paskari <paskari007@yahoo.ca>
> Date: Mon, June 16, 2008 4:05 pm
> To: eiffel_software@yahoogroups.com
> I've noticed a problem with EV_TIMEOUT. If I have it set to carry out a
> series of actions at regular intervals, sometimes it just gives up after a
> certain number of iterations. Sometimes it doesn't even carry out the first
> iteration, making it appear as if it isn't working properly.
> I have it set up such that I have a main window with several nodes
> (EG_SIMPLE_NODE) and every time the user hovers over one, an info box opens
> up (EV_WINDOW). I have put the EV_TIMEOUT class inside this info box. The
> info box then has an EV_V_BOX, which has an EV_DRAWING_AREA. The EV_TIMEOUT
> class has all the methods for refreshing the drawing areas. However,
> sometimes it just gives up refreshing the animation (in the drawing areas)
> and it turns into a static drawing area.
> Can anyone give any insight as to what may be going on?
> Thank You
> --
> View this message in context: http://www.nabble.com/EV_DRAWING_AREA-tp16539407s16963p17872301.html
> Sent from the Eiffel Software Users mailing list archive at Nabble.com.


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@yahoogroups.com
    mailto:eiffel_software-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/