Posted By

xterminhate on 03/05/13


Tagged

CGUIDynamicGrid


Versions (?)

IGUIDynamicGrid.h


 / Published in: C++
 

URL: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=48291&p=278332#p278332

http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=48291&p=278332#p278332

  1. // Xterm-in'Hate
  2.  
  3. #ifndef __I_GUI_DYNAMIC_GRID_H_INCLUDED__
  4. #define __I_GUI_DYNAMIC_GRID_H_INCLUDED__
  5.  
  6. #include "IGUIElement.h"
  7. #include "IGUIEnvironment.h"
  8.  
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. //! Enumeration for all behaviors of the GUI Dynamic Grid element.
  14. enum EGUI_DYNAMIC_GRID_BEHAVIOR
  15. {
  16. EGDGB_RESET=0, ///< Do nothing. Every child elements move freely.
  17. EGDGB_ATTACH_RUN_ONCE, ///< Try to attach every nearer child elements together (then go to RUN behavior).
  18. EGDGB_ATTACH_FOCUSED, ///< Try to attach the focused child element with the nearer child elements.
  19. EGDGB_RUN, ///< Attached child elements remain attached, others move freely.
  20. EGDGB_DETACH_FOCUSED, ///< Try to dettach the focused child element (it moves freely).
  21. EGDGB_DETACH_ALL ///< Try to dettach every child elements (then go to RUN behavior).
  22. };
  23.  
  24. //! Names for all behaviors of the GUI Dynamic Grid element.
  25. const c8* const GUIDynamicGridBehaviorNames[] =
  26. {
  27. "Reset",
  28. "Attach Once (Near)",
  29. "Attach Auto (Focus)",
  30. "Running",
  31. "Detach Auto (Focus)",
  32. "Detach All",
  33. };
  34.  
  35. //! GUI Dynamic Grid interface.
  36. class IGUIDynamicGrid : public IGUIElement
  37. {
  38. public:
  39. //! constructor
  40. IGUIDynamicGrid(IGUIEnvironment* environment, IGUIElement* parent)
  41. : IGUIElement(EGUIET_ELEMENT, environment, parent, -1,
  42. core::rect<s32>(0,0,parent->getAbsolutePosition().getWidth(),parent->getAbsolutePosition().getHeight())
  43. ) {}
  44.  
  45. //! show/hide joints (DEBUG)
  46. virtual void setJointVisible(bool visible) = 0;
  47.  
  48. //! set the behavior of the Dynamic Grid
  49. virtual void setBehavior(EGUI_DYNAMIC_GRID_BEHAVIOR behavior) = 0;
  50.  
  51. //! get the behavior of the Dynamic Grid
  52. virtual EGUI_DYNAMIC_GRID_BEHAVIOR getBehavior() const = 0;
  53. };
  54.  
  55. } // end namespace gui
  56. } // end namespace irr
  57.  
  58. #endif

Report this snippet  

You need to login to post a comment.