Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

PaintRect

 

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.

 

 

Public Method List

 

void Paint(Draw& w, const Rect& r, Color ink = SColorText, Color paper = SColorPaper, dword style = 0const

Invokes Paint of contained Display for contained Value.

w

Draw.

r

Target rectangle.

ink

Suggested foreground color.

paper

Suggested background color.

style

Visual style.

 


 

void Paint(Draw& w, int x, int y, int cx, int cy, Color ink = SColorText, Color paper = SColorPaper, dword style = 0const

Invokes contained Display with contained Value.

w

Draw.

x, y, cx, cy

Target rectangle (left, top, width, height).

ink

Suggested foreground color.

paper

Suggested background color.

style

Visual style.

 


 

Size GetStdSize() const

Invokes GetStdSize of contained Display for contained Value.

Return value

Preferred Size of Value.

 


 

Size RatioSize(int cx, int cyconst

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 szconst

Equivalent to RatioSize(sz.cx, sz.cy).

 


 

void SetDisplay(const Display& d)

Sets the Display.

d

Display.

 


 

void SetValue(const Value& v)

Sets the Value.

v

Value.

 


 

void Set(const Display& d, const Value& v)

Sets the Display and the Value.

d

Display.

v

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.

Return value

Value.

 


 

const Display& GetDisplay() const

Returns the Display.

Return value

Display.

 


 

operator bool() const

Return value

true if Display is set.

 

 

Constructor detail

 

PaintRect()

Constructs empty PaintRect, with no Display assigned.

 


 

PaintRect(const Display& display)

Constructs PaintRect with specified Display.

display

Display.

 


 

PaintRect(const Display& display, const Value& val)

Constructs PaintRext with specified Display and Value.

display

Display.

val

Value.

 

 

Last edit by cbpporter on 01/30/2010. Do you want to contribute?. T++