Project

General

Profile

Repaint regions of WPaintedWidget

Added by Ulf Johnsson about 8 years ago

Hi!

I am wondering if it is possible to repaint only certain areas/regions of a WPaintedWidget? (like one can do in Qt)

In my case a have a WPaintedWidget that has many "objects" in it (like boxes circles... and such).

However many of these "objects" are static and do not change their appearance, but some do.

Would it be possible to redraw the dynamic objects without having to repaint all the static ones too?

BR,

Ulf Johnsson.


Replies (4)

RE: Repaint regions of WPaintedWidget - Added by Ulf Johnsson about 8 years ago

I found that one can call WPaintedWidget::update(Wt::PaintUpdate) <- with specified flag.

This gets me halfway to where I want to be.

The thing I need now is to clear certain regions of the widget (the dynamic areas),

the same thing that WPaintedWidget::update() does, but not for the entire widget? Possible?

BR,

Ulf.

RE: Repaint regions of WPaintedWidget - Added by Wim Dumon almost 8 years ago

Would it be possible to draw a rectangle in the background color over the area that you want to redraw?

Wim.

RE: Repaint regions of WPaintedWidget - Added by Ulf Johnsson almost 8 years ago

That is what I am doing now, and it works but is rather limited.

If the background is an image (this can be configured with css-decoration) then it gets rather tricky.

It would be much simpler (and faster) if I could simply clear the specified area (or make it see-through).

It seems like this should be possible since something similar is done when calling WPaintedWidget::update() with no arguments...

BR,

Ulf.

RE: Repaint regions of WPaintedWidget - Added by Wim Dumon almost 8 years ago

That call is missing in our API at the moment. We need a clearRect() method on WCanvasPainter. Can you post a feature request?

Wim.

    (1-4/4)