comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » selection box in widget program
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
selection box in widget program [message #55992] Wed, 26 September 2007 09:45 Go to next message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
Hi,

I'm writing a program that needs to ask the user to select a region of
an image. I'd like to have a routine that would allow the user to
click and drag a selection box (a rubber band box), returning the
coordinates of the box to the program once the user has made a
selection.

This is a widget program using object graphics.

The draw window displaying the widget has its own event handler,
handling keyboard, motion, and button click events.

What I want to do, essentially, is temporarily have all of the motion
and button click events handled by the drawbox routine. This way I
can loop on a call to widget_event, obtaining all of the mouse events,
and continually redrawing the selection box, until the user is done.
So, what I am going to try to do is UNSET the EVENT_PRO keyword to the
draw widget, loop on widget_event as described, and then re-set the
EVENT_PRO keyword to the original event handler.

Is this how people usually go about handling these situations? It
seems like clicking and dragging a selection box would be the world's
most common routine, but I haven't found many examples of it when
using object graphics and widget programs with event handlers.. etc.

To summarize, what I'm trying to build is a black box routine that
waits for the user to click and drag a selection box, returning the
coordinates, all within an object graphics, widget program.

thanks,
Mark Bates
Harvard University
Re: selection box in widget program [message #56067 is a reply to message #55992] Thu, 27 September 2007 13:43 Go to previous message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
Alright David, I think I've seen the light. I now have the exclusive
button bar specifying different "modes" for the draw window. Nice
idea. Thanks.

Mark
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: making a checkerboard array?
Next Topic: BMP to cursor bitmap

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:33:02 PDT 2025

Total time taken to generate the page: 0.01207 seconds