| 86 | } |
| 87 | |
| 88 | void CGrListBox::SelectItem(int item) { |
| 89 | // don't do a damn thing if the item selected equals the requested selected item |
| 90 | if (item != m_ItemSel) { |
| 91 | m_ItemSel = item; |
| 92 | OnItemSelected(item); |
| 93 | ListBoxProc(false); // update list box data but don't draw yet. |
| 94 | |
| 95 | // scroll window until item wanted is in view. |
| 96 | if (m_IsItemSelInBox == false) { |
| 97 | // SAMIR: fix this!! |
| 98 | int count = 0; |
| 99 | |
| 100 | while (m_ListItem < m_ItemSel && (++count < 100)) |
| 101 | if (RowDown(1, false)) |
| 102 | break; |
| 103 | |
| 104 | while (m_ListItem > m_ItemSel && (++count < 100)) |
| 105 | if (RowUp(1, false)) |
| 106 | break; |
| 107 | } |
| 108 | |
| 109 | CWnd::Invalidate(); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | void CGrListBox::SetItemFirst(int item) { m_ListItem = item; } |
| 114 |
no outgoing calls
no test coverage detected