]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/tools/radiant/PropertyList.h
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / tools / radiant / PropertyList.h
1 /*
2 ===========================================================================
3
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. 
6
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).  
8
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code.  If not, see <http://www.gnu.org/licenses/>.
21
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code.  If not, please request a copy in writing from id Software at the address below.
23
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25
26 ===========================================================================
27 */
28 #if !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)
29 #define AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_
30
31 #if _MSC_VER > 1000
32 #pragma once
33 #endif // _MSC_VER > 1000
34 // PropertyList.h : header file
35 //
36
37 #define PIT_COMBO               0       //PIT = property item type
38 #define PIT_EDIT                1
39 #define PIT_COLOR               2
40 #define PIT_FONT                3
41 #define PIT_FILE                4
42 #define PIT_SCRIPT              5
43 #define PIT_MODEL               6
44 #define PIT_SOUND               7
45 #define PIT_GUI                 8
46 #define PIT_MATERIAL    9
47 #define PIT_VAR                 10
48
49 #define IDC_PROPCMBBOX   712
50 #define IDC_PROPEDITBOX  713
51 #define IDC_PROPBTNCTRL  714
52
53
54 /////////////////////////////////////////////////////////////////////////////
55 //CPropertyList Items
56 class CPropertyItem
57 {
58 // Attributes
59 public:
60         CString m_propName;
61         CString m_curValue;
62         int m_nItemType;
63         CString m_cmbItems;
64         int data;
65
66 public:
67         CPropertyItem(CString propName, CString curValue,
68                                   int nItemType, CString cmbItems)
69         {
70                 m_propName = propName;
71                 m_curValue = curValue;
72                 m_nItemType = nItemType;
73                 m_cmbItems = cmbItems;
74                 data = -1;
75         }
76         void SetData(int d) {
77                 data = d;
78         }
79 };
80
81 /////////////////////////////////////////////////////////////////////////////
82 // CPropertyList window
83
84 class CPropertyList : public CListBox
85 {
86 // Construction
87 public:
88         CPropertyList();
89
90 // Attributes
91 public:
92
93 // Operations
94 public:
95         int AddItem(CString txt);
96         int AddPropItem(CPropertyItem* pItem);
97         void ResetContent();
98         CEdit *GetEditBox() {
99                 return &m_editBox;
100         }
101         void SetUpdateInspectors(bool b) {
102                 updateInspectors = b;
103         }
104         void SetDivider( int div ) {
105                 m_nDivider = div;
106         }
107         afx_msg void OnKillfocusEditBox();
108         afx_msg void OnChangeEditBox();
109
110 // Overrides
111         // ClassWizard generated virtual function overrides
112         //{{AFX_VIRTUAL(CPropertyList)
113         public:
114         virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
115         virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
116         afx_msg void OnSelchange();
117         protected:
118         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
119         virtual void PreSubclassWindow();
120         //}}AFX_VIRTUAL
121
122 // Implementation
123 public:
124         virtual ~CPropertyList();
125
126         // Generated message map functions
127 protected:
128         //{{AFX_MSG(CPropertyList)
129         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
130         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
131         afx_msg void OnKillFocus(CWnd* pNewWnd);
132         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
133         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
134         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
135
136         //}}AFX_MSG
137         afx_msg void OnKillfocusCmbBox();
138         afx_msg void OnSelchangeCmbBox();
139         afx_msg void OnButton();
140
141         DECLARE_MESSAGE_MAP()
142
143         void InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo);
144         void DisplayButton(CRect region);
145
146         CComboBox m_cmbBox;
147         CEdit m_editBox;
148         CButton m_btnCtrl;
149         CFont m_SSerif8Font;
150         
151         int m_curSel,m_prevSel;
152         int m_nDivider;
153         int m_nDivTop;
154         int m_nDivBtm;
155         int m_nOldDivX;
156         int m_nLastBox;
157         BOOL m_bTracking;
158         BOOL m_bDivIsSet;
159         HCURSOR m_hCursorArrow;
160         HCURSOR m_hCursorSize;
161         CPropertyItem *measureItem;
162         bool updateInspectors;
163 };
164
165 /////////////////////////////////////////////////////////////////////////////
166
167 //{{AFX_INSERT_LOCATION}}
168 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
169
170 #endif // !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)