17 #ifndef ubackground_hpp 18 #define ubackground_hpp 1 19 #include <ubit/uattr.hpp> 35 metal, velin, white, black, grey, lightgrey, darkgrey, navy, lightblue, blue,
36 red, green, yellow, orange, wheat,
teal;
47 UBackground(const
UColor&);
53 UBackground& operator=(const UBackground&);
56 bool operator==(const UBackground&);
59 virtual UBackground&
setColor(const UColor& color);
68 virtual UBackground&
setRbgaF(
float r,
float g,
float b,
float a = 1.);
71 virtual UBackground&
setRbgaI(
unsigned int r,
unsigned int g,
unsigned int b,
72 unsigned int a = 255);
78 virtual UBackground&
setIma(UIma& image,
bool tiling = true);
90 const UIma*
getIma() const;
136 operator float()
const {
return val;}
142 virtual UAlpha&
set(float);
145 bool operator==(
float v)
const {
return val == v;}
156 inline UAlpha& ualpha(
float value = 1.0) {
return *
new UAlpha(value);}
Base class for attributes.
Definition: uattr.hpp:97
UBackground & setTiling(bool)
sets tiling on or off.
Definition: ubackground.cpp:166
Image.
Definition: uima.hpp:50
Definition: uobject.hpp:282
Widget transparency.
Definition: ubackground.hpp:125
virtual UBackground & setRgba(const URgba &)
changes the background color.
Definition: ubackground.cpp:128
Widget background.
Definition: ubackground.hpp:30
virtual void update()
updates parents graphics.
Definition: ubackground.cpp:174
const UIma * getIma() const
returns the current image if any; null otherwise.
Definition: ubackground.cpp:97
Color attribute of an element or a widget.
Definition: ucolor.hpp:73
const UColor * getColor() const
returns the current color if any; null otherwise.
Definition: ubackground.cpp:96
Specifies a RGBA value for defining UColor(s).
Definition: ucolor.hpp:24
static UBackground teal
predefined background constants.
Definition: ubackground.hpp:34
lightweight general purpose container.
Definition: uelem.hpp:44
virtual UBackground & setIma(UIma &image, bool tiling=true)
changes the background image (WARNING: see details).
Definition: ubackground.cpp:157
Smart Pointer for UObject instances (.
Definition: uobject.hpp:365
virtual void putProp(UUpdateContext *, UElem &)
[impl] changes corresponding value in the UUpdateContext
Definition: ubackground.cpp:178
bool isTiled() const
returns true if the image is tiled.
Definition: ubackground.cpp:98
virtual UBackground & setRbgaI(unsigned int r, unsigned int g, unsigned int b, unsigned int a=255)
changes the background color, arguments are integers in range [0,255].
Definition: ubackground.cpp:139
UBackground()
creates an empty background attribute.
Definition: ubackground.cpp:73
Definition: uupdatecontext.hpp:32
virtual UBackground & setColor(const UColor &color)
changes the background color.
Definition: ubackground.cpp:121
Definition: uhardfont.hpp:31
virtual UBackground & setNamedColor(const UStr &color_name, float a=1.)
changes the background color, arguments are a color name and an alpha value in range [0...
Definition: ubackground.cpp:144
Active Float.
Definition: unumber.hpp:140
virtual UBackground & setRbgaF(float r, float g, float b, float a=1.)
changes the background color, arguments are floats in range [0,1].
Definition: ubackground.cpp:135
Ubit String.
Definition: ustr.hpp:72
bool operator==(const UBackground &)
compares two background attributes.
Definition: ubackground.cpp:100
UBackground & operator=(const UBackground &)
copies a background attribute from another one.
Definition: ubackground.cpp:106