SimpleCxxLib packageclass GOval : public GObject
int main() {
GWindow gw;
cout << "This program draws a green oval filling the window." << endl;
GOval *oval = new GOval(gw.getWidth(), gw.getHeight());
oval->setFilled(true);
oval->setColor("GREEN");
gw.add(oval);
return 0;
}
| Constructor | |
GOval(x, y, width, height) | Constructs a new oval inscribed in the specified rectangle. |
| Methods | |
| Returns the color used to display the filled region of this oval. | |
Returns true if the oval is filled. | |
setBounds(x, y, width, height) | Changes the bounds of the oval to the specified values. |
| Sets the color used to display the filled region of this oval. | |
Sets the fill status for the oval, where false is outlined and true is filled. | |
setSize(width, height) | Changes the size of the bounding rectangle to the specified width and height. |
GOval(double width, double height); GOval(double x, double y, double width, double height);
x and y.
Usage:
GOval *oval = new GOval(width, height); GOval *oval = new GOval(x, y, width, height);
void setSize(const GDimension & size); void setSize(double width, double height);
Usage:
oval->setSize(size); oval->setSize(width, height);
void setBounds(const GRectangle & size); void setBounds(double x, double y, double width, double height);
Usage:
oval->setBounds(rect); oval->setBounds(x, y, width, height);
void setFilled(bool flag);
false is
outlined and true is filled.
Usage:
oval->setFilled(flag);
bool isFilled() const;
true if the oval is filled.
Usage:
if (oval->isFilled()) ...
void setFillColor(string color); void setFillColor(int rgb);
Usage:
oval->setFillColor(color);
string getFillColor() const;
getFillColor returns the empty string.
Usage:
string color = oval->getFillColor();