1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 #ifndef _LAYOUTMANAGER_H
6 # define _LAYOUTMANAGER_H
20 ORIGIN_TOP_EDGE = ORIGIN_LEFT_EDGE, ///
22 ORIGIN_RIGHT_EDGE, ///
23 ORIGIN_BOTTOM_EDGE = ORIGIN_RIGHT_EDGE, ///
29 RESTRICT_NONE = 0, ///
30 RESTRICT_HORIZONTALLY = 1, ///
31 RESTRICT_VERTICALLY = 2, ///
32 RESTRICT_BOTH = RESTRICT_HORIZONTALLY | RESTRICT_VERTICALLY, ///
41 HWND m_hwndParent; ///
44 Origin m_origin[4]; ///
56 SmallestSize() : m_hwnd(NULL) { }
59 typedef std::list<Item> Items; ///
66 Restrict m_smallestRestriction; ///
67 SIZE m_smallestSize; ///
68 Restrict m_largestRestriction; ///
69 SIZE m_largestSize; ///
73 LayoutManager(HWND i_hwnd);
75 /** restrict the smallest size of the window to the current size of it or
76 specified by i_size */
77 void restrictSmallestSize(Restrict i_restrict = RESTRICT_BOTH,
80 /** restrict the largest size of the window to the current size of it or
81 specified by i_size */
82 void restrictLargestSize(Restrict i_restrict = RESTRICT_BOTH,
86 bool addItem(HWND i_hwnd,
87 Origin i_originLeft = ORIGIN_LEFT_EDGE,
88 Origin i_originTop = ORIGIN_TOP_EDGE,
89 Origin i_originRight = ORIGIN_LEFT_EDGE,
90 Origin i_originBottom = ORIGIN_TOP_EDGE);
95 virtual BOOL wmPaint();
98 virtual BOOL wmSizing(int i_edge, RECT *io_rc);
100 /// hittest for size box
101 virtual BOOL wmNcHitTest(int i_x, int i_y);
104 virtual BOOL wmSize(DWORD /* i_fwSizeType */, short /* i_nWidth */,
105 short /* i_nHeight */);
108 virtual BOOL defaultWMHandler(UINT i_message, WPARAM i_wParam,
113 #endif // !_LAYOUTMANAGER_H