Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

  1. /*
  2. * Gridlayout
  3. */
  4. #ifndef DUI_LAYOUT_GRIDLAYOUT_H_INCLUDED
  5. #define DUI_LAYOUT_GRIDLAYOUT_H_INCLUDED
  6. #pragma once
  7. namespace DirectUI
  8. {
  9. // No layout positions
  10. ////////////////////////////////////////////////////////
  11. // GridLayout
  12. class GridLayout : public Layout
  13. {
  14. public:
  15. static HRESULT Create(int dNumParams, int* pParams, OUT Value** ppValue); // For parser
  16. static HRESULT Create(int iRows, int iCols, OUT Layout** ppLayout);
  17. // Layout callbacks
  18. virtual void DoLayout(Element* pec, int cx, int cy);
  19. virtual SIZE UpdateDesiredSize(Element* pec, int cxConstraint, int cyConstraint, Surface* psrf);
  20. virtual Element* GetAdjacent(Element* pec, Element* peFrom, int iNavDir, NavReference const* pnr, bool bKeyableOnly);
  21. GridLayout() { }
  22. void Initialize(int iRows, int iCols);
  23. virtual ~GridLayout();
  24. protected:
  25. UINT _uRows;
  26. UINT _uCols;
  27. UINT _fBits;
  28. int* _arColMargins;
  29. int* _arRowMargins;
  30. inline UINT GetCurrentRows(Element* pec);
  31. inline UINT GetCurrentRows(int c);
  32. inline UINT GetCurrentCols(Element* pec);
  33. inline UINT GetCurrentCols(int c);
  34. };
  35. } // namespace DirectUI
  36. #endif // DUI_LAYOUT_GRIDLAYOUT_H_INCLUDED