00001 #ifndef CHECK_BOX_COMPONENT_H 00002 #define CHECK_BOX_COMPONENT_H 00003 00013 #include "labelComponent.h" 00014 #include "multiSurface.h" 00015 #include "fillSurface.h" 00016 #include "drawSurface.h" 00017 #include "ttfDraw.h" 00018 00019 00023 class CheckBoxComponent : public FocusComponentInterface { 00024 TTF_Draw& ttf; 00025 bool now_state; 00026 int length; 00027 bool activated; 00028 unsigned long text_color; 00029 unsigned long box_back; 00030 unsigned long box_border; 00031 LabelComponent* box_label; 00032 LabelComponent* check_label; 00033 LabelComponent* draw_label; 00034 00035 static DrawSurface* check_surface; 00036 FillSurface* inner_box; 00037 FillSurface* outer_box; 00038 MultiSurface* box; 00039 00040 public: 00046 CheckBoxComponent(TTF_Draw& ttf_obj); 00047 ~CheckBoxComponent(void); 00048 00054 void setLabel(LabelComponent* label); 00055 00061 void setLength(int box_length); 00062 void setColor(unsigned long text, 00063 unsigned long back = Black, unsigned long border = White); 00064 void activate(void); 00065 bool draw(unsigned long ticks, const UserInput& ui); 00066 void beginFocus(void); 00067 void endFocus(void); 00068 bool getNowChecked(void); 00069 void setNowChecked(bool on); 00070 }; 00071 00072 #endif /* !CHECK_BOX_COMPONENT_H */ 00073