00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef _uborder_hpp_
00026
#define _uborder_hpp_
00027
00028
#include <ubit/uprop.hpp>
00029
00030
00031
00034 struct UMargins {
00035
short top, right, bottom, left;
00036
00037
UMargins() {}
00038
UMargins(
short _top_bottom,
short _left_right);
00039
UMargins(
short _top,
short _right,
short _bottom,
short _left);
00040
00041
void set(
short _top_bottom,
short _left_right);
00042
void set(
short _top,
short _right,
short _bottom,
short _left);
00043
void incr(
const UMargins&);
00044 };
00045
00046
00047
00050 class UBorder :
public UProp {
00051
public:
00052
enum {NONE=0, FLAT, SHADOW, ETCHED};
00054
00055
static UBorder
00056 none, empty, flat, shadowIn, shadowOut, etchedIn,
etchedOut;
00058
00059
00060
00061
UBorder(
int decoration = -ETCHED);
00062
UBorder(
int decoration,
class UColor&
color,
class UColor& bgcolor,
00063
int top_bottom_margin = 1,
int left_right_margin = 1, u_modes = 0);
00075
UBorder(
const UBorder&);
00077
00078
UBorder(
bool overlaid,
const UArgs&);
00080
00081
virtual ~
UBorder();
00082
00083
UBorder& operator=(
const UBorder&);
00084
00085
00086
00087
bool isOverlaid()
const {
return overlaid;}
00088
00089
UColor& bgcolor() {
return *pbgcolor;}
00090 UColor&
color() {
return *pcolor;}
00099
const UColor& getBgcolor()
const {
return *pbgcolor;}
00100
const UColor& getColor()
const {
return *pcolor;}
00101
00102
int getDecoration() const;
00103
void setDecoration(
int decoration);
00104
00105 const
UMargins& getMargins() const;
00106
void setMargins(const class
UMargins&);
00107
00108 virtual class
UGroup* getSubGroup() {
return psubgroup;}
00110
00111
virtual void update();
00112
00113
#ifndef NO_DOC
00114
00115
00116
00117
virtual void putProp(
class UContext*,
class UCtrl*);
00118
virtual void getSize(
const UContext&,
class UMargins&)
const;
00119
virtual void paint(
class UWinGraph&,
const UContext&,
const URegion &r)
const;
00120
00121
protected:
00122
int decoration;
00123
bool overlaid;
00124
UMargins margins;
00125 uptr<class UColor> pcolor, pbgcolor;
00126 uptr<class UGroup> psubgroup;
00127
00128
virtual void constructs(
int decoration,
UColor& _color,
UColor& _bgcolor);
00129
#endif
00130
};
00131
00132
#endif
00133
00134