Section.cpp
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 2k
Category:

Graph program

Development Platform:

Visual C++

  1. #include "stdafx.h"
  2. #include "Section.h"
  3. #include "..//resource.h"
  4. SectionCommand::SectionCommand(IApplicationInterface* appI):
  5. m_app(appI)
  6. {
  7. ASSERT(m_app);
  8. }
  9. SectionCommand::~SectionCommand()
  10. {
  11. m_app->GetCommandPanel()->RemoveAllDialogs();
  12. m_app->GetViewPort()->InvalidateViewPort();
  13. }
  14. bool    SectionCommand::PreTranslateMessage(MSG* pMsg)
  15. {
  16. if (pMsg->message==WM_KEYUP)
  17. return true;
  18. if (pMsg->message==WM_KEYDOWN || 
  19. pMsg->message==WM_CHAR)
  20. {
  21. if (pMsg->wParam==VK_RETURN)
  22. {
  23. OnEnter();
  24. return true;
  25. }
  26. if (pMsg->wParam==VK_ESCAPE)
  27. {
  28. m_app->StopCommander();
  29. return true;
  30. }
  31. /*if (m_get_point_panel)
  32. {
  33. m_get_point_panel->GetWindow()->SendMessage(WM_CHAR,
  34. pMsg->wParam,
  35. pMsg->lParam);
  36. return true;
  37. }*/
  38. }
  39. else
  40. {
  41. if (pMsg->hwnd == m_app->GetViewPort()->GetWindow()->m_hWnd)
  42. {
  43. switch(pMsg->message) 
  44. {
  45. case WM_MOUSEMOVE:
  46. MouseMove(pMsg->wParam,GET_X_LPARAM(pMsg->lParam),GET_Y_LPARAM(pMsg->lParam));
  47. return true;
  48. case WM_LBUTTONDOWN:
  49. LeftClick(pMsg->wParam,GET_X_LPARAM(pMsg->lParam),GET_Y_LPARAM(pMsg->lParam));
  50. return true;
  51. default:
  52. return false;
  53. }
  54. }
  55. }
  56. return false;
  57. }
  58. void  SectionCommand::Start()
  59. {
  60. }
  61. void  SectionCommand::MouseMove(unsigned int nFlags,int pX,int pY)
  62. {
  63. }
  64. void  SectionCommand::LeftClick(unsigned int nFlags,int pX,int pY)
  65. {
  66. }
  67. void  SectionCommand::Draw()
  68. {
  69. }
  70. void  SectionCommand::OnEnter()
  71. {
  72. }
  73. unsigned int  SectionCommand::GetItemsCount()
  74. {
  75. return 0;
  76. }
  77. void         SectionCommand::GetItem(unsigned int itemID, CString& itSrt)
  78. {
  79. }
  80. void     SectionCommand::GetItemState(unsigned int itemID, bool& enbl, bool& checked)
  81. {
  82. }
  83. HBITMAP   SectionCommand::GetItemBitmap(unsigned int)
  84. {
  85. return NULL;
  86. }
  87. void         SectionCommand::Run(unsigned int itemID)
  88. {
  89. }