Public Types | |
|
typedef bg_wnd::general_exception< background_wnd, 0 > | index_invalid |
|
typedef bg_wnd::general_exception< background_wnd, 1 > | invalid_painter_cast |
Public Member Functions | |
| unsigned | add_painter (const painter_base &painter) |
| void | delete_painter (unsigned idx) |
| void | delete_all_painters () |
| painter_base & | get_painter (unsigned idx) const |
| std::vector< unsigned > | get_indices () const |
| void | drawing_rect (unsigned idx, const rectangle &rc) |
| rectangle | drawing_rect (unsigned idx) const |
| bool | is_painter_visible (unsigned idx) const |
| void | show_painter (unsigned idx, bool bVisible) |
| void | transparency (unsigned idx, unsigned transparency) |
| unsigned | transparency (unsigned idx) const |
| void | redraw_on_changes (bool bRedraw) |
| bool | redraw_on_changes () const |
| void | redraw_painters () |
| void | zorder_to_front (unsigned idx) |
| void | zorder_to_back (unsigned idx) |
| void | zorder_forward (unsigned idx) |
| void | zorder_backward (unsigned idx) |
| void | bk_color (COLORREF cr) |
| COLORREF | bk_color () const |
| template<class Painter> | |
| unsigned | add_painter () |
| template<class Painter> | |
| unsigned | add_painter (typename Painter::param0 param) |
| template<class Painter> | |
| unsigned | add_painter (typename Painter::param0 param0, typename Painter::param1 param1) |
| template<class Painter> | |
| Painter & | get_painter (unsigned idx) const |
Protected Member Functions | |
| bg_wnd::memory_dc & | get_mem_dc () |
| const bg_wnd::memory_dc & | get_mem_dc () const |
Friends | |
| struct | background_wnd_handler |
background_wnd is a pluggable class which manages the drawing of the background. It maintains a list of so-called "painters". A painter must be derived from painter_base and does the actual drawing. If you want a special painting behaviour follow the steps described here. You can add painters to the background_wnd and you can change the Z-Order and painting area of the painters so they can overlap. With the painter-concept a separation of the drawing logic and the window is achieved. Imagine some common drawing operations - load an image and draw it to the window. This can be done by a painter and added to every window extending background_wnd ;-)
When you add a painter you get an unique index. If you want to manipulate a painter you can do this by passing the index of the painter to the specific member-function. If you pass an invalid index to a function a background_wnd::index_invalid-exception will be thrown. You can get a reference to a painter by calling get_painter(). There is one template version of this member-function so you can pass the type of the painter and get a reference to the passed type. If the painter is not of this type a background_wnd::invalid_painter_cast-exception is thrown.
background_wnd uses a memory DC which is available to the derived classes.
|
||||||||||||
|
Adds a painter of type Painter and returns the index of this new painter.
|
|
|
Adds a painter of type Painter and returns the index of this new painter.
|
|
|
Adds a painter of type Painter and returns the index of this new painter.
|
|
|
Adds a copy of painter.
|
|
|
Returns the background color of the window.
|
|
|
Sets the background color of the window.
|
|
|
Removes all painters.
|
|
|
Removes a painter
|
|
|
Gets the drawing rectangle of a painter.
|
|
||||||||||||
|
Sets the drawing rectangle of a painter . The Painter will only be drawin inside this rectangle. So this is a clipping rectangle
|
|
|
Returns a vector with all the indices available . The indices are sorted by Z-Order of the painters, ascending from background to foreground |
|
|
Returns the memory DC used by the background_wnd.
|
|
|
Returns the memory DC used by the background_wnd.
|
|
|
Returns the painter at index idx . The painter will be automatically cast to the passed type Painter
|
|
|
Returns a painter
|
|
|
Returns true if a painter is visible
|
|
|
Returns true if the window is redrawn when a change happens.
|
|
|
Specifies if the window is redrawn when a change happens . Specifies if the window is redrawn when a change happens (painter is added, removed, transparency changed, ...) |
|
|
Redraws the painters.
|
|
||||||||||||
|
Shows or hides a painter
|
|
|
Returns the current transparency of a painter
|
|
||||||||||||
|
Sets the transparency of a painter . Sets the transparency of a painter. A value of 0 means totally transparent; a value of 255 means opaque
|
|
|
Brings a painter one step to the background
|
|
|
Brings a painter one step to the front
|
|
|
Brings a painter to the background
|
|
|
Brings a painter to the front
|
|
by Steven Weiss. You can contact me at steven11@gmx.de. |