SearchClient.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // SearchClient.cpp: implementation of the SearchClient class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "LYFZIPManage.h"
  6. #include "SearchClient.h"
  7. #include "ChoosePhotoSkin2.h"
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char THIS_FILE[]=__FILE__;
  11. #define new DEBUG_NEW
  12. #endif
  13. //////////////////////////////////////////////////////////////////////
  14. // Construction/Destruction
  15. //////////////////////////////////////////////////////////////////////
  16. SearchClient::SearchClient()
  17. {
  18. m_mode=0;
  19. m_exitcode=0;
  20. g_pMainWnd->GetSkin();
  21. }
  22. SearchClient::~SearchClient()
  23. {
  24. }
  25. void SearchClient::OnFSCommand(LPCTSTR command, LPCTSTR args)
  26. {
  27. }
  28. void SearchClient::Init()
  29. {
  30. #ifdef MNLS_VERSION
  31. if(m_mode==0)
  32. ((MyBmpButton2*)m_picarray.ElementAt (1))->ShowWindow (SW_HIDE);
  33. else
  34. ((MyBmpButton2*)m_picarray.ElementAt (1))->EnableWindow (0);
  35. #else
  36. Graphics graph(m_pBk);
  37. Image *img=NULL;
  38. if(m_mode==0)
  39. ::LoadImageFromBuf (&img, g_mainpath+"\\skin\\标题-选片.jpg");
  40. else
  41. ::LoadImageFromBuf (&img, g_mainpath+"\\skin\\标题-看设计.jpg");
  42. graph.DrawImage(img, 0,0);
  43. delete img;
  44. ((MyBmpButton2*)m_picarray.ElementAt (1))->ShowWindow (SW_HIDE);
  45. #endif
  46. m_combobox.Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWN,m_rcarray.ElementAt (2),this,100);
  47. m_combobox.ShowWindow(SW_SHOW);
  48. CRect rc=m_rcarray.ElementAt (2);
  49. rc.bottom +=260;
  50. m_combobox.MoveWindow (rc);
  51. tpFont.CreatePointFont (180, _T("黑体"));
  52. m_combobox.SetFont(&tpFont);
  53. m_acCombo.Init(&m_combobox);
  54. g_sendhead.bsql=0;
  55. g_sendhead.code[0]=30;
  56. g_sendhead.tabcount=1;
  57. g_pMainWnd->ProcessChatMessageRequest2(21);if(g_bSendOK==0)return;
  58. DataToArray(&m_List1array);
  59. m_acCombo.m_pArray=&m_List1array;
  60. m_combobox.SetFocus ();
  61. }
  62. void SearchClient::Destory()
  63. {
  64. }
  65. void SearchClient::BtnClick(WPARAM wParam, LPARAM lParam)
  66. {
  67. int id=lParam;
  68. id-=99;
  69. switch(id)
  70. {
  71. case 1:
  72. Begin();
  73. break;
  74. case 2:
  75. break;
  76. }
  77. }
  78. BOOL SearchClient::PreTransMsg(MSG* pMsg)
  79. {
  80. if(pMsg->message==WM_KEYDOWN)
  81. {
  82. switch (pMsg->wParam)
  83. {
  84. case VK_ESCAPE:
  85. CDialog::OnCancel ();
  86. return 1;
  87. case VK_F2:
  88. if(m_mode)
  89. m_exitcode=2;
  90. CDialog::OnOK ();
  91. return 1;
  92. case VK_F3:
  93. if(m_mode==0)
  94. m_exitcode=3;
  95. CDialog::OnOK ();
  96. return 1;
  97. case VK_RETURN:
  98. Begin();
  99. return 1;
  100. }
  101. }
  102. else if(pMsg->message==WM_LBUTTONDOWN)
  103. {
  104. g_bNeedDrawParent=1;
  105. }
  106. return CDialog::PreTranslateMessage(pMsg);
  107. }
  108. void SearchClient::Begin()
  109. {
  110. if(m_mode==0)
  111. if(IsHasRightsnew(15)==0)return;
  112. int pos=m_combobox.GetCurSel ();
  113. if(pos==-1)return;
  114. int pos2=m_acCombo.m_posarray .ElementAt (pos);
  115. ChoosePhotoSkin2 dlg;
  116. dlg.m_mode2 =m_mode;
  117. dlg.SetLiaPath ("3.lia");
  118. dlg.m_id=m_List1array.ElementAt (pos2).ElementAt (0);
  119. dlg.m_path=g_path2+"\\";
  120. dlg.m_path+=dlg.m_id;
  121. dlg.m_path +="\\";
  122. dlg.DoModal ();
  123. }