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.

55 lines
1.9 KiB

  1. /*
  2. * BorderLayout
  3. */
  4. #ifndef DUI_BORDERLAYOUT_H_INCLUDED
  5. #define DUI_BORDERLAYOUT_H_INCLUDED
  6. #pragma once
  7. namespace DirectUI
  8. {
  9. // BorderLayout positions
  10. #define BLP_Left 0
  11. #define BLP_Top 1
  12. #define BLP_Right 2
  13. #define BLP_Bottom 3
  14. #define BLP_Client 4
  15. ////////////////////////////////////////////////////////
  16. // BorderLayout
  17. class BorderLayout : public Layout
  18. {
  19. public:
  20. static HRESULT Create(int dNumParams, int* pParams, OUT Value** ppValue); // For parser
  21. static HRESULT Create(OUT Layout** ppLayout);
  22. // Layout callbacks
  23. virtual void DoLayout(Element* pec, int dWidth, int dHeight);
  24. virtual SIZE UpdateDesiredSize(Element* pec, int dConstW, int dConstH, Surface* psrf);
  25. virtual void OnAdd(Element* pec, Element** ppeAdd, UINT cCount);
  26. virtual void OnRemove(Element* pec, Element** ppeRemove, UINT cCount);
  27. virtual void OnLayoutPosChanged(Element* pec, Element* peChanged, int dOldLP, int dNewLP);
  28. virtual Element* GetAdjacent(Element* pec, Element* peFrom, int iNavDir, NavReference const* pnr, bool bKeyableOnly);
  29. BorderLayout() { }
  30. void Initialize();
  31. virtual ~BorderLayout() { }
  32. Element* _peClientPos;
  33. SIZE _sizeDesired;
  34. SIZE GetMaxCenter(Element* pec, int x, int y, int cw, int ch, int mTop, int mLeft, int mRight, int mBottom, bool setValues, HDC hDC);
  35. SIZE GetMaxLeftRight(Element* pec, int current, int x, int y, int cw, int ch, int mTop, int mLeft, int mRight, int mBottom, bool setValues, HDC hDC);
  36. SIZE GetMaxTopBottom(Element* pec, int current, int x, int y, int cw, int ch, int mTop, int mLeft, int mRight, int mBottom, bool setValues, HDC hDC = NULL);
  37. int NextChild(int i, Element* pec, Element** ppeCurrent, int* playoutPos);
  38. private:
  39. void SetClient(Element* pe);
  40. };
  41. } // namespace DirectUI
  42. #endif // DUI_BORDERLAYOUT_H_INCLUDED