ComboListCtrl6.cpp 14 KB

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