00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- 00002 #ifndef __focuswidget_hh 00003 #define __focuswidget_hh 00004 00005 #include "widget.hh" 00006 #include "application.hh" 00007 00008 namespace otk { 00009 00010 class FocusWidget : public Widget { 00011 00012 public: 00013 00014 FocusWidget(Widget *parent, Direction = Horizontal); 00015 virtual ~FocusWidget(); 00016 00017 virtual void focus(void); 00018 virtual void unfocus(void); 00019 00020 virtual void setTexture(RenderTexture *texture); 00021 virtual void setBorderColor(const RenderColor *color); 00022 00023 inline void setUnfocusTexture(RenderTexture *texture) 00024 { _unfocus_texture = texture; } 00025 inline RenderTexture *getUnfocusTexture(void) const 00026 { return _unfocus_texture; } 00027 00028 inline void setUnfocusBorderColor(const RenderColor *color) 00029 { _unfocus_bcolor = color; } 00030 inline const RenderColor *getUnfocusBorderColor(void) const 00031 { return _unfocus_bcolor; } 00032 00033 inline bool isFocused(void) const { return _focused; } 00034 inline bool isUnfocused(void) const { return !_focused; } 00035 00036 private: 00037 00038 RenderTexture *_unfocus_texture; 00039 RenderTexture *_focus_texture; 00040 00041 const RenderColor *_unfocus_bcolor; 00042 const RenderColor *_focus_bcolor; 00043 }; 00044 00045 } 00046 00047 #endif // __focuswidget_hh