]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/tools/decl/DialogDeclBrowser.h
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / tools / decl / DialogDeclBrowser.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
29 #ifndef __DIALOGDECLBROWSER_H__
30 #define __DIALOGDECLBROWSER_H__
31
32 #pragma once
33
34 // DialogDeclBrowser dialog
35
36 class DialogDeclBrowser : public CDialog {
37
38         DECLARE_DYNAMIC(DialogDeclBrowser)
39
40 public:
41                                                 DialogDeclBrowser( CWnd* pParent = NULL );   // standard constructor
42         virtual                         ~DialogDeclBrowser();
43
44         void                            ReloadDeclarations( void );
45         bool                            CompareDecl( HTREEITEM item, const char *name ) const;
46
47         //{{AFX_VIRTUAL(DialogDeclBrowser)
48         virtual BOOL            OnInitDialog();
49         virtual void            DoDataExchange( CDataExchange* pDX );    // DDX/DDV support
50         //}}AFX_VIRTUAL
51
52 protected:
53         //{{AFX_MSG(DialogDeclBrowser)
54         afx_msg BOOL            OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult );
55         afx_msg void            OnSetFocus( CWnd *pOldWnd );
56         afx_msg void            OnDestroy();
57         afx_msg void            OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
58         afx_msg void            OnMove( int x, int y );
59         afx_msg void            OnSize( UINT nType, int cx, int cy );
60         afx_msg void            OnSizing( UINT nSide, LPRECT lpRect );
61         afx_msg void            OnTreeSelChanged( NMHDR* pNMHDR, LRESULT* pResult );
62         afx_msg void            OnTreeDblclk( NMHDR *pNMHDR, LRESULT *pResult );
63         afx_msg void            OnBnClickedFind();
64         afx_msg void            OnBnClickedEdit();
65         afx_msg void            OnBnClickedNew();
66         afx_msg void            OnBnClickedReload();
67         afx_msg void            OnBnClickedOk();
68         afx_msg void            OnBnClickedCancel();
69         //}}AFX_MSG
70
71         DECLARE_MESSAGE_MAP()
72
73 private:
74
75         //{{AFX_DATA(DialogDeclBrowser)
76         enum                            { IDD = IDD_DIALOG_DECLBROWSER };
77         CStatusBarCtrl          statusBar;
78         CPathTreeCtrl           declTree;
79         CStatic                         findNameStatic;
80         CStatic                         findTextStatic;
81         CEdit                           findNameEdit;
82         CEdit                           findTextEdit;
83         CButton                         findButton;
84         CButton                         editButton;
85         CButton                         newButton;
86         CButton                         reloadButton;
87         CButton                         cancelButton;
88         //}}AFX_DATA
89
90         static toolTip_t        toolTips[];
91
92         CRect                           initialRect;
93         CPathTreeCtrl           baseDeclTree;
94         int                                     numListedDecls;
95         idStr                           findNameString;
96         idStr                           findTextString;
97
98         TCHAR *                         m_pchTip;
99         WCHAR *                         m_pwchTip;
100
101 private:
102         void                            AddDeclTypeToTree( declType_t type, const char *root, CPathTreeCtrl &tree );
103         void                            AddScriptsToTree( CPathTreeCtrl &tree );
104         void                            AddGUIsToTree( CPathTreeCtrl &tree );
105         void                            InitBaseDeclTree( void );
106
107         void                            GetDeclName( HTREEITEM item, idStr &typeName, idStr &declName ) const;
108         const idDecl *          GetDeclFromTreeItem( HTREEITEM item ) const;
109         const idDecl *          GetSelectedDecl( void ) const;
110         void                            EditSelected( void ) const;
111 };
112
113 #endif /* !__DIALOGDECLBROWSER_H__ */