MCPcopy Create free account
hub / github.com/cinience/RedisStudio / SelectItem

Method SelectItem

DuiLib/Layout/UITabLayout.cpp:98–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 bool CTabLayoutUI::SelectItem(int iIndex)
99 {
100 if( iIndex < 0 || iIndex >= m_items.GetSize() ) return false;
101 if( iIndex == m_iCurSel ) return true;
102
103 int iOldSel = m_iCurSel;
104 m_iCurSel = iIndex;
105 for( int it = 0; it < m_items.GetSize(); it++ )
106 {
107 if( it == iIndex ) {
108 GetItemAt(it)->SetVisible(true);
109 GetItemAt(it)->SetFocus();
110 SetPos(m_rcItem);
111 }
112 else GetItemAt(it)->SetVisible(false);
113 }
114 NeedParentUpdate();
115
116 if( m_pManager != NULL ) {
117 m_pManager->SetNextTabControl();
118 m_pManager->SendNotify(this, DUI_MSGTYPE_TABSELECT, m_iCurSel, iOldSel);
119 }
120 return true;
121 }
122
123 bool CTabLayoutUI::SelectItem( CControlUI* pControl )
124 {

Callers

nothing calls this directly

Calls 5

SetNextTabControlMethod · 0.80
SendNotifyMethod · 0.80
GetSizeMethod · 0.45
SetVisibleMethod · 0.45
SetFocusMethod · 0.45

Tested by

no test coverage detected