ComboListCtrl6.cpp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. // ComboBoxListCtrl4.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ComboListCtrl6.h"
  5. #include <windowsx.h>
  6. #include "ylgl.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. #define IDC_ComboBox 0X01
  13. #define PROPERTY_ITEM 0x02
  14. #define PROPERTY_SUB 0x03
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CComboBoxListCtrl6
  17. extern CFont g_listctrlfont;
  18. //ComboBox////////////////////////////////////////////////////////////////////////
  19. CListCtrlComboBox6::CListCtrlComboBox6()
  20. {
  21. }
  22. CListCtrlComboBox6::~CListCtrlComboBox6()
  23. {
  24. }
  25. BEGIN_MESSAGE_MAP(CListCtrlComboBox6, CComboBox)
  26. //{{AFX_MSG_MAP(CListCtrlComboBox6)
  27. ON_WM_KILLFOCUS()
  28. ON_WM_SETFOCUS()
  29. ON_CONTROL_REFLECT(CBN_CLOSEUP, OnCloseup)
  30. //}}AFX_MSG_MAP
  31. END_MESSAGE_MAP()
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CListCtrlComboBox6 message handlers
  34. void CListCtrlComboBox6::SetCtrlData(DWORD dwData)
  35. {
  36. m_dwData = dwData;
  37. }
  38. DWORD CListCtrlComboBox6::GetCtrlData()
  39. {
  40. return m_dwData;
  41. }
  42. void CListCtrlComboBox6::OnKillFocus(CWnd* pNewWnd)
  43. {
  44. CComboBox::OnKillFocus(pNewWnd);
  45. CWnd* pParent = this->GetParent();
  46. // ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  47. }
  48. BOOL CListCtrlComboBox6::PreTranslateMessage(MSG* pMsg)
  49. {
  50. if(pMsg->message == WM_KEYDOWN)
  51. {
  52. if(pMsg->wParam == VK_RETURN)
  53. {
  54. CWnd* pParent = this->GetParent();
  55. m_bExchange = TRUE;
  56. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  57. }
  58. else if(pMsg->wParam == VK_ESCAPE)
  59. {
  60. CWnd* pParent = this->GetParent();
  61. m_bExchange = FALSE;
  62. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  63. }
  64. }
  65. return CComboBox::PreTranslateMessage(pMsg);
  66. }
  67. void CListCtrlComboBox6::OnSetFocus(CWnd* pOldWnd)
  68. {
  69. CComboBox::OnSetFocus(pOldWnd);
  70. m_bExchange = TRUE;
  71. }
  72. void CListCtrlComboBox6::OnCloseup()
  73. {
  74. // TODO: Add your control notification handler code here
  75. CWnd* pParent = this->GetParent();
  76. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  77. }
  78. ///ListCtrl/////////////////////////////////////////////////////
  79. CComboBoxListCtrl6::CComboBoxListCtrl6()
  80. {
  81. // m_pComboBox->m_hWnd = NULL;
  82. }
  83. CComboBoxListCtrl6::~CComboBoxListCtrl6()
  84. {
  85. }
  86. BEGIN_MESSAGE_MAP(CComboBoxListCtrl6, CListCtrl)
  87. //{{AFX_MSG_MAP(CComboBoxListCtrl6)
  88. ON_WM_LBUTTONDBLCLK()
  89. ON_WM_LBUTTONDOWN()
  90. ON_WM_PARENTNOTIFY()
  91. ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomdrawList)
  92. //}}AFX_MSG_MAP
  93. ON_MESSAGE(WM_USER_ComboBox_END,OnComboBoxEnd)
  94. ON_MESSAGE(WM_USER_EDIT_END,OnEditEnd)
  95. END_MESSAGE_MAP()
  96. void CComboBoxListCtrl6::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
  97. {
  98. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  99. // Take the default processing unless we set this to something else below.
  100. *pResult = 0;
  101. // First thing - check the draw stage. If it's the control's prepaint
  102. // stage, then tell Windows we want messages for every item.
  103. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  104. {
  105. *pResult = CDRF_NOTIFYITEMDRAW;
  106. }
  107. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  108. {
  109. // This is the prepaint stage for an item. Here's where we set the
  110. // item's text color. Our return value will tell Windows to draw the
  111. // item itself, but it will use the new color we set here.
  112. // We'll cycle the colors through red, green, and light blue.
  113. COLORREF crText;
  114. int pos=pLVCD->nmcd.dwItemSpec;
  115. if(pos%2)
  116. {
  117. pLVCD->clrTextBk = g_gridcol1;
  118. }
  119. else
  120. {
  121. pLVCD->clrTextBk = g_gridcol2;
  122. }
  123. // Tell Windows to paint the control itself.
  124. *pResult = CDRF_DODEFAULT;
  125. }
  126. }
  127. void CComboBoxListCtrl6::OnLButtonDown(UINT nFlags, CPoint point)
  128. {
  129. ::PostMessage(this->GetSafeHwnd(),WM_USER_ComboBox_END,1,0);
  130. CListCtrl::OnLButtonDown( nFlags, point) ;
  131. }
  132. void CComboBoxListCtrl6::OnLButtonDblClk(UINT nFlags, CPoint point)
  133. {
  134. CRect rcCtrl;
  135. LVHITTESTINFO lvhti;
  136. lvhti.pt = point;
  137. int nItem = CListCtrl::SubItemHitTest(&lvhti);
  138. if(nItem == -1)
  139. return;
  140. int nSubItem = lvhti.iSubItem;
  141. CListCtrl::GetSubItemRect(nItem,nSubItem,LVIR_LABEL,rcCtrl);
  142. rcCtrl.top -=4;
  143. if(nSubItem==2 || nSubItem==7)
  144. {
  145. rcCtrl.bottom +=200;
  146. rcCtrl.top +=2;
  147. ShowComboBox2(TRUE,nItem,nSubItem,rcCtrl);
  148. }
  149. else if(nSubItem==8)
  150. {
  151. ShowEdit(TRUE,nItem,nSubItem,rcCtrl);
  152. }
  153. else if(nSubItem==4)
  154. {
  155. rcCtrl.bottom +=200;
  156. rcCtrl.top +=2;
  157. ShowComboBox3(TRUE,nItem,nSubItem,rcCtrl);
  158. }
  159. else if(nSubItem==5 || nSubItem==6)
  160. {
  161. rcCtrl.bottom +=200;
  162. rcCtrl.top +=2;
  163. ShowComboBox(TRUE,nItem,nSubItem,rcCtrl);
  164. }
  165. else if(nSubItem==3 )
  166. ShowDateCtrl(TRUE,nItem,nSubItem,rcCtrl);
  167. CListCtrl::OnLButtonDblClk(nFlags, point);
  168. }
  169. void CComboBoxListCtrl6::ShowEdit(BOOL bShow,int nItem,int nIndex,CRect rcCtrl)
  170. {
  171. if(m_edit.m_hWnd == NULL)
  172. {
  173. m_edit.Create(ES_AUTOHSCROLL|WS_CHILD|ES_LEFT|ES_WANTRETURN|WS_BORDER,CRect(0,0,0,0),this,101);
  174. m_edit.ShowWindow(SW_HIDE);
  175. CFont tpFont;
  176. tpFont.CreateStockObject(DEFAULT_GUI_FONT);
  177. m_edit.SetFont(&tpFont);
  178. tpFont.DeleteObject();
  179. }
  180. if(bShow == TRUE)
  181. {
  182. CString strItem = CListCtrl::GetItemText(nItem,nIndex);
  183. m_edit.MoveWindow(rcCtrl);
  184. m_edit.ShowWindow(SW_SHOW);
  185. m_edit.SetWindowText(strItem);
  186. ::SetFocus(m_edit.GetSafeHwnd());
  187. m_edit.SetSel(-1);
  188. m_edit.SetCtrlData(MAKEWPARAM(nIndex,nItem));
  189. }
  190. else
  191. m_edit.ShowWindow(SW_HIDE);
  192. }
  193. void CComboBoxListCtrl6::ShowDateCtrl(BOOL bShow,int nItem,int nIndex,CRect rcCtrl)
  194. {
  195. if(m_DateCtrl.m_hWnd == NULL)
  196. {
  197. m_DateCtrl.Create(WS_CHILD,CRect(0,0,0,0),this,IDC_ComboBox);
  198. m_DateCtrl.ShowWindow(SW_HIDE);
  199. }
  200. if(bShow == TRUE)
  201. {
  202. CString strItem = CListCtrl::GetItemText(nItem,nIndex);
  203. if(strItem.GetLength ()==10)
  204. {
  205. CTime tm(atoi(strItem.Mid (0,4)), atoi(strItem.Mid (5,2)), atoi(strItem.Mid (8,2)), 0,0,0);
  206. m_DateCtrl.SetTime(&tm);
  207. }
  208. else
  209. {
  210. CTime tm=CTime::GetCurrentTime ();
  211. // CTimeSpan dt(3, 0, 0, 0);
  212. // tm+=dt;
  213. m_DateCtrl.SetTime(&tm);
  214. }
  215. m_DateCtrl.MoveWindow(rcCtrl);
  216. m_DateCtrl.ShowWindow(SW_SHOW);
  217. ::SetFocus(m_DateCtrl.GetSafeHwnd());
  218. m_nSub=nIndex;
  219. m_nItem=nItem;
  220. }
  221. else
  222. m_DateCtrl.ShowWindow(SW_HIDE);
  223. }
  224. void CComboBoxListCtrl6::ShowComboBox2(BOOL bShow,int nItem,int nIndex,CRect rcCtrl)
  225. {
  226. if(m_ComboBox.m_hWnd == NULL)
  227. {
  228. m_ComboBox.Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWNLIST,CRect(0,0,0,0),this,IDC_ComboBox);
  229. m_ComboBox.ShowWindow(SW_HIDE);
  230. }
  231. if(bShow == TRUE)
  232. {
  233. CString strItem = CListCtrl::GetItemText(nItem,nIndex);
  234. m_ComboBox.MoveWindow(rcCtrl);
  235. m_ComboBox.ShowWindow(SW_SHOW);
  236. ::SetFocus(m_ComboBox.GetSafeHwnd());
  237. m_ComboBox.ResetContent ();
  238. if(nIndex==2)
  239. {
  240. m_ComboBox.AddString ("¹«Àú");
  241. m_ComboBox.AddString ("Å©Àú");
  242. }
  243. else if(nIndex==7)
  244. {
  245. m_ComboBox.AddString ("δ¿ªÊ¼");
  246. m_ComboBox.AddString ("½øÐÐÖÐ");
  247. m_ComboBox.AddString ("OK");
  248. }
  249. m_ComboBox.SetCurSel (m_ComboBox.FindString (0, strItem));
  250. m_ComboBox.SetCtrlData(MAKEWPARAM(nIndex,nItem));
  251. }
  252. else
  253. m_ComboBox.ShowWindow(SW_HIDE);
  254. }
  255. void CComboBoxListCtrl6::ShowComboBox3(BOOL bShow,int nItem,int nIndex,CRect rcCtrl)
  256. {
  257. if(m_ComboBox2.m_hWnd == NULL)
  258. {
  259. m_ComboBox2.Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWN,CRect(0,0,0,0),this,IDC_ComboBox);
  260. m_ComboBox2.ShowWindow(SW_HIDE);
  261. m_ComboBox2.AddString ("09:00");
  262. m_ComboBox2.AddString ("10:00");
  263. m_ComboBox2.AddString ("11:00");
  264. m_ComboBox2.AddString ("12:00");
  265. m_ComboBox2.AddString ("13:00");
  266. m_ComboBox2.AddString ("14:00");
  267. m_ComboBox2.AddString ("15:00");
  268. m_ComboBox2.AddString ("16:00");
  269. m_ComboBox2.AddString ("17:00");
  270. m_ComboBox2.AddString ("18:00");
  271. m_ComboBox2.AddString ("19:00");
  272. m_ComboBox2.AddString ("20:00");
  273. m_ComboBox2.AddString ("21:00");
  274. m_ComboBox2.AddString ("22:00");
  275. }
  276. if(bShow == TRUE)
  277. {
  278. CString strItem = CListCtrl::GetItemText(nItem,nIndex);
  279. m_ComboBox2.MoveWindow(rcCtrl);
  280. m_ComboBox2.ShowWindow(SW_SHOW);
  281. ::SetFocus(m_ComboBox2.GetSafeHwnd());
  282. // m_ComboBox2.SetCurSel (m_ComboBox2.FindString (0, strItem));
  283. m_ComboBox2.SetWindowText ( strItem );
  284. m_ComboBox2.SetCtrlData(MAKEWPARAM(nIndex,nItem));
  285. }
  286. else
  287. m_ComboBox2.ShowWindow(SW_HIDE);
  288. }
  289. void CComboBoxListCtrl6::ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rcCtrl)
  290. {
  291. if(0)//m_pComboBox->m_hWnd == NULL)
  292. {
  293. m_pComboBox->Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWNLIST,CRect(0,0,0,0),this,IDC_ComboBox);
  294. m_pComboBox->ShowWindow(SW_HIDE);
  295. for(int i=0; i<g_List1array.GetSize (); i++)
  296. m_pComboBox->AddString (g_List1array.ElementAt (i).ElementAt (0));
  297. m_pComboBox->AddString ("");
  298. }
  299. if(bShow == TRUE)
  300. {
  301. CString strItem = CListCtrl::GetItemText(nItem,nIndex);
  302. ClientToScreen(rcCtrl);
  303. GetParent()->ScreenToClient(rcCtrl);
  304. m_pComboBox->MoveWindow(rcCtrl);
  305. m_pComboBox->ShowWindow(SW_SHOW);
  306. m_pComboBox->SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
  307. ::SetFocus(m_pComboBox->GetSafeHwnd());
  308. m_pComboBox->ResetContent();
  309. m_pComboBox->AddString(strItem);
  310. m_pComboBox->SetCurSel (0);
  311. m_pComboBox->SetCtrlData(MAKEWPARAM(nIndex,nItem));
  312. m_pComboBox->RefDroppedWidth();
  313. }
  314. else
  315. m_pComboBox->ShowWindow(SW_HIDE);
  316. }
  317. void CComboBoxListCtrl6::OnEditEnd(WPARAM wParam,LPARAM lParam)
  318. {
  319. if(wParam == TRUE)
  320. {
  321. CString strText(_T(""));
  322. m_edit.GetWindowText(strText);
  323. DWORD dwData = m_edit.GetCtrlData();
  324. int nItem= dwData>>16;
  325. int nIndex = dwData&0x0000ffff;
  326. CListCtrl::SetItemText(nItem,nIndex,strText);
  327. }
  328. else
  329. {
  330. }
  331. if(lParam == FALSE)
  332. m_edit.ShowWindow(SW_HIDE);
  333. }
  334. void CComboBoxListCtrl6::OnComboBoxEnd(WPARAM wParam,LPARAM lParam)
  335. {
  336. if(m_DateCtrl.m_hWnd)
  337. {
  338. if(m_DateCtrl.IsWindowVisible ())
  339. {
  340. if(wParam == TRUE)
  341. {
  342. CString strText(_T(""));
  343. CTime tm;
  344. m_DateCtrl.GetTime(tm);
  345. strText=tm.Format ("%Y-%m-%d");
  346. CListCtrl::SetItemText(m_nItem,m_nSub,strText);
  347. }
  348. if(lParam == FALSE)
  349. m_DateCtrl.ShowWindow(SW_HIDE);
  350. return;
  351. }
  352. }
  353. if(m_ComboBox.m_hWnd)
  354. {
  355. if(m_ComboBox.IsWindowVisible ())
  356. {
  357. if(wParam == TRUE)
  358. {
  359. CString strText(_T(""));
  360. int pos=m_ComboBox.GetCurSel ();
  361. if(pos!=-1)
  362. {
  363. m_ComboBox.GetLBText (pos, strText);
  364. DWORD dwData = m_ComboBox.GetCtrlData();
  365. int nItem= dwData>>16;
  366. int nIndex = dwData&0x0000ffff;
  367. CListCtrl::SetItemText(nItem,nIndex,strText);
  368. }
  369. }
  370. else
  371. {
  372. }
  373. if(lParam == FALSE)
  374. m_ComboBox.ShowWindow(SW_HIDE);
  375. return;
  376. }
  377. }
  378. if(m_ComboBox2.m_hWnd)
  379. {
  380. if(m_ComboBox2.IsWindowVisible ())
  381. {
  382. if(wParam == TRUE)
  383. {
  384. CString strText(_T(""));
  385. /* int pos=m_ComboBox2.GetCurSel ();
  386. if(pos!=-1)
  387. {
  388. m_ComboBox2.GetLBText (pos, strText);*/
  389. m_ComboBox2.GetWindowText ( strText);
  390. DWORD dwData = m_ComboBox2.GetCtrlData();
  391. int nItem= dwData>>16;
  392. int nIndex = dwData&0x0000ffff;
  393. CListCtrl::SetItemText(nItem,nIndex,strText);
  394. // }
  395. }
  396. else
  397. {
  398. }
  399. if(lParam == FALSE)
  400. m_ComboBox2.ShowWindow(SW_HIDE);
  401. return;
  402. }
  403. }
  404. if(m_pComboBox->m_hWnd)
  405. {
  406. if(!m_pComboBox->IsWindowVisible ())return;
  407. if(wParam == TRUE)
  408. {
  409. CString strText(_T(""));
  410. int pos=m_pComboBox->GetCurSel ();
  411. if(pos!=-1)
  412. {
  413. m_pComboBox->GetLBText (pos, strText);
  414. DWORD dwData = m_pComboBox->GetCtrlData();
  415. int nItem= dwData>>16;
  416. int nIndex = dwData&0x0000ffff;
  417. CListCtrl::SetItemText(nItem,nIndex,strText);
  418. }
  419. }
  420. else
  421. {
  422. }
  423. if(lParam == FALSE)
  424. m_pComboBox->ShowWindow(SW_HIDE);
  425. }
  426. }
  427. void CComboBoxListCtrl6::OnParentNotify(UINT message, LPARAM lParam)
  428. {
  429. CListCtrl::OnParentNotify(message, lParam);
  430. //////////////////////////////////////////////////////////////////////////
  431. CHeaderCtrl* pHeaderCtrl = CListCtrl::GetHeaderCtrl();
  432. if(pHeaderCtrl == NULL)
  433. return;
  434. CRect rcHeader;
  435. pHeaderCtrl->GetWindowRect(rcHeader);
  436. ScreenToClient(rcHeader);
  437. //The x coordinate is in the low-order word and the y coordinate is in the high-order word.
  438. CPoint pt;
  439. pt.x = GET_X_LPARAM(lParam);
  440. pt.y = GET_Y_LPARAM(lParam);
  441. if(rcHeader.PtInRect(pt) && message == WM_LBUTTONDOWN)
  442. {
  443. if(m_pComboBox->m_hWnd != NULL)
  444. {
  445. DWORD dwStyle = m_pComboBox->GetStyle();
  446. if((dwStyle&WS_VISIBLE) == WS_VISIBLE)
  447. {
  448. m_pComboBox->ShowWindow(SW_HIDE);
  449. }
  450. }
  451. if(m_DateCtrl.m_hWnd)
  452. {
  453. if(m_DateCtrl.IsWindowVisible ())m_DateCtrl.ShowWindow(SW_HIDE);
  454. }
  455. }
  456. }
  457. BOOL CComboBoxListCtrl6::PreTranslateMessage(MSG* pMsg)
  458. {
  459. /* if(pMsg->message == WM_LBUTTONUP)
  460. {
  461. if(m_DateCtrl.m_hWnd)
  462. {
  463. if(m_DateCtrl.IsWindowVisible ())
  464. {
  465. ::PostMessage(this->GetSafeHwnd(),WM_USER_ComboBox_END,1,0);
  466. m_DateCtrl.ShowWindow(SW_HIDE);
  467. }
  468. }
  469. }*/
  470. return CListCtrl::PreTranslateMessage(pMsg);
  471. }
  472. BOOL CComboBoxListCtrl6::Key_Shift(int& nItem,int& nSub)
  473. {
  474. int nItemCount = CListCtrl::GetItemCount();
  475. DWORD dwData = m_pComboBox->GetCtrlData();
  476. nItem= dwData>>16;
  477. nSub = dwData&0x0000ffff;
  478. CHeaderCtrl* pHeader = CListCtrl::GetHeaderCtrl();
  479. if(pHeader == NULL)
  480. return FALSE;
  481. short sRet = GetKeyState(VK_SHIFT);
  482. int nSubcCount = pHeader->GetItemCount();
  483. sRet = sRet >>15;
  484. if(sRet == 0)
  485. {
  486. nSub += 1;
  487. if(nSub >= nSubcCount)
  488. {
  489. if(nItem == nItemCount-1)
  490. {
  491. nItem = 0;
  492. nSub = 0;
  493. }
  494. else
  495. {
  496. nSub = 0;
  497. nItem += 1;
  498. }
  499. }
  500. if(nItem >= nItemCount)
  501. nItem = nItemCount-1;
  502. return FALSE;
  503. }
  504. else
  505. {
  506. nSub -= 1;
  507. if(nSub < 0)
  508. {
  509. nSub = nSubcCount -1;
  510. nItem --;
  511. }
  512. if(nItem < 0)
  513. nItem = nItemCount-1;
  514. return TRUE;
  515. }
  516. return FALSE;
  517. }
  518. BOOL CComboBoxListCtrl6::Key_Ctrl(int& nItem,int &nSub)
  519. {
  520. short sRet = GetKeyState(VK_CONTROL);
  521. DWORD dwData = m_pComboBox->GetCtrlData();
  522. nItem= dwData>>16;
  523. nSub = dwData&0x0000ffff;
  524. sRet = sRet >>15;
  525. int nItemCount = CListCtrl::GetItemCount();
  526. if(sRet == 0)
  527. {
  528. }
  529. else
  530. {
  531. nItem = nItem >=nItemCount-1? 0:nItem+=1;
  532. return TRUE;
  533. }
  534. return FALSE;
  535. }
  536. void CComboBoxListCtrl6::InitStyle()
  537. {
  538. SetFont (&g_listctrlfont);
  539. SetExtendedStyle(LVS_EX_FLATSB|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);
  540. }
  541. #undef SubclassWindow
  542. void CComboBoxListCtrl6::PreSubclassWindow()
  543. {
  544. // the list control must have the report style.
  545. CListCtrl::PreSubclassWindow();
  546. m_ctlHeader.SubclassWindow ( GetHeaderCtrl()->GetSafeHwnd());
  547. }