123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- // SearchClient.cpp: implementation of the SearchClient class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "YLGL.h"
- #include "SearchClient.h"
- #include "ChoosePhotoSkin2.h"
- #include "ChooseDesignSkin.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- SearchClient::SearchClient()
- {
- m_bLogout = m_mode = 0;
- m_exitcode = 0;
- g_pMainWnd->GetSkin();
- }
- SearchClient::~SearchClient()
- {
- }
- void SearchClient::OnFSCommand(LPCTSTR command, LPCTSTR args)
- {
- }
- void SearchClient::Init()
- {
- g_bInSkin = 1;
- if (1)//g_bRedSkin)
- {
- Graphics graph(m_pBk);
- Image *img = NULL;
- if (m_mode == 0)
- ::LoadImageFromBuf(&img, g_mainpath + "\\图片\\选片.jpg");
- else
- ::LoadImageFromBuf(&img, g_mainpath + "\\图片\\看设计.jpg");
- graph.SetSmoothingMode(SmoothingModeHighQuality);
- graph.DrawImage(img, 0, 0);
- delete img;
- }
- else
- {
- Graphics graph(m_pBk);
- Image *img = NULL;
- if (m_mode == 0)
- ::LoadImageFromBuf(&img, g_mainpath + "\\skin\\标题-选片.jpg");
- else
- ::LoadImageFromBuf(&img, g_mainpath + "\\skin\\标题-看设计.jpg");
- graph.DrawImage(img, 0, 0);
- delete img;
- }
- ((MyBmpButton2*)m_picarray.ElementAt(1))->ShowWindow(SW_HIDE);
- m_combobox.Create(WS_VSCROLL | WS_CHILD | CBS_DROPDOWN, m_rcarray.ElementAt(2), this, 100);
- m_combobox.ShowWindow(SW_SHOW);
- CRect rc = m_rcarray.ElementAt(2);
- rc.bottom += 260;
- m_combobox.MoveWindow(rc);
- tpFont.CreatePointFont(180, _T("黑体"));
- m_combobox.SetFont(&tpFont);
- m_acCombo.Init(&m_combobox);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 30;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(21); if (g_bSendOK == 0)return;
- DataToArray(&m_List1array);
- m_acCombo.m_pArray = &m_List1array;
- m_combobox.SetFocus();
- }
- void SearchClient::Destory()
- {
- }
- void SearchClient::BtnClick(WPARAM wParam, LPARAM lParam)
- {
- int id = lParam;
- id -= 99;
- switch (id)
- {
- case 1:
- Begin();
- break;
- case 2:
- break;
- }
- }
- BOOL SearchClient::PreTransMsg(MSG* pMsg)
- {
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_F12:
- m_bLogout = 1;
- CDialog::OnCancel();
- return 1;
- case VK_ESCAPE:
- CDialog::OnCancel();
- return 1;
- case VK_F2:
- if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
- if (m_mode)
- m_exitcode = 2;
- CDialog::OnOK();
- return 1;
- case VK_F3:
- if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
- if (m_mode == 0)
- m_exitcode = 3;
- CDialog::OnOK();
- return 1;
- case VK_RETURN:
- Begin();
- return 1;
- }
- }
- else if (pMsg->message == WM_LBUTTONDOWN)
- {
- g_bNeedDrawParent = 1;
- }
- return CDialog::PreTranslateMessage(pMsg);
- }
- void SearchClient::Begin()
- {
- if (m_mode == 0)
- if (IsHasRightsnew(15) == 0)return;
- int pos = m_combobox.GetCurSel();
- if (pos == -1)return;
- if (m_acCombo.m_posarray.GetSize() <= pos)return;
- int pos2 = m_acCombo.m_posarray.ElementAt(pos);
- #if 0
- ChoosePhotoSkin2 dlg;
- dlg.m_Runingmode = m_mode;
- dlg.SetLiaPath("3.lia");
- dlg.m_strOrderNumber = m_List1array.ElementAt(pos2).ElementAt(0);
- dlg.m_path = g_path2 + "\\";
- dlg.m_path += dlg.m_strOrderNumber;
- dlg.m_path += "\\";
- dlg.DoModal();
- #else
- ChoosePhotoBase *pDlg = NULL;
- if ( m_mode == 0 )
- pDlg = new ChoosePhotoSkin2;
- else
- pDlg = new ChooseDesignSkin;
- pDlg->m_Runingmode = m_mode;
- pDlg->SetLiaPath("3.lia");
- pDlg->m_strOrderNumber = m_List1array.ElementAt(pos2).ElementAt(0);
- pDlg->m_path = g_path2 + "\\";
- pDlg->m_path += pDlg->m_strOrderNumber;
- pDlg->m_path += "\\";
- pDlg->DoModal();
- if ( pDlg )
- delete pDlg;
- #endif
- }
|