doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEMainFrame.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 <afxcview.h>
31 #include "MaterialEditor.h"
32 #include "MaterialTreeView.h"
33 #include "MaterialPropTreeView.h"
34 #include "MaterialPreviewView.h"
35 #include "StageView.h"
37 #include "MEOptions.h"
38 #include "ConsoleView.h"
39 #include "FindDialog.h"
40 #include "../common/PropTree/PropTreeView.h"
41 #include "MaterialDocManager.h"
42 #include "MaterialEditView.h"
43 
47 class MEMainFrame : public CFrameWnd, public MaterialView
48 {
49 
50 public:
51  MEMainFrame();
52  virtual ~MEMainFrame();
53 
54  //Public Operations
55  void PrintConsoleMessage(const char *msg);
56 
57 protected:
58  DECLARE_DYNAMIC(MEMainFrame)
59 
60  // Overrides
61  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
62  virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
63 
64  //Message Handlers
65  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
66  afx_msg void OnDestroy();
67  afx_msg void OnSize(UINT nType, int cx, int cy);
68  afx_msg void OnTcnSelChange(NMHDR *pNMHDR, LRESULT *pResult);
69 
70  //Menu Message Handlers
71  afx_msg void OnFileExit();
72  afx_msg void OnFileSaveMaterial();
73  afx_msg void OnFileSaveFile();
74  afx_msg void OnFileSaveAll();
75  afx_msg void OnFileSaveMaterialUpdate(CCmdUI *pCmdUI);
76  afx_msg void OnFileSaveFileUpdate(CCmdUI *pCmdUI);
77  afx_msg void OnFileSaveAllUpdate(CCmdUI *pCmdUI);
78 
79  afx_msg void OnApplyMaterial();
80  afx_msg void OnApplyFile();
81  afx_msg void OnApplyAll();
82  afx_msg void OnApplyMaterialUpdate(CCmdUI *pCmdUI);
83  afx_msg void OnApplyFileUpdate(CCmdUI *pCmdUI);
84  afx_msg void OnApplyAllUpdate(CCmdUI *pCmdUI);
85 
86  afx_msg void OnEditCut();
87  afx_msg void OnEditCopy();
88  afx_msg void OnEditPaste();
89  afx_msg void OnEditDelete();
90  afx_msg void OnEditRename();
91  afx_msg void OnEditCutUpdate(CCmdUI *pCmdUI);
92  afx_msg void OnEditCopyUpdate(CCmdUI *pCmdUI);
93  afx_msg void OnEditPasteUpdate(CCmdUI *pCmdUI);
94  afx_msg void OnEditDeleteUpdate(CCmdUI *pCmdUI);
95  afx_msg void OnEditRenameUpdate(CCmdUI *pCmdUI);
96 
97  afx_msg void OnEditFind();
98  afx_msg void OnEditFindNext();
99 
100  afx_msg void OnEditUndo();
101  afx_msg void OnEditRedo();
102  afx_msg void OnEditUndoUpdate(CCmdUI *pCmdUI);
103  afx_msg void OnEditRedoUpdate(CCmdUI *pCmdUI);
104 
105  afx_msg void OnViewIncludeFile();
106  afx_msg void OnReloadArbPrograms();
107  afx_msg void OnReloadImages();
108 
109  DECLARE_MESSAGE_MAP()
110 
111  //Methods for Find interactions
112  friend FindDialog;
113  void CloseFind();
114  void FindNext(MaterialSearchData_t* search);
115 
116  //MaterialView Interface
117  virtual void MV_OnMaterialSelectionChange(MaterialDoc* pMaterial);
118 
119 protected:
120  //Status and Toolbars
121  CStatusBar m_wndStatusBar;
122  CToolBar m_wndToolBar;
123 
124  //Splitter windows
125  CTabCtrl m_tabs;
126  CSplitterWnd m_splitterWnd;
127  CSplitterWnd m_editSplitter;
128  CSplitterWnd m_previewSplitter;
129  CSplitterWnd* m_materialEditSplitter;
130 
131  //Child Views
138 
140 
141  //Find Data
142  FindDialog* m_find;
144 
145  //Document Management
148 
149  //Options
151 
152 };
153 
154 
CSplitterWnd m_previewSplitter
Definition: MEMainFrame.h:128
CSplitterWnd * m_materialEditSplitter
Definition: MEMainFrame.h:129
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
Called by the framework while the window is being created.
View that displays material and stage properties and allows the user to edit the properties.
afx_msg void OnApplyAllUpdate(CCmdUI *pCmdUI)
Enables the apply all menu item if there are any materials that need to be applied.
afx_msg void OnEditCopyUpdate(CCmdUI *pCmdUI)
Enables the copy menu item if a material or stage is selected.
void CloseFind()
Called by the find dialog when it is closing.
MEOptions options
Definition: MEMainFrame.h:150
afx_msg void OnReloadImages()
Executes the reloadImages command to reload images that have been changed outside of the editor...
CStatusBar m_wndStatusBar
Definition: MEMainFrame.h:121
MaterialPropTreeView * m_materialPropertyView
Definition: MEMainFrame.h:134
afx_msg void OnEditPasteUpdate(CCmdUI *pCmdUI)
Enables a paste operation when a material or stage has been copied.
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
afx_msg void OnViewIncludeFile()
Toggles between including the file into the material list and not.
afx_msg void OnFileSaveAll()
Saves all modified materials.
CTabCtrl m_tabs
Definition: MEMainFrame.h:125
afx_msg void OnEditDelete()
Performs a delete operation on the selected material or stage.
virtual BOOL PreCreateWindow(CREATESTRUCT &cs)
Sets a few window styles for the main window during the creation process.
afx_msg void OnEditDeleteUpdate(CCmdUI *pCmdUI)
Enables a delete operation when a material or stage is selected.
afx_msg void OnFileSaveAllUpdate(CCmdUI *pCmdUI)
Enables the Save All menu item if there are any materials that have been modified.
void PrintConsoleMessage(const char *msg)
Called to add console text to the console view.
afx_msg void OnSize(UINT nType, int cx, int cy)
Called by the MFC framework when the window size is changed.
afx_msg void OnEditFindNext()
Performs a search with the previously selected search parameters.
#define BOOL
Definition: mprintf.c:71
ConsoleView * m_consoleView
Definition: MEMainFrame.h:137
Wrapper class that is responsible for reading and writing Material Editor settings to the registry...
Definition: MEOptions.h:37
virtual ~MEMainFrame()
Destructor for MEMainFrame.
MaterialPreviewView * m_materialPreviewView
Definition: MEMainFrame.h:135
afx_msg void OnFileSaveMaterialUpdate(CCmdUI *pCmdUI)
Enables the save material menu item if a material is selected and has been modified.
afx_msg void OnApplyFileUpdate(CCmdUI *pCmdUI)
Enables the apply file menu item if the current file contains any materials that need to be applied...
afx_msg void OnFileSaveMaterial()
Saves the selected material.
Dialog that provides an input box and several checkboxes to define the parameters of a search...
Definition: FindDialog.h:40
Responsible for managing a single material that is being viewed and/or edited.
Definition: MaterialDoc.h:67
void FindNext(MaterialSearchData_t *search)
Begins a search based on the provided parameters or the previously used parameters.
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 OnReloadArbPrograms()
Executes the reloadARBPrograms console command for convinience.
afx_msg void OnEditCopy()
Performs a copy operation on the selected material or stage.
afx_msg void OnEditCutUpdate(CCmdUI *pCmdUI)
Enable the cut menu item if a material is selected.
MaterialTreeView * m_materialTreeView
Definition: MEMainFrame.h:132
afx_msg void OnEditRename()
Performs a rename operation on the selected material or stage.
FindDialog * m_find
Definition: MEMainFrame.h:142
afx_msg void OnEditRedoUpdate(CCmdUI *pCmdUI)
Enables the redo menu item if a redo is available.
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext)
Called by the MFC framework to allow the window to create any client windows.
MaterialEditView * m_materialEditView
Definition: MEMainFrame.h:139
Structure used to store the user defined search parameters.
afx_msg void OnEditFind()
Opens the find dialog.
afx_msg void OnEditUndo()
Performs an undo operation.
afx_msg void OnFileSaveFileUpdate(CCmdUI *pCmdUI)
Enables the Save File menu item if the current file contains a modified material. ...
CToolBar m_wndToolBar
Definition: MEMainFrame.h:122
MEMainFrame()
Constructor for MEMainFrame.
afx_msg void OnTcnSelChange(NMHDR *pNMHDR, LRESULT *pResult)
Called when the user changes the editor/console tab selection.
A tree view of all the materials that have been defined.
afx_msg void OnApplyMaterial()
Apply the selected material.
MaterialPreviewPropView * m_previewPropertyView
Definition: MEMainFrame.h:136
afx_msg void OnEditCut()
Performs a cut operation on the selected material.
afx_msg void OnApplyAll()
Applies all modified materials.
View in the Material Editor that functions as a Doom III console.
Definition: ConsoleView.h:37
CSplitterWnd m_editSplitter
Definition: MEMainFrame.h:127
afx_msg void OnEditPaste()
Performs a paste operation on the selected material or stage.
Responsible for managing the materials that are being viewed and/or edited.
afx_msg void OnEditUndoUpdate(CCmdUI *pCmdUI)
Enables the undo menu item if an undo is available.
afx_msg void OnFileSaveFile()
Saves the selected file.
afx_msg void OnDestroy()
Called by the MFC framework while the window is being destroyed.
afx_msg void OnFileExit()
Shuts down the material editor.
#define protected
Definition: TypeInfo.cpp:31
afx_msg void OnEditRedo()
Performs a redo operation.
virtual void MV_OnMaterialSelectionChange(MaterialDoc *pMaterial)
Called when the selected material has changed.
CSplitterWnd m_splitterWnd
Definition: MEMainFrame.h:126
StageView * m_stageView
Definition: MEMainFrame.h:133
MaterialSearchData_t searchData
Definition: MEMainFrame.h:143
afx_msg void OnApplyMaterialUpdate(CCmdUI *pCmdUI)
Enables the Apply Material menu item if the current material has an apply waiting.
afx_msg void OnEditRenameUpdate(CCmdUI *pCmdUI)
Enables a rename operation when a material, folder or stage is selected.
MaterialDocManager materialDocManager
Definition: MEMainFrame.h:146
afx_msg void OnApplyFile()
Applies all modified materials in the selected file.
MaterialDoc * currentDoc
Definition: MEMainFrame.h:147
The main window for the material editor.
Definition: MEMainFrame.h:47