class PaintRect : private Moveable<PaintRect>
PaintRect is a simple helper class that combines Value and a reference to the Display to provide "visual content" of rectangle. It is Moveable.
void Paint(Draw& w, const Rect& r, Color ink = SColorText, Color paper = SColorPaper, dword style = 0) const
Invokes Paint of contained Display for contained Value.
|
ink |
Suggested foreground color. |
|
paper |
Suggested background color. |
void Paint(Draw& w, int x, int y, int cx, int cy, Color ink = SColorText, Color paper = SColorPaper, dword style = 0) const
Invokes contained Display with contained Value.
|
x, y, cx, cy |
Target rectangle (left, top, width, height). |
|
ink |
Suggested foreground color. |
|
paper |
Suggested background color. |
Size GetStdSize() const
Invokes GetStdSize of contained Display for contained Value.
|
Return value |
Preferred Size of Value. |
Size RatioSize(int cx, int cy) const
Invokes RatioSize of contained Display for contained Value.
|
cx |
Required width. If zero, it should be computed to keep aspect ratio with cy. |
|
cy |
Required height. If zero, it should be computed to keep aspect ratio with cx. |
|
Return value |
Size of Value for Display. |
Size RatioSize(Size sz) const
Equivalent to RatioSize(sz.cx, sz.cy).
void SetDisplay(const Display& d)
Sets the Display.
void SetValue(const Value& v)
Sets the Value.
void Set(const Display& d, const Value& v)
Sets the Display and the Value.
void Clear()
Removes the Display - subsequent calls to Paint act as "no operation", calls to GetStdSize and RatioSize return Size(0, 0).
const Value& GetValue() const
Returns the Value.
const Display& GetDisplay() const
Returns the Display.
operator bool() const
|
Return value |
true if Display is set. |
PaintRect()
Constructs empty PaintRect, with no Display assigned.
PaintRect(const Display& display)
Constructs PaintRect with specified Display.
PaintRect(const Display& display, const Value& val)
Constructs PaintRext with specified Display and Value.
|