MCPcopy Create free account
hub / github.com/SOUI2/soui / SetCurSel

Method SetCurSel

controls.extend/SListCtrlEx.cpp:138–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136 }
137
138 BOOL SListCtrlEx::SetCurSel(int iItem)
139 {
140 if(iItem>=GetItemCount()) return FALSE;
141 if(iItem < 0 ) iItem =-1;
142
143 if(m_iSelItem==iItem) return FALSE;
144 int nOldSel=m_iSelItem;
145 m_iSelItem=iItem;
146 if(nOldSel!=-1)
147 {
148 m_arrItems[nOldSel]->ModifyItemState(0,WndState_Check);
149 if(IsVisible(TRUE)) RedrawItem(nOldSel);
150 }
151 if(m_iSelItem!=-1)
152 {
153 m_arrItems[m_iSelItem]->ModifyItemState(WndState_Check,0);
154 if(IsVisible(TRUE)) RedrawItem(m_iSelItem);
155 }
156 return TRUE;
157 }
158
159 void SListCtrlEx::EnsureVisible( int iItem )
160 {

Callers 2

EvtHanderMethod · 0.45
OnInplaceActiveMethod · 0.45

Calls 2

ModifyItemStateMethod · 0.80
GetItemCountFunction · 0.50

Tested by

no test coverage detected