MEMainFrame.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code 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. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. 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.
  17. 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.
  18. ===========================================================================
  19. */
  20. #pragma once
  21. #include <afxcview.h>
  22. #include "MaterialEditor.h"
  23. #include "MaterialTreeView.h"
  24. #include "MaterialPropTreeView.h"
  25. #include "MaterialPreviewView.h"
  26. #include "StageView.h"
  27. #include "MaterialPreviewPropView.h"
  28. #include "MEOptions.h"
  29. #include "ConsoleView.h"
  30. #include "FindDialog.h"
  31. #include "../common/PropTree/PropTreeView.h"
  32. #include "MaterialDocManager.h"
  33. #include "MaterialEditView.h"
  34. /**
  35. * The main window for the material editor.
  36. */
  37. class MEMainFrame : public CFrameWnd, public MaterialView
  38. {
  39. public:
  40. MEMainFrame();
  41. virtual ~MEMainFrame();
  42. //Public Operations
  43. void PrintConsoleMessage(const char *msg);
  44. protected:
  45. DECLARE_DYNAMIC(MEMainFrame)
  46. // Overrides
  47. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  48. virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
  49. //Message Handlers
  50. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  51. afx_msg void OnDestroy();
  52. afx_msg void OnSize(UINT nType, int cx, int cy);
  53. afx_msg void OnTcnSelChange(NMHDR *pNMHDR, LRESULT *pResult);
  54. //Menu Message Handlers
  55. afx_msg void OnFileExit();
  56. afx_msg void OnFileSaveMaterial();
  57. afx_msg void OnFileSaveFile();
  58. afx_msg void OnFileSaveAll();
  59. afx_msg void OnFileSaveMaterialUpdate(CCmdUI *pCmdUI);
  60. afx_msg void OnFileSaveFileUpdate(CCmdUI *pCmdUI);
  61. afx_msg void OnFileSaveAllUpdate(CCmdUI *pCmdUI);
  62. afx_msg void OnApplyMaterial();
  63. afx_msg void OnApplyFile();
  64. afx_msg void OnApplyAll();
  65. afx_msg void OnApplyMaterialUpdate(CCmdUI *pCmdUI);
  66. afx_msg void OnApplyFileUpdate(CCmdUI *pCmdUI);
  67. afx_msg void OnApplyAllUpdate(CCmdUI *pCmdUI);
  68. afx_msg void OnEditCut();
  69. afx_msg void OnEditCopy();
  70. afx_msg void OnEditPaste();
  71. afx_msg void OnEditDelete();
  72. afx_msg void OnEditRename();
  73. afx_msg void OnEditCutUpdate(CCmdUI *pCmdUI);
  74. afx_msg void OnEditCopyUpdate(CCmdUI *pCmdUI);
  75. afx_msg void OnEditPasteUpdate(CCmdUI *pCmdUI);
  76. afx_msg void OnEditDeleteUpdate(CCmdUI *pCmdUI);
  77. afx_msg void OnEditRenameUpdate(CCmdUI *pCmdUI);
  78. afx_msg void OnEditFind();
  79. afx_msg void OnEditFindNext();
  80. afx_msg void OnEditUndo();
  81. afx_msg void OnEditRedo();
  82. afx_msg void OnEditUndoUpdate(CCmdUI *pCmdUI);
  83. afx_msg void OnEditRedoUpdate(CCmdUI *pCmdUI);
  84. afx_msg void OnViewIncludeFile();
  85. afx_msg void OnReloadArbPrograms();
  86. afx_msg void OnReloadImages();
  87. DECLARE_MESSAGE_MAP()
  88. //Methods for Find interactions
  89. friend FindDialog;
  90. void CloseFind();
  91. void FindNext(MaterialSearchData_t* search);
  92. //MaterialView Interface
  93. virtual void MV_OnMaterialSelectionChange(MaterialDoc* pMaterial);
  94. protected:
  95. //Status and Toolbars
  96. CStatusBar m_wndStatusBar;
  97. CToolBar m_wndToolBar;
  98. //Splitter windows
  99. CTabCtrl m_tabs;
  100. CSplitterWnd m_splitterWnd;
  101. CSplitterWnd m_editSplitter;
  102. CSplitterWnd m_previewSplitter;
  103. CSplitterWnd* m_materialEditSplitter;
  104. //Child Views
  105. MaterialTreeView* m_materialTreeView;
  106. StageView* m_stageView;
  107. MaterialPropTreeView* m_materialPropertyView;
  108. MaterialPreviewView* m_materialPreviewView;
  109. MaterialPreviewPropView* m_previewPropertyView;
  110. ConsoleView* m_consoleView;
  111. MaterialEditView* m_materialEditView;
  112. //Find Data
  113. FindDialog* m_find;
  114. MaterialSearchData_t searchData;
  115. //Document Management
  116. MaterialDocManager materialDocManager;
  117. MaterialDoc* currentDoc;
  118. //Options
  119. MEOptions options;
  120. };