virtual void OnDraw(CUIDragItem* drag_item) { Fvector2 pos = drag_item->GetWndPos(); Fvector2 icon_sz = m_icon.GetWndSize(); Fvector2 drag_sz = drag_item->GetWndSize(); pos.x -= icon_sz.x; pos.y += drag_sz.y; m_icon.SetWndPos(pos); // m_icon.SetWndSize(sz); m_icon.Draw(); }
void RearrangeTabButtons(CUITabControl* pTab, xr_vector<Fvector2>& vec_sign_places) { TABS_VECTOR * btn_vec = pTab->GetButtonsVector(); TABS_VECTOR::iterator it = btn_vec->begin(); TABS_VECTOR::iterator it_e = btn_vec->end(); vec_sign_places.clear (); vec_sign_places.resize (btn_vec->size()); Fvector2 pos; pos.set ((*it)->GetWndPos()); Fvector2 sign_sz; sign_sz.set (9.0f+3.0f, 11.0f); u32 idx = 0; float btn_text_len = 0.0f; CUIStatic* st = NULL; for(;it!=it_e;++it,++idx) { if(idx!=0) { st = xr_new<CUIStatic>(); st->SetAutoDelete(true);pTab->AttachChild(st); st->SetFont((*it)->GetFont()); st->SetTextColor (color_rgba(90,90,90,255)); st->SetText("//"); st->SetWndSize ((*it)->GetWndSize()); st->AdjustWidthToText(); st->SetWndPos (pos); pos.x += st->GetWndSize().x; } vec_sign_places[idx].set(pos); vec_sign_places[idx].y += iFloor(((*it)->GetWndSize().y - sign_sz.y)/2.0f); vec_sign_places[idx].y = (float)iFloor(vec_sign_places[idx].y); pos.x += sign_sz.x; (*it)->SetWndPos (pos); (*it)->AdjustWidthToText(); btn_text_len = (*it)->GetWndSize().x; pos.x += btn_text_len+3.0f; } }