1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
5 #ifndef _LAYOUTMANAGER_H
\r
6 # define _LAYOUTMANAGER_H
\r
18 ORIGIN_LEFT_EDGE, ///
\r
19 ORIGIN_TOP_EDGE = ORIGIN_LEFT_EDGE, ///
\r
21 ORIGIN_RIGHT_EDGE, ///
\r
22 ORIGIN_BOTTOM_EDGE = ORIGIN_RIGHT_EDGE, ///
\r
27 RESTRICT_NONE = 0, ///
\r
28 RESTRICT_HORIZONTALLY = 1, ///
\r
29 RESTRICT_VERTICALLY = 2, ///
\r
30 RESTRICT_BOTH = RESTRICT_HORIZONTALLY | RESTRICT_VERTICALLY, ///
\r
39 HWND m_hwndParent; ///
\r
41 RECT m_rcParent; ///
\r
42 Origin m_origin[4]; ///
\r
54 SmallestSize() : m_hwnd(NULL) { }
\r
57 typedef std::list<Item> Items; ///
\r
64 Restrict m_smallestRestriction; ///
\r
65 SIZE m_smallestSize; ///
\r
66 Restrict m_largestRestriction; ///
\r
67 SIZE m_largestSize; ///
\r
71 LayoutManager(HWND i_hwnd);
\r
73 /** restrict the smallest size of the window to the current size of it or
\r
74 specified by i_size */
\r
75 void restrictSmallestSize(Restrict i_restrict = RESTRICT_BOTH,
\r
76 SIZE *i_size = NULL);
\r
78 /** restrict the largest size of the window to the current size of it or
\r
79 specified by i_size */
\r
80 void restrictLargestSize(Restrict i_restrict = RESTRICT_BOTH,
\r
81 SIZE *i_size = NULL);
\r
84 bool addItem(HWND i_hwnd,
\r
85 Origin i_originLeft = ORIGIN_LEFT_EDGE,
\r
86 Origin i_originTop = ORIGIN_TOP_EDGE,
\r
87 Origin i_originRight = ORIGIN_LEFT_EDGE,
\r
88 Origin i_originBottom = ORIGIN_TOP_EDGE);
\r
90 void adjust() const;
\r
93 virtual BOOL wmPaint();
\r
95 /// size restriction
\r
96 virtual BOOL wmSizing(int i_edge, RECT *io_rc);
\r
98 /// hittest for size box
\r
99 virtual BOOL wmNcHitTest(int i_x, int i_y);
\r
102 virtual BOOL wmSize(DWORD /* i_fwSizeType */, short /* i_nWidth */,
\r
103 short /* i_nHeight */);
\r
105 /// forward message
\r
106 virtual BOOL defaultWMHandler(UINT i_message, WPARAM i_wParam,
\r
111 #endif // !_LAYOUTMANAGER_H
\r