guiChainCtrl.h 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _GUICHAINCTRL_H_
  2. #define _GUICHAINCTRL_H_
  3. #ifndef _GUICONTROL_H_
  4. #include "gui/guiControl.h"
  5. #endif
  6. #ifndef _VECTOR2_H_
  7. #include "2d/core/Vector2.h"
  8. #endif
  9. #include "graphics/dgl.h"
  10. #include "console/console.h"
  11. #include "console/consoleTypes.h"
  12. class GuiChainCtrl : public GuiControl
  13. {
  14. private:
  15. typedef GuiControl Parent;
  16. protected:
  17. S32 mChildSpacing;
  18. bool mIsVertical;
  19. virtual void calculateExtent();
  20. virtual S32 positionChildren(RectI &innerRect);
  21. public:
  22. GuiChainCtrl();
  23. void childResized(GuiControl *child);
  24. void resize(const Point2I &newPosition, const Point2I &newExtent);
  25. void inspectPostApply();
  26. void onChildAdded(GuiControl *child);
  27. void onChildRemoved(SimObject *child);
  28. inline void setChildSpacing(S32 space) { mChildSpacing = space; }
  29. inline S32 getChildSpacing() { return mChildSpacing; }
  30. inline bool getIsVertical() { return mIsVertical; }
  31. static void initPersistFields();
  32. DECLARE_CONOBJECT(GuiChainCtrl);
  33. };
  34. #endif // _GUICHAINCTRL_H_