mainfrm.cpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program 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. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // MainFrm.cpp : implementation of the CMainFrame class
  19. //
  20. #include "stdafx.h"
  21. #include "wdump.h"
  22. #include "wdtview.h"
  23. #include "wdLview.h"
  24. #include "MainFrm.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CMainFrame
  32. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  33. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  34. //{{AFX_MSG_MAP(CMainFrame)
  35. // NOTE - the ClassWizard will add and remove mapping macros here.
  36. // DO NOT EDIT what you see in these blocks of generated code !
  37. ON_WM_CREATE()
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. static UINT indicators[] =
  41. {
  42. ID_SEPARATOR, // status line indicator
  43. ID_INDICATOR_CAPS,
  44. ID_INDICATOR_NUM,
  45. ID_INDICATOR_SCRL,
  46. };
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CMainFrame construction/destruction
  49. CMainFrame::CMainFrame()
  50. {
  51. // TODO: add member initialization code here
  52. }
  53. CMainFrame::~CMainFrame()
  54. {
  55. }
  56. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  57. {
  58. if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  59. return -1;
  60. if (!m_wndToolBar.Create(this) ||
  61. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  62. {
  63. TRACE0("Failed to create toolbar\n");
  64. return -1; // fail to create
  65. }
  66. if (!m_wndStatusBar.Create(this) ||
  67. !m_wndStatusBar.SetIndicators(indicators,
  68. sizeof(indicators)/sizeof(UINT)))
  69. {
  70. TRACE0("Failed to create status bar\n");
  71. return -1; // fail to create
  72. }
  73. // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  74. m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  75. CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  76. // TODO: Delete these three lines if you don't want the toolbar to
  77. // be dockable
  78. m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  79. EnableDocking(CBRS_ALIGN_ANY);
  80. DockControlBar(&m_wndToolBar);
  81. return 0;
  82. }
  83. BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
  84. CCreateContext* pContext)
  85. {
  86. CRect r;
  87. GetClientRect(r);
  88. // TODO: Add your specialized code here and/or call the base class
  89. if (!m_SplitWnd.CreateStatic(this, 1,2) ||
  90. !m_SplitWnd.CreateView(0, 0, RUNTIME_CLASS(CWDumpTreeView), CSize(300,0), pContext) ||
  91. !m_SplitWnd.CreateView(0, 1, RUNTIME_CLASS(CWDumpListView), CSize(0,0), pContext)) {
  92. return FALSE;
  93. } else {
  94. return TRUE;
  95. }
  96. // return CFrameWnd::OnCreateClient(lpcs, pContext); }
  97. /* return m_wndSplitter.Create( this,
  98. 2, 2, // TODO: adjust the number of rows, columns
  99. CSize( 10, 10 ), // TODO: adjust the minimum pane size
  100. pContext );*/
  101. }
  102. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  103. {
  104. // TODO: Modify the Window class or styles here by modifying
  105. // the CREATESTRUCT cs
  106. return CFrameWnd::PreCreateWindow(cs);
  107. }
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CMainFrame diagnostics
  110. #ifdef _DEBUG
  111. void CMainFrame::AssertValid() const
  112. {
  113. CFrameWnd::AssertValid();
  114. }
  115. void CMainFrame::Dump(CDumpContext& dc) const
  116. {
  117. CFrameWnd::Dump(dc);
  118. }
  119. #endif //_DEBUG
  120. /////////////////////////////////////////////////////////////////////////////
  121. // CMainFrame message handlers