GuiServerExplorer.cpp
上传用户:wlkj888
上传日期:2022-08-01
资源大小:806k
文件大小:2k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. #include "StdAfx.h"
  2. #include "guiserverexplorer.h"
  3. #include "resource.h"
  4. #define ID_REFRESH 0x355
  5. #define ID_CONNECT 0x356
  6. #define ID_CONSERVER 0x367
  7. CGuiServerExplorer::CGuiServerExplorer(void)
  8. {
  9. }
  10. CGuiServerExplorer::~CGuiServerExplorer(void)
  11. {
  12. }
  13. BEGIN_MESSAGE_MAP(CGuiServerExplorer, CGuiControlBar)
  14. ON_WM_CREATE()
  15. ON_COMMAND(ID_REFRESH,  OnExplorer)
  16. ON_COMMAND(ID_CONNECT,  OnServer)
  17. ON_COMMAND(ID_CONSERVER,  OnConnect)
  18. END_MESSAGE_MAP()
  19. int CGuiServerExplorer::OnCreate(LPCREATESTRUCT lpCreateStruct)
  20. {
  21. if (CGuiControlBar::OnCreate(lpCreateStruct) == -1)
  22. return -1;
  23. const DWORD dwStyle =WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS ;
  24. if (!m_ctServer.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,0,0),this,124))
  25. return -1;
  26. CreatServerExplorer();
  27. if (!m_TreeServerExplorer.Create(dwStyle, CRect(0,0,0,0), &m_ctServer, 2))
  28. return -1;
  29. m_ctServer.AddComponen(&m_TreeServerExplorer);
  30. // TODO:  Add your specialized creation code here
  31. SetIcon(IDB_BITMAPHELP,16,4,RGB(255,0,0),4);
  32. return 0;
  33. }
  34. void CGuiServerExplorer::OnConnect()
  35. {
  36. AfxMessageBox("Connect");
  37. }
  38. void CGuiServerExplorer::OnServer()
  39. {
  40. AfxMessageBox("Server");
  41. }
  42. void CGuiServerExplorer::OnExplorer()
  43. {
  44. AfxMessageBox("Refresh");
  45. }
  46. int CGuiServerExplorer::CreatServerExplorer()
  47. {
  48. m_ctServer.AddComponen(&m_miServer);
  49. m_miServer.AlingButtons(CGuiMiniTool::ALIGN_LEFT);
  50. m_miServer.SetImageList(IDB_DBPROJECTS, 16,27, RGB (255, 0, 0));
  51. m_miServer.AddButton(24,ID_REFRESH,NULL,_T(""),"Refresh");
  52. m_miServer.AddButton(25,ID_CONNECT,NULL,_T(""),"Connect To Database");
  53. m_miServer.AddButton(26,ID_CONSERVER,NULL,_T(""),"Connect To Server");
  54. m_miServer.AutoSize(FALSE);
  55. // m_miServer.SetColor(GuiDrawLayer::GetRGBColorXP());
  56. return 1;
  57. }