Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / logic / logic_editor_dll / ResizablePage.h
blob2bb9e35b8739da60527eaaa4ac3aea51f8214b67
1 #if !defined(AFX_RESIZABLEPAGE_H__INCLUDED_)
2 #define AFX_RESIZABLEPAGE_H__INCLUDED_
4 #if _MSC_VER > 1000
5 #pragma once
6 #endif // _MSC_VER > 1000
8 // ResizablePage.h : header file
9 //
10 /////////////////////////////////////////////////////////////////////////////
12 // Copyright (C) 2000 by Paolo Messina
13 // (ppescher@yahoo.com)
15 // Free for non-commercial use.
16 // You may change the code to your needs,
17 // provided that credits to the original
18 // author is given in the modified files.
19 //
20 /////////////////////////////////////////////////////////////////////////////
22 // useful compatibility constants (the only one required is NOANCHOR)
24 #if !defined(__SIZE_ANCHORS_)
25 #define __SIZE_ANCHORS_
27 const CSize
28 NOANCHOR(-1,-1),
29 TOP_LEFT(0,0), TOP_CENTER(50,0), TOP_RIGHT(100,0),
30 MIDDLE_LEFT(0,50), MIDDLE_CENTER(50,50), MIDDLE_RIGHT(100,50),
31 BOTTOM_LEFT(0,100), BOTTOM_CENTER(50,100), BOTTOM_RIGHT(100,100);
33 #endif // !defined(__SIZE_ANCHORS_)
35 /////////////////////////////////////////////////////////////////////////////
36 // CResizablePage window
38 class CResizablePage : public CPropertyPage
40 DECLARE_DYNCREATE(CResizablePage)
42 // Construction
43 public:
44 CResizablePage();
45 CResizablePage(UINT nIDTemplate, UINT nIDCaption = 0);
46 CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0);
48 // Attributes
49 public:
51 private:
52 // internal status
53 CString m_sSection; // section name and
54 CString m_sEntry; // entry for save/restore
56 BOOL m_bInitDone; // if all internal vars initialized
58 CPtrList m_plLayoutList; // list of repositionable controls
60 class Layout
62 public:
63 HWND hwnd;
65 BOOL adj_hscroll;
66 BOOL need_refresh;
68 // upper-left corner
69 SIZE tl_type;
70 SIZE tl_margin;
72 // bottom-right corner
73 SIZE br_type;
74 SIZE br_margin;
76 public:
77 Layout(HWND hw, SIZE tl_t, SIZE tl_m,
78 SIZE br_t, SIZE br_m, BOOL hscroll, BOOL refresh)
80 hwnd = hw;
82 adj_hscroll = hscroll;
83 need_refresh = refresh;
85 tl_type = tl_t;
86 tl_margin = tl_m;
88 br_type = br_t;
89 br_margin = br_m;
93 // Operations
94 public:
96 // Overrides
97 // ClassWizard generated virtual function overrides
98 //{{AFX_VIRTUAL(CResizablePage)
99 //}}AFX_VIRTUAL
101 // Implementation
102 public:
103 virtual ~CResizablePage();
105 // used internally
106 private:
107 void Construct();
108 void ArrangeLayout();
110 // callable from derived classes
111 protected:
112 void AddAnchor(HWND wnd, CSize tl_type,
113 CSize br_type = NOANCHOR); // add anchors to a control
114 void AddAnchor(UINT ctrl_ID, CSize tl_type,
115 CSize br_type = NOANCHOR) // add anchors to a control
117 AddAnchor(::GetDlgItem(*this, ctrl_ID), tl_type, br_type);
120 // Generated message map functions
121 protected:
122 //{{AFX_MSG(CResizablePage)
123 virtual BOOL OnInitDialog();
124 afx_msg void OnSize(UINT nType, int cx, int cy);
125 //}}AFX_MSG
126 DECLARE_MESSAGE_MAP()
129 /////////////////////////////////////////////////////////////////////////////
131 //{{AFX_INSERT_LOCATION}}
132 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
134 #endif // !defined(AFX_RESIZABLEPAGE_H__INCLUDED_)