Project

General

Profile

Selection tool

Added by Marcel Tella about 14 years ago

Hi!

I want to make a selection tool. Something like, you click and drag, and it is creating a square, when you drop, your square is then created, and you can resize it by dragging the borders of this square.

I've thought some manners, I tell you.

-The first one, paint the square, and then repaint it in the next position, store the coordinates and so on... I think this is not a good way because repaint the image involves painting the same pixels again and again, it's just bad performance.

- The good one is to use a WContainerWidget as this selection. I think it internally uses javascript, so we don't overload the server, it's a square, can have a border, an alpha background color to see what is behind it... I think its just a matter of programming.

NOTE: The selection is just over a image, not over all the whole application.

The question is: Does Wt have some tool to do it? I've seen WRect but I'm not sure if it's what I'm looking for.

What do you think about my second alternative?

Thank you very much!


Replies (1)

RE: Selection tool - Added by Koen Deforche about 14 years ago

Hey Marcel,

Your second option is indeed a good option. It is in fact a recurring thing in many applications so I would believe it would be convenient to have it as a utility in the library, or at least as an example !

Regards,

koen

    (1-1/1)