guiChainCtrl.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. bool mPrevIsVertical;
  17. const S32 mEditOpenSpace = 30;
  18. bool mResizeGuard;
  19. protected:
  20. S32 mChildSpacing;
  21. bool mIsVertical;
  22. virtual void calculateExtent(bool holdLength = false);
  23. virtual S32 positionChildren(RectI &innerRect);
  24. public:
  25. GuiChainCtrl();
  26. void childResized(GuiControl *child);
  27. void childMoved(GuiControl* child);
  28. void childrenReordered();
  29. void resize(const Point2I &newPosition, const Point2I &newExtent);
  30. void inspectPreApply();
  31. void inspectPostApply();
  32. void onChildAdded(GuiControl *child);
  33. void onChildRemoved(SimObject *child);
  34. void onRender(Point2I offset, const RectI& updateRect);
  35. inline void setChildSpacing(S32 space) { mChildSpacing = space; }
  36. inline S32 getChildSpacing() { return mChildSpacing; }
  37. inline bool getIsVertical() { return mIsVertical; }
  38. static void initPersistFields();
  39. DECLARE_CONOBJECT(GuiChainCtrl);
  40. };
  41. #endif // _GUICHAINCTRL_H_