SearchClient.cpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. #include "ChooseDesignSkin.h"
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #define new DEBUG_NEW
  13. #endif
  14. //////////////////////////////////////////////////////////////////////
  15. // Construction/Destruction
  16. //////////////////////////////////////////////////////////////////////
  17. SearchClient::SearchClient()
  18. {
  19. m_bLogout = m_mode = 0;
  20. m_exitcode = 0;
  21. g_pMainWnd->GetSkin();
  22. }
  23. SearchClient::~SearchClient()
  24. {
  25. }
  26. void SearchClient::OnFSCommand(LPCTSTR command, LPCTSTR args)
  27. {
  28. }
  29. void SearchClient::Init()
  30. {
  31. g_bInSkin = 1;
  32. if (1)//g_bRedSkin)
  33. {
  34. Graphics graph(m_pBk);
  35. Image *img = NULL;
  36. if (m_mode == 0)
  37. ::LoadImageFromBuf(&img, g_mainpath + "\\图片\\选片.jpg");
  38. else
  39. ::LoadImageFromBuf(&img, g_mainpath + "\\图片\\看设计.jpg");
  40. graph.SetSmoothingMode(SmoothingModeHighQuality);
  41. graph.DrawImage(img, 0, 0);
  42. delete img;
  43. }
  44. else
  45. {
  46. Graphics graph(m_pBk);
  47. Image *img = NULL;
  48. if (m_mode == 0)
  49. ::LoadImageFromBuf(&img, g_mainpath + "\\skin\\标题-选片.jpg");
  50. else
  51. ::LoadImageFromBuf(&img, g_mainpath + "\\skin\\标题-看设计.jpg");
  52. graph.DrawImage(img, 0, 0);
  53. delete img;
  54. }
  55. ((MyBmpButton2*)m_picarray.ElementAt(1))->ShowWindow(SW_HIDE);
  56. m_combobox.Create(WS_VSCROLL | WS_CHILD | CBS_DROPDOWN, m_rcarray.ElementAt(2), this, 100);
  57. m_combobox.ShowWindow(SW_SHOW);
  58. CRect rc = m_rcarray.ElementAt(2);
  59. rc.bottom += 260;
  60. m_combobox.MoveWindow(rc);
  61. tpFont.CreatePointFont(180, _T("黑体"));
  62. m_combobox.SetFont(&tpFont);
  63. m_acCombo.Init(&m_combobox);
  64. g_sendhead.bsql = 0;
  65. g_sendhead.code[0] = 30;
  66. g_sendhead.tabcount = 1;
  67. g_pMainWnd->ProcessChatMessageRequest2(21); if (g_bSendOK == 0)return;
  68. DataToArray(&m_List1array);
  69. m_acCombo.m_pArray = &m_List1array;
  70. m_combobox.SetFocus();
  71. }
  72. void SearchClient::Destory()
  73. {
  74. }
  75. void SearchClient::BtnClick(WPARAM wParam, LPARAM lParam)
  76. {
  77. int id = lParam;
  78. id -= 99;
  79. switch (id)
  80. {
  81. case 1:
  82. Begin();
  83. break;
  84. case 2:
  85. break;
  86. }
  87. }
  88. BOOL SearchClient::PreTransMsg(MSG* pMsg)
  89. {
  90. if (pMsg->message == WM_KEYDOWN)
  91. {
  92. switch (pMsg->wParam)
  93. {
  94. case VK_F12:
  95. m_bLogout = 1;
  96. CDialog::OnCancel();
  97. return 1;
  98. case VK_ESCAPE:
  99. CDialog::OnCancel();
  100. return 1;
  101. case VK_F2:
  102. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  103. if (m_mode)
  104. m_exitcode = 2;
  105. CDialog::OnOK();
  106. return 1;
  107. case VK_F3:
  108. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  109. if (m_mode == 0)
  110. m_exitcode = 3;
  111. CDialog::OnOK();
  112. return 1;
  113. case VK_RETURN:
  114. Begin();
  115. return 1;
  116. }
  117. }
  118. else if (pMsg->message == WM_LBUTTONDOWN)
  119. {
  120. g_bNeedDrawParent = 1;
  121. }
  122. return CDialog::PreTranslateMessage(pMsg);
  123. }
  124. void SearchClient::Begin()
  125. {
  126. if (m_mode == 0)
  127. if (IsHasRightsnew(15) == 0)return;
  128. int pos = m_combobox.GetCurSel();
  129. if (pos == -1)return;
  130. if (m_acCombo.m_posarray.GetSize() <= pos)return;
  131. int pos2 = m_acCombo.m_posarray.ElementAt(pos);
  132. #if 0
  133. ChoosePhotoSkin2 dlg;
  134. dlg.m_Runingmode = m_mode;
  135. dlg.SetLiaPath("3.lia");
  136. dlg.m_strOrderNumber = m_List1array.ElementAt(pos2).ElementAt(0);
  137. dlg.m_path = g_path2 + "\\";
  138. dlg.m_path += dlg.m_strOrderNumber;
  139. dlg.m_path += "\\";
  140. dlg.DoModal();
  141. #else
  142. ChoosePhotoBase *pDlg = NULL;
  143. if ( m_mode == 0 )
  144. pDlg = new ChoosePhotoSkin2;
  145. else
  146. pDlg = new ChooseDesignSkin;
  147. pDlg->m_Runingmode = m_mode;
  148. pDlg->SetLiaPath("3.lia");
  149. pDlg->m_strOrderNumber = m_List1array.ElementAt(pos2).ElementAt(0);
  150. pDlg->m_path = g_path2 + "\\";
  151. pDlg->m_path += pDlg->m_strOrderNumber;
  152. pDlg->m_path += "\\";
  153. pDlg->DoModal();
  154. if ( pDlg )
  155. delete pDlg;
  156. #endif
  157. }