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

Method SetPos

DuiLib/Control/UIList.cpp:230–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void CListUI::SetPos(RECT rc)
231{
232 CVerticalLayoutUI::SetPos(rc);
233 if( m_pHeader == NULL ) return;
234 // Determine general list information and the size of header columns
235 m_ListInfo.nColumns = MIN(m_pHeader->GetCount(), UILIST_MAX_COLUMNS);
236 // The header/columns may or may not be visible at runtime. In either case
237 // we should determine the correct dimensions...
238
239 if( !m_pHeader->IsVisible() ) {
240 for( int it = 0; it < m_pHeader->GetCount(); it++ ) {
241 static_cast<CControlUI*>(m_pHeader->GetItemAt(it))->SetInternVisible(true);
242 }
243 m_pHeader->SetPos(CDuiRect(rc.left, 0, rc.right, 0));
244 }
245 int iOffset = m_pList->GetScrollPos().cx;
246 for( int i = 0; i < m_ListInfo.nColumns; i++ ) {
247 CControlUI* pControl = static_cast<CControlUI*>(m_pHeader->GetItemAt(i));
248 if( !pControl->IsVisible() ) continue;
249 if( pControl->IsFloat() ) continue;
250
251 RECT rcPos = pControl->GetPos();
252 if( iOffset > 0 ) {
253 rcPos.left -= iOffset;
254 rcPos.right -= iOffset;
255 pControl->SetPos(rcPos);
256 }
257 m_ListInfo.rcColumn[i] = pControl->GetPos();
258 }
259 if( !m_pHeader->IsVisible() ) {
260 for( int it = 0; it < m_pHeader->GetCount(); it++ ) {
261 static_cast<CControlUI*>(m_pHeader->GetItemAt(it))->SetInternVisible(false);
262 }
263 }
264}
265
266void CListUI::DoEvent(TEventUI& event)
267{

Callers 3

SetScrollPosMethod · 0.45
PaintTextMethod · 0.45
HandleMessageMethod · 0.45

Calls 15

IsVisibleMethod · 0.80
IsFloatMethod · 0.80
GetFixedWidthMethod · 0.80
GetFixedHeightMethod · 0.80
GetMinHeightMethod · 0.80
GetMaxHeightMethod · 0.80
GetPaddingMethod · 0.80
GetMinWidthMethod · 0.80
GetMaxWidthMethod · 0.80
GetHeaderMethod · 0.80
SetScrollRangeMethod · 0.80
GetCountMethod · 0.45

Tested by

no test coverage detected