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