doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaterialEditView.h
Go to the documentation of this file.
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 
30 #include "MaterialEditor.h"
31 #include "MaterialPropTreeView.h"
32 #include "StageView.h"
33 
34 #include "../comafx/CSyntaxRichEditCtrl.h"
35 
40 class MaterialEditView : public CFormView, public MaterialView, SourceModifyOwner {
41 
42 public:
44 
45  CEdit m_nameEdit;
46  CSplitterWnd m_editSplitter;
47 
50  CTabCtrl m_tabs;
52 
53 public:
54  virtual ~MaterialEditView();
55 
56  //MaterialView Interface
57  virtual void MV_OnMaterialSelectionChange(MaterialDoc* pMaterial);
58  virtual void MV_OnMaterialNameChanged(MaterialDoc* pMaterial, const char* oldName);
59 
60  //SourceModifyOwner Interface
61  virtual idStr GetSourceText();
62 
63 protected:
65  DECLARE_DYNCREATE(MaterialEditView)
66 
68  void ApplyMaterialSource();
69 
70  //CFormView Overrides
71  virtual void DoDataExchange(CDataExchange* pDX);
72  virtual void OnInitialUpdate();
73 
74  //Message Handlers
75  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
76  afx_msg void OnSize(UINT nType, int cx, int cy);
77  afx_msg void OnTcnSelChange(NMHDR *pNMHDR, LRESULT *pResult);
78  afx_msg void OnEnChangeEdit( NMHDR *pNMHDR, LRESULT *pResult );
79  DECLARE_MESSAGE_MAP()
80 
81 protected:
82  bool initHack;
83  bool sourceInit;
84 
87 };
View that displays material and stage properties and allows the user to edit the properties.
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
afx_msg void OnEnChangeEdit(NMHDR *pNMHDR, LRESULT *pResult)
Called when the user changes text in the edit control.
StageView * m_stageView
CSplitterWnd m_editSplitter
void ApplyMaterialSource()
Takes the source out of the edit control and applies it to the material.
#define IDD_MATERIALEDIT_FORM
Responsible for managing a single material that is being viewed and/or edited.
Definition: MaterialDoc.h:67
afx_msg void OnTcnSelChange(NMHDR *pNMHDR, LRESULT *pResult)
Called when the user changes the properties/text tab selection.
MaterialView Interface.
Definition: MaterialView.h:38
View that contains the material edit controls.
View that handles managing the material stages.
Definition: StageView.h:41
afx_msg void OnSize(UINT nType, int cx, int cy)
Windows message called when the window is resized.
virtual void MV_OnMaterialNameChanged(MaterialDoc *pMaterial, const char *oldName)
Called when the material name has changed.
virtual void DoDataExchange(CDataExchange *pDX)
Transfers data to and from the controls in the console.
MaterialEditView()
Constructor for MaterialEditView.
Implemented by the edit window that is responsible for modifying the material source text...
Definition: MaterialDoc.h:53
virtual ~MaterialEditView()
Destructor for MaterialEditView.
Definition: Str.h:116
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
Called by the MFC framework when the view is being created.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
#define protected
Definition: TypeInfo.cpp:31
virtual idStr GetSourceText()
Returns the current source text in the source edit control.
virtual void MV_OnMaterialSelectionChange(MaterialDoc *pMaterial)
Called when the selected material has changed.
MaterialPropTreeView * m_materialPropertyView
virtual void OnInitialUpdate()
Called by the MFC framework when the view is being created.
CSyntaxRichEditCtrl m_textView
void GetMaterialSource()
Gets the source of the current document and populates the source edit control.