uborder.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  uborder.hpp
00004  *  Ubit Project
00005  *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00006  *  (C) 1999-2005 Eric Lecolinet / ENST Paris
00007  *
00008  * ***********************************************************************
00009  * COPYRIGHT NOTICE : 
00010  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00011  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00012  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00013  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00014  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00015  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00016  * ***********************************************************************
00017  * ==================================================== [(c)Elc] ======= *
00018  * ==================================================== ======== ======= */
00019 
00020 #ifndef _uborder_hpp_
00021 #define _uborder_hpp_
00022 //pragma ident  "@(#)uborder.hpp                ubit:05.05.00"
00023 #include <ubit/uprop.hpp>
00024 #include <ubit/ugeom.hpp>
00025 namespace ubit {
00026 
00027 /* ==================================================== ===== ======= */
00030 class UBorder : public UProp {
00031 public:
00032   UBIT_ATTR_CLASS(UBorder, UProp)
00033   
00034   enum {NONE, LINE, SHADOW, ETCHED, BIGSHADOW};
00036 
00037   static UBorder none, empty, 
00038     line, shadowIn, shadowOut, etchedIn, etchedOut;
00040 
00041   UBorder(int decoration = NONE);
00042   UBorder(int decoration, const UColor& color, const UColor& bgcolor,
00043           int hmargins = 1, int vmargins = 1, UMask = 0);
00053   UBorder(const UBorder&);
00055 
00056   UBorder(const UArgs& children);
00058   
00059   virtual ~UBorder();
00060 
00061   UBorder& operator=(const UBorder&);
00062 
00063   UBorder& addlist(const UArgs&);
00064   UBorder& addlist(bool is_overlaid, const UArgs&);
00065 
00066   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00067 
00068   int getDecoration() const {return decoration;}
00069   UBorder& setDecoration(int decoration);
00070 
00071   const UColor& getColor() const {return *pcolor;}
00072   UBorder& setColor(const UColor&);
00074 
00075   const UColor& getBgcolor() const {return *pbgcolor;}
00076   UBorder& setBgcolor(const UColor&);
00078   
00079   int getThickness() const {return thickness;}
00080   UBorder& setThickness(int);
00081 
00082   const UMargins& getMargins() const {return margins;}
00083   UBorder& setMargins(const UMargins&);
00084 
00085   virtual UGroup* getSubGroup() {return pchildren;}
00087 
00088   bool isSuperimposed() const {return is_superimposed;}
00090 
00091   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00092 
00093   virtual void update();
00094   virtual void putProp(UContext*, UControl*);
00095   
00096   virtual void paint(UGraph&, const UContext&, const URegion& r) const;
00097   virtual void getSize(const UContext&, UMargins&) const;
00098 
00099 #ifndef NO_DOC
00100 protected:
00101   short decoration, thickness;
00102   bool is_superimposed;
00103   UMargins margins;
00104   uptr<const UColor> pcolor, pbgcolor;
00105   uptr<UGroup> pchildren;
00106   virtual void constructs(int decoration, const UColor& _color, const UColor& _bgcolor);
00107 #endif
00108 };
00109 
00110 }
00111 #endif
00112 /* ==================================================== [TheEnd] ======= */
00113 /* ==================================================== [(c)Elc] ======= */

Generated on Mon Jan 29 00:20:36 2007 for Ubit by  doxygen 1.4.7