Old fashion design for PC-104
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.

130 lines
3.0 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: MainFrm.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of MainFrm.cpp
  13. //----------------------------------------------------------------------------
  14. // MainFrm.cpp : implementation of the CMainFrame class
  15. //
  16. #include "stdafx.h"
  17. #include "BoardReceiver.h"
  18. #include "MainFrm.h"
  19. /*
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25. */
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CMainFrame
  28. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  29. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  30. //{{AFX_MSG_MAP(CMainFrame)
  31. ON_WM_CREATE()
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. static UINT indicators[] =
  35. {
  36. ID_SEPARATOR, // status line indicator
  37. ID_INDICATOR_ANGLES,
  38. ID_INDICATOR_X,
  39. ID_INDICATOR_Y,
  40. /* ID_INDICATOR_CAPS,
  41. ID_INDICATOR_NUM,
  42. ID_INDICATOR_SCRL,
  43. */
  44. };
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CMainFrame construction/destruction
  47. CMainFrame::CMainFrame()
  48. {
  49. // TODO: add member initialization code here
  50. }
  51. CMainFrame::~CMainFrame()
  52. {
  53. }
  54. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  55. {
  56. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  57. return -1;
  58. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  59. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  60. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  61. {
  62. TRACE0("Failed to create toolbar\n");
  63. return -1; // fail to create
  64. }
  65. if (!m_wndStatusBar.Create(this) ||
  66. !m_wndStatusBar.SetIndicators(indicators,
  67. sizeof(indicators)/sizeof(UINT)))
  68. {
  69. TRACE0("Failed to create status bar\n");
  70. return -1; // fail to create
  71. }
  72. // TODO: Delete these three lines if you don't want the toolbar to
  73. // be dockable
  74. m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  75. EnableDocking(CBRS_ALIGN_ANY);
  76. DockControlBar(&m_wndToolBar);
  77. return 0;
  78. }
  79. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  80. {
  81. if( !CMDIFrameWnd::PreCreateWindow(cs) )
  82. return FALSE;
  83. // TODO: Modify the Window class or styles here by modifying
  84. // the CREATESTRUCT cs
  85. return TRUE;
  86. }
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CMainFrame diagnostics
  89. #ifdef _DEBUG
  90. void CMainFrame::AssertValid() const
  91. {
  92. CMDIFrameWnd::AssertValid();
  93. }
  94. void CMainFrame::Dump(CDumpContext& dc) const
  95. {
  96. CMDIFrameWnd::Dump(dc);
  97. }
  98. #endif //_DEBUG
  99. void CMainFrame::ShowMousePosition( LPCTSTR pTextX, LPCTSTR pTextY )
  100. {
  101. m_wndStatusBar.SetPaneText( 2, pTextX );
  102. m_wndStatusBar.SetPaneText( 3, pTextY );
  103. }
  104. void CMainFrame::ShowLastAngles( LPCTSTR pLastAngles )
  105. {
  106. m_wndStatusBar.SetPaneText( 1, pLastAngles );
  107. }