CGUICheckBox.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_GUI_CHECKBOX_H_INCLUDED__
  5. #define __C_GUI_CHECKBOX_H_INCLUDED__
  6. #include "IrrCompileConfig.h"
  7. #ifdef _IRR_COMPILE_WITH_GUI_
  8. #include "IGUICheckBox.h"
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. class CGUICheckBox : public IGUICheckBox
  14. {
  15. public:
  16. //! constructor
  17. CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
  18. //! set if box is checked
  19. virtual void setChecked(bool checked);
  20. //! returns if box is checked
  21. virtual bool isChecked() const;
  22. //! called if an event happened.
  23. virtual bool OnEvent(const SEvent& event);
  24. //! draws the element and its children
  25. virtual void draw();
  26. //! Writes attributes of the element.
  27. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
  28. //! Reads attributes of the element
  29. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
  30. private:
  31. u32 checkTime;
  32. bool Pressed;
  33. bool Checked;
  34. };
  35. } // end namespace gui
  36. } // end namespace irr
  37. #endif // __C_GUI_CHECKBOX_H_INCLUDED__
  38. #endif // _IRR_COMPILE_WITH_GUI_