SearchClient.cpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // SearchClient.cpp: implementation of the SearchClient class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "YLGL.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_bLogout = 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. g_bInSkin = 1;
  31. if (1)//g_bRedSkin)
  32. {
  33. Graphics graph(m_pBk);
  34. Image *img = NULL;
  35. if (m_mode == 0)
  36. ::LoadImageFromBuf(&img, g_mainpath + "\\图片\\选片.jpg");
  37. else
  38. ::LoadImageFromBuf(&img, g_mainpath + "\\图片\\看设计.jpg");
  39. graph.SetSmoothingMode(SmoothingModeHighQuality);
  40. graph.DrawImage(img, 0, 0);
  41. delete img;
  42. }
  43. else
  44. {
  45. Graphics graph(m_pBk);
  46. Image *img = NULL;
  47. if (m_mode == 0)
  48. ::LoadImageFromBuf(&img, g_mainpath + "\\skin\\标题-选片.jpg");
  49. else
  50. ::LoadImageFromBuf(&img, g_mainpath + "\\skin\\标题-看设计.jpg");
  51. graph.DrawImage(img, 0, 0);
  52. delete img;
  53. }
  54. ((MyBmpButton2*)m_picarray.ElementAt(1))->ShowWindow(SW_HIDE);
  55. m_combobox.Create(WS_VSCROLL | WS_CHILD | CBS_DROPDOWN, m_rcarray.ElementAt(2), this, 100);
  56. m_combobox.ShowWindow(SW_SHOW);
  57. CRect rc = m_rcarray.ElementAt(2);
  58. rc.bottom += 260;
  59. m_combobox.MoveWindow(rc);
  60. tpFont.CreatePointFont(180, _T("黑体"));
  61. m_combobox.SetFont(&tpFont);
  62. m_acCombo.Init(&m_combobox);
  63. g_sendhead.bsql = 0;
  64. g_sendhead.code[0] = 30;
  65. g_sendhead.tabcount = 1;
  66. g_pMainWnd->ProcessChatMessageRequest2(21); if (g_bSendOK == 0)return;
  67. DataToArray(&m_List1array);
  68. m_acCombo.m_pArray = &m_List1array;
  69. m_combobox.SetFocus();
  70. }
  71. void SearchClient::Destory()
  72. {
  73. }
  74. void SearchClient::BtnClick(WPARAM wParam, LPARAM lParam)
  75. {
  76. int id = lParam;
  77. id -= 99;
  78. switch (id)
  79. {
  80. case 1:
  81. Begin();
  82. break;
  83. case 2:
  84. break;
  85. }
  86. }
  87. BOOL SearchClient::PreTransMsg(MSG* pMsg)
  88. {
  89. if (pMsg->message == WM_KEYDOWN)
  90. {
  91. switch (pMsg->wParam)
  92. {
  93. case VK_F12:
  94. m_bLogout = 1;
  95. CDialog::OnCancel();
  96. return 1;
  97. case VK_ESCAPE:
  98. CDialog::OnCancel();
  99. return 1;
  100. case VK_F2:
  101. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  102. if (m_mode)
  103. m_exitcode = 2;
  104. CDialog::OnOK();
  105. return 1;
  106. case VK_F3:
  107. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  108. if (m_mode == 0)
  109. m_exitcode = 3;
  110. CDialog::OnOK();
  111. return 1;
  112. case VK_RETURN:
  113. Begin();
  114. return 1;
  115. }
  116. }
  117. else if (pMsg->message == WM_LBUTTONDOWN)
  118. {
  119. g_bNeedDrawParent = 1;
  120. }
  121. return CDialog::PreTranslateMessage(pMsg);
  122. }
  123. void SearchClient::Begin()
  124. {
  125. if (m_mode == 0)
  126. if (IsHasRightsnew(15) == 0)return;
  127. int pos = m_combobox.GetCurSel();
  128. if (pos == -1)return;
  129. if (m_acCombo.m_posarray.GetSize() <= pos)return;
  130. int pos2 = m_acCombo.m_posarray.ElementAt(pos);
  131. ChoosePhotoSkin2 dlg;
  132. dlg.m_Runingmode = m_mode;
  133. dlg.SetLiaPath("3.lia");
  134. dlg.m_strOrderNumber = m_List1array.ElementAt(pos2).ElementAt(0);
  135. dlg.m_path = g_path2 + "\\";
  136. dlg.m_path += dlg.m_strOrderNumber;
  137. dlg.m_path += "\\";
  138. dlg.DoModal();
  139. }