00001
00032 #ifndef LL_LLVIEWBORDER_H
00033 #define LL_LLVIEWBORDER_H
00034
00035 #include "llview.h"
00036
00037
00038 class LLViewBorder : public LLView
00039 {
00040 public:
00041 enum EBevel { BEVEL_IN, BEVEL_OUT, BEVEL_BRIGHT, BEVEL_NONE };
00042 enum EStyle { STYLE_LINE, STYLE_TEXTURE };
00043
00044 LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 );
00045
00046 virtual void setValue(const LLSD& val) { setRect(LLRect(val)); }
00047
00048 virtual BOOL isCtrl() const { return FALSE; }
00049
00050
00051 virtual void draw();
00052
00053 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory);
00054 static BOOL getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel& bevel_style);
00055
00056 void setBorderWidth(S32 width) { mBorderWidth = width; }
00057 S32 getBorderWidth() const { return mBorderWidth; }
00058 void setBevel(EBevel bevel) { mBevel = bevel; }
00059 EBevel getBevel() const { return mBevel; }
00060 void setColors( const LLColor4& shadow_dark, const LLColor4& highlight_light );
00061 void setColorsExtended( const LLColor4& shadow_light, const LLColor4& shadow_dark,
00062 const LLColor4& highlight_light, const LLColor4& highlight_dark );
00063 void setTexture( const class LLUUID &image_id );
00064
00065 LLColor4 getHighlightLight() {return mHighlightLight;}
00066 LLColor4 getShadowDark() {return mHighlightDark;}
00067
00068 EStyle getStyle() const { return mStyle; }
00069
00070 void setKeyboardFocusHighlight( BOOL b ) { mHasKeyboardFocus = b; }
00071
00072 private:
00073 void drawOnePixelLines();
00074 void drawTwoPixelLines();
00075 void drawTextures();
00076 void drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 start_x, F32 start_y );
00077
00078 EBevel mBevel;
00079 const EStyle mStyle;
00080 LLColor4 mHighlightLight;
00081 LLColor4 mHighlightDark;
00082 LLColor4 mShadowLight;
00083 LLColor4 mShadowDark;
00084 LLColor4 mBackgroundColor;
00085 S32 mBorderWidth;
00086 LLUIImagePtr mTexture;
00087 BOOL mHasKeyboardFocus;
00088 };
00089
00090 #endif // LL_LLVIEWBORDER_H
00091