guiGridCtrl.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _GUIGRIDCTRL_H_
  2. #define _GUIGRIDCTRL_H_
  3. #ifndef _GUICONTROL_H_
  4. #include "gui/guiControl.h"
  5. #endif
  6. #include "graphics/dgl.h"
  7. #include "console/console.h"
  8. #include "console/consoleTypes.h"
  9. class GuiGridControl : public GuiControl
  10. {
  11. private:
  12. struct GridItem
  13. {
  14. int Size;
  15. bool IsPercentage;
  16. bool IsRemaining;
  17. bool IsAbsolute;
  18. };
  19. private:
  20. typedef GuiControl Parent;
  21. Vector<StringTableEntry> mGridRows;
  22. Vector<StringTableEntry> mGridCols;
  23. Vector<S32> mRowSizes;
  24. Vector<S32> mColSizes;
  25. Vector<Point2I> mOrginalControlPos;
  26. void AdjustGrid(const Point2I& newExtent);
  27. void AdjustGridItems(S32 size, Vector<StringTableEntry>& strItems, Vector<S32>& items);
  28. RectI GetGridRect(GuiControl* ctrl);
  29. bool IsPointInGridControl(GuiControl* ctrl, const Point2I& pt);
  30. public:
  31. GuiGridControl();
  32. void resize(const Point2I &newPosition, const Point2I &newExtent);
  33. void inspectPostApply();
  34. void addObject(SimObject *obj);
  35. void removeObject(SimObject *obj);
  36. bool onWake();
  37. void onSleep();
  38. static void initPersistFields();
  39. DECLARE_CONOBJECT(GuiGridControl);
  40. };
  41. #endif // _GUIGRIDCTRL_H_