]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/tools/radiant/PreviewDlg.h
hello world
[icculus/iodoom3.git] / neo / tools / radiant / PreviewDlg.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 #pragma once
29 #include "afxcmn.h"
30 #include "afxwin.h"
31
32
33 // CPreviewDlg dialog
34
35 struct CommentedItem {
36         idStr Name;
37         idStr Path;
38         idStr Comments;
39 };
40
41 class CPreviewDlg : public CDialog
42 {
43 public:
44         enum {MODELS, GUIS, SOUNDS, MATERIALS, SCRIPTS, SOUNDPARENT, WAVES, PARTICLES, MODELPARENT, GUIPARENT, COMMENTED, SKINS};
45         CPreviewDlg(CWnd* pParent = NULL);   // standard constructor
46         virtual ~CPreviewDlg();
47         void SetMode( int mode, const char *preSelect = NULL );
48         void RebuildTree( const char *data );
49         void SetDisablePreview( bool b ) {
50                 disablePreview = b;
51         }
52         
53         idStr mediaName;
54         int returnCode;
55
56         bool Waiting();
57         void SetModal();
58 // Dialog Data
59         enum { IDD = IDD_DIALOG_PREVIEW };
60 private:
61         DECLARE_DYNAMIC(CPreviewDlg)
62
63         CTreeCtrl treeMedia;
64         CEdit editInfo;
65         HTREEITEM commentItem;
66         CImageList m_image;
67         idGLDrawable m_testDrawable;
68         idGLDrawableMaterial m_drawMaterial;
69         idGLDrawableModel m_drawModel;
70         idGLWidget wndPreview;
71         idHashTable<HTREEITEM> quickTree;
72         idList<CommentedItem> items;
73         virtual BOOL OnInitDialog();
74         int currentMode;
75         void AddCommentedItems();
76         idStr data;
77         bool disablePreview;
78
79 protected:
80         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
81         void BuildTree();
82         void AddStrList(const char *root, const idStrList &list, int type);
83         void AddSounds(bool rootItems);
84         void AddMaterials(bool rootItems);
85         void AddParticles(bool rootItems);
86         void AddSkins( bool rootItems );
87         
88         DECLARE_MESSAGE_MAP()
89
90 public:
91         afx_msg void OnTvnSelchangedTreeMedia(NMHDR *pNMHDR, LRESULT *pResult);
92         virtual BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
93 protected:
94         virtual void OnCancel();
95         virtual void OnOK();
96         virtual void OnShowWindow( BOOL bShow, UINT status );
97 public:
98         afx_msg void OnBnClickedButtonReload();
99         afx_msg void OnBnClickedButtonAdd();
100         afx_msg void OnBnClickedButtonPlay();
101 };