MainFrm.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. // MainFrm.h : interface of the CMainFrame class
  13. //
  14. /////////////////////////////////////////////////////////////////////////////
  15. #ifndef MAINFRAME_H
  16. #define MAINFRAME_H 1
  17. #define STATUS_LINE_PANE 0
  18. #define EDITING_MODE_ICON_PANE 1
  19. #define EDITING_MODE_PANE 2
  20. #define GRID_PANE 3
  21. #define POSITION_PANE 4
  22. #define DOCK_UP 0
  23. #define DOCK_DOWN 1
  24. #define DOCK_LEFT 2
  25. #define DOCK_RIGHT 3
  26. // get pressed key buffer (keys 0-9)
  27. extern INDEX TestKeyBuffers(void);
  28. // macro used for writing text into status line
  29. #define STATUS_LINE_MESASGE( message) if(theApp.m_bShowStatusInfo){\
  30. CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd()); \
  31. ASSERT( pMainFrame != NULL); \
  32. pMainFrame->m_wndStatusBar.SetPaneText( STATUS_LINE_PANE, message, TRUE);};
  33. class CMainFrame : public CMDIFrameWnd
  34. {
  35. DECLARE_DYNAMIC(CMainFrame)
  36. public:
  37. CMainFrame();
  38. // Attributes
  39. public:
  40. // old window position and styles before full screen mode
  41. WINDOWPLACEMENT m_OldPlacement;
  42. LONG m_OldStyleEx;
  43. LONG m_OldStyle;
  44. // main menu
  45. HMENU m_hMenu;
  46. // Tool bars
  47. CStatusBar m_wndStatusBar;
  48. CToolBar m_wndToolBar;
  49. CToolBar m_wndWorkTools;
  50. CToolBar m_wndCSGTools;
  51. CToolBar m_wndMipTools;
  52. CToolBar m_wndProjections;
  53. CToolBar m_wndSettingsAndUtility;
  54. CToolBar m_wndShadowsAndTexture;
  55. CToolBar m_wndSelectEntity;
  56. CToolBar m_wndViewTools;
  57. CToolBar m_wndViewTools2;
  58. // CSG destination combo box
  59. CCSGDesitnationCombo m_CSGDesitnationCombo;
  60. // Triangularisation type combo box
  61. CTriangularisationCombo m_TriangularisationCombo;
  62. // Edit control for editing mip switch distance
  63. CEditMipSwitchDistance m_ctrlEditMipSwitchDistance;
  64. // Tool dialogs
  65. CBrowser m_Browser;
  66. CPropertyComboBar m_PropertyComboBar;
  67. // mini frame used to hold property sheet with dialog pages
  68. CInfoFrame *m_pInfoFrame;
  69. CTFileName m_fnLastVirtualTree;
  70. // color palette
  71. CColorPaletteWnd *m_pColorPalette;
  72. CToolTipWnd *m_pwndToolTip;
  73. // Operations
  74. public:
  75. void DockControlBarRelativeTo(CControlBar* Bar,CControlBar* LeftOf,
  76. ULONG ulDockDirection = DOCK_RIGHT);
  77. BOOL OnIdle(LONG lCount);
  78. // toggle info window
  79. void ToggleInfoWindow();
  80. // shows info window
  81. void ShowInfoWindow();
  82. // reset info window pos
  83. void ResetInfoWindowPos();
  84. // hides info window
  85. void HideInfoWindow();
  86. // startes application
  87. void StartApplication( CTString strApplicationToRun);
  88. // store or restore given virtual shortcut
  89. void ApplyTreeShortcut( INDEX iVDirBuffer, BOOL bCtrl);
  90. // call custom color picker at given coordinates
  91. void CustomColorPicker( PIX pixX, PIX pixY);
  92. void ManualToolTipOn( PIX pixManualX, PIX pixManualY);
  93. void ManualToolTipUpdate( void);
  94. void SetStatusBarMessage( CTString strMessage, INDEX iPane, FLOAT fTime);
  95. // Overrides
  96. // ClassWizard generated virtual function overrides
  97. //{{AFX_VIRTUAL(CMainFrame)
  98. public:
  99. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  100. virtual BOOL DestroyWindow();
  101. virtual BOOL PreTranslateMessage(MSG* pMsg);
  102. protected:
  103. virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  104. //}}AFX_VIRTUAL
  105. // Implementation
  106. public:
  107. virtual ~CMainFrame();
  108. #ifdef _DEBUG
  109. virtual void AssertValid() const;
  110. virtual void Dump(CDumpContext& dc) const;
  111. #endif
  112. // Generated message map functions
  113. public:
  114. //{{AFX_MSG(CMainFrame)
  115. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  116. afx_msg void OnVirtualTree();
  117. afx_msg void OnClose();
  118. afx_msg void OnCancelMode();
  119. afx_msg void OnInitMenu(CMenu* pMenu);
  120. afx_msg void OnViewInfowindow();
  121. afx_msg void OnUpdateViewInfowindow(CCmdUI* pCmdUI);
  122. afx_msg void OnViewCsgtools();
  123. afx_msg void OnUpdateViewCsgtools(CCmdUI* pCmdUI);
  124. afx_msg void OnViewProjectionsBar();
  125. afx_msg void OnUpdateViewProjectionsBar(CCmdUI* pCmdUI);
  126. afx_msg void OnViewWorkBar();
  127. afx_msg void OnUpdateViewWorkBar(CCmdUI* pCmdUI);
  128. afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
  129. afx_msg void OnCreateTexture();
  130. afx_msg void OnCallModeler();
  131. afx_msg void OnCallTexmaker();
  132. afx_msg void OnViewSettingsAndUtilityBar();
  133. afx_msg void OnUpdateViewSettingsAndUtilityBar(CCmdUI* pCmdUI);
  134. afx_msg void OnViewShadowsAndTextureBar();
  135. afx_msg void OnUpdateViewShadowsAndTextureBar(CCmdUI* pCmdUI);
  136. afx_msg void OnViewSelectEntityBar();
  137. afx_msg void OnUpdateViewSelectEntityBar(CCmdUI* pCmdUI);
  138. afx_msg void OnViewViewToolsBar();
  139. afx_msg void OnUpdateViewViewToolsBar(CCmdUI* pCmdUI);
  140. afx_msg void OnViewViewToolsBar2();
  141. afx_msg void OnUpdateViewViewToolsBar2(CCmdUI* pCmdUI);
  142. afx_msg void OnGameAudio();
  143. afx_msg void OnGameVideo();
  144. afx_msg void OnGamePlayer();
  145. afx_msg void OnGameSelectPlayer();
  146. afx_msg void OnShowTreeShortcuts();
  147. afx_msg void OnMenuShortcut01();
  148. afx_msg void OnMenuShortcut02();
  149. afx_msg void OnMenuShortcut03();
  150. afx_msg void OnMenuShortcut04();
  151. afx_msg void OnMenuShortcut05();
  152. afx_msg void OnMenuShortcut06();
  153. afx_msg void OnMenuShortcut07();
  154. afx_msg void OnMenuShortcut08();
  155. afx_msg void OnMenuShortcut09();
  156. afx_msg void OnMenuShortcut10();
  157. afx_msg void OnStoreMenuShortcut01();
  158. afx_msg void OnStoreMenuShortcut02();
  159. afx_msg void OnStoreMenuShortcut03();
  160. afx_msg void OnStoreMenuShortcut04();
  161. afx_msg void OnStoreMenuShortcut05();
  162. afx_msg void OnStoreMenuShortcut06();
  163. afx_msg void OnStoreMenuShortcut07();
  164. afx_msg void OnStoreMenuShortcut08();
  165. afx_msg void OnStoreMenuShortcut09();
  166. afx_msg void OnStoreMenuShortcut10();
  167. afx_msg void OnConsole();
  168. afx_msg void OnViewMipToolsBar();
  169. afx_msg void OnUpdateViewMipToolsBar(CCmdUI* pCmdUI);
  170. afx_msg void OnToolRecreateTexture();
  171. afx_msg void OnRecreateCurrentTexture();
  172. afx_msg void OnLightAnimation();
  173. afx_msg void OnTimer(UINT nIDEvent);
  174. afx_msg void OnHelpFinder();
  175. //}}AFX_MSG
  176. DECLARE_MESSAGE_MAP()
  177. };
  178. /////////////////////////////////////////////////////////////////////////////
  179. #endif // MAINFRAME_H