Debian Codegraph @

editor/ObjectListDialog.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #if !defined(AFX_OBJECTLISTDIALOG_H__3DEE8311_972E_11D1_BFC6_00A0C94B8467__INCLUDED_)
20 #define AFX_OBJECTLISTDIALOG_H__3DEE8311_972E_11D1_BFC6_00A0C94B8467__INCLUDED_
21
22 #if _MSC_VER >= 1000
23 #pragma once
24 #endif // _MSC_VER >= 1000
25 // ObjectListDialog.h : header file
26 //
27
28 /////////////////////////////////////////////////////////////////////////////
29 // CObjectListDialog dialog
30
31 #define CLIPBOARD_LEAF 0
32 #define POWERUP_LEAF 1
33 #define ROBOT_LEAF 2
34 #define BUILDING_LEAF 3
35 #define DOOR_LEAF 4
36 #define PLAYER_LEAF 5
37 #define CLUTTER_LEAF 6
38 #define CAMERA_LEAF 7
39 #define SOUNDSOURCE_LEAF 8
40 #define MISC_LEAF 9
41 #define MAX_OBJ_LEAFS 10
42
43 struct object;
44
45 class CObjectListDialog : public CDialog {
46 // Construction
47 public:
48 CObjectListDialog(CWnd *pParent = NULL); // standard constructor
49
50 void Refresh();
51 void ClearTree();
52 int GetObjectSelected() const;
53
54 // Dialog Data
55 //{{AFX_DATA(CObjectListDialog)
56 enum { IDD = IDD_OBJTREEDLG };
57 // NOTE: the ClassWizard will add data members here
58 //}}AFX_DATA
59
60 // Overrides
61 // ClassWizard generated virtual function overrides
62 //{{AFX_VIRTUAL(CObjectListDialog)
63 protected:
64 virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
65 //}}AFX_VIRTUAL
66
67 // Implementation
68 protected:
69 // Generated message map functions
70 //{{AFX_MSG(CObjectListDialog)
71 virtual BOOL OnInitDialog();
72 afx_msg void OnDestroy();
73 afx_msg void OnSelchangedObjtree(NMHDR *pNMHDR, LRESULT *pResult);
74 afx_msg void OnGoto();
75 afx_msg void OnDelete();
76 afx_msg void OnClear();
77 //}}AFX_MSG
78 DECLARE_MESSAGE_MAP()
79
80 private:
81 struct tObjNode {
82 HTREEITEM hItem;
83 int handle;
84 };
85
86 tObjNode *m_Leafs[MAX_OBJ_LEAFS];
87
88 HTREEITEM hClipboardTree;
89 HTREEITEM hRobotTree;
90 HTREEITEM hPowerupTree;
91 HTREEITEM hBuildingTree;
92 HTREEITEM hDoorTree;
93 HTREEITEM hPlayerTree;
94 HTREEITEM hClutterTree;
95 HTREEITEM hCameraTree;
96 HTREEITEM hSoundSourceTree;
97 HTREEITEM hMiscTree;
98
99 int m_ObjectHandle; // current object handle selected.
100 int nclipboard, npowerup, nrobot, nbuilding, nclutter, ndoor, nplayer, ncamera, nsndsrc, nmisc;
101
102 private:
103 void MakeInfoStr(object *obj, char *str);
104 int GetObjHandleFromItem(HTREEITEM hItem);
105 };
106
107 // modeless implementation of object fialog.
108 class CObjectListModeless : public CObjectListDialog {
109
110 public:
111 CObjectListModeless(CWnd *pParent = NULL);
112
113 BOOL Create();
114
115 // Dialog Data
116 //{{AFX_DATA(CObjectListModeless)
117 enum { IDD = IDD_OBJTREEDLG };
118 // NOTE: the ClassWizard will add data members here
119 //}}AFX_DATA
120
121 // Overrides
122 // ClassWizard generated virtual function overrides
123 //{{AFX_VIRTUAL(CObjectListModeless)
124 protected:
125 virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
126 virtual void PostNcDestroy();
127 //}}AFX_VIRTUAL
128
129 // Implementation
130 protected:
131 // Generated message map functions
132 //{{AFX_MSG(CObjectListModeless)
133 afx_msg void OnMove(int x, int y);
134 virtual void OnCancel();
135 virtual BOOL OnInitDialog();
136 //}}AFX_MSG
137 DECLARE_MESSAGE_MAP()
138
139 private:
140 CWnd *m_wndParent;
141 };
142
143 //{{AFX_INSERT_LOCATION}}
144 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
145
146 #endif // !defined(AFX_OBJECTLISTDIALOG_H__3DEE8311_972E_11D1_BFC6_00A0C94B8467__INCLUDED_)