Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.1 KiB

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "ISAdmin.h"
  5. #include "mainfrm.h"
  6. #ifdef _DEBUG
  7. #undef THIS_FILE
  8. static char BASED_CODE THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMainFrame
  12. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  13. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  14. //{{AFX_MSG_MAP(CMainFrame)
  15. // NOTE - the ClassWizard will add and remove mapping macros here.
  16. // DO NOT EDIT what you see in these blocks of generated code !
  17. ON_WM_CREATE()
  18. //}}AFX_MSG_MAP
  19. // Global help commands
  20. ON_COMMAND(ID_HELP_INDEX, CFrameWnd::OnHelpIndex)
  21. ON_COMMAND(ID_HELP_USING, CFrameWnd::OnHelpUsing)
  22. ON_COMMAND(ID_HELP, CFrameWnd::OnHelp)
  23. ON_COMMAND(ID_CONTEXT_HELP, CFrameWnd::OnContextHelp)
  24. ON_COMMAND(ID_DEFAULT_HELP, CFrameWnd::OnHelpIndex)
  25. END_MESSAGE_MAP()
  26. /////////////////////////////////////////////////////////////////////////////
  27. // arrays of IDs used to initialize control bars
  28. // toolbar buttons - IDs are command buttons
  29. static UINT BASED_CODE buttons[] =
  30. {
  31. // same order as in the bitmap 'toolbar.bmp'
  32. // ID_FILE_NEW,
  33. // ID_FILE_OPEN,
  34. // ID_FILE_SAVE,
  35. // ID_SEPARATOR,
  36. ID_EDIT_CUT,
  37. ID_EDIT_COPY,
  38. ID_EDIT_PASTE,
  39. ID_SEPARATOR,
  40. // ID_FILE_PRINT,
  41. ID_APP_ABOUT,
  42. ID_HELP,
  43. };
  44. static UINT BASED_CODE indicators[] =
  45. {
  46. ID_SEPARATOR, // status line indicator
  47. ID_INDICATOR_CAPS,
  48. ID_INDICATOR_NUM,
  49. ID_INDICATOR_SCRL,
  50. };
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CMainFrame construction/destruction
  53. CMainFrame::CMainFrame()
  54. {
  55. // TODO: add member initialization code here
  56. }
  57. CMainFrame::~CMainFrame()
  58. {
  59. }
  60. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  61. {
  62. if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  63. return -1;
  64. if (!m_wndToolBar.Create(this) ||
  65. !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  66. !m_wndToolBar.SetButtons(buttons,
  67. sizeof(buttons)/sizeof(UINT)))
  68. {
  69. TRACE0("Failed to create toolbar\n");
  70. return -1; // fail to create
  71. }
  72. if (!m_wndStatusBar.Create(this) ||
  73. !m_wndStatusBar.SetIndicators(indicators,
  74. sizeof(indicators)/sizeof(UINT)))
  75. {
  76. TRACE0("Failed to create status bar\n");
  77. return -1; // fail to create
  78. }
  79. // TODO: Delete these three lines if you don't want the toolbar to
  80. // be dockable
  81. m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  82. EnableDocking(CBRS_ALIGN_ANY);
  83. DockControlBar(&m_wndToolBar);
  84. // TODO: Remove this if you don't want tool tips
  85. m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  86. CBRS_TOOLTIPS | CBRS_FLYBY);
  87. return 0;
  88. }
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CMainFrame diagnostics
  91. #ifdef _DEBUG
  92. void CMainFrame::AssertValid() const
  93. {
  94. CFrameWnd::AssertValid();
  95. }
  96. void CMainFrame::Dump(CDumpContext& dc) const
  97. {
  98. CFrameWnd::Dump(dc);
  99. }
  100. #endif //_DEBUG
  101. /////////////////////////////////////////////////////////////////////////////
  102. // CMainFrame message handlers
  103. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  104. {
  105. // TODO: Add your specialized code here and/or call the base class
  106. cs.style &= ~((LONG)FWS_ADDTOTITLE);
  107. return CFrameWnd::PreCreateWindow(cs);
  108. }