| 479 | } |
| 480 | |
| 481 | void TabControl::_insertItem(size_t _index, const UString& _name, TabItem* _sheet, Any _data) |
| 482 | { |
| 483 | if (_index == ITEM_NONE) |
| 484 | _index = mItemsInfo.size(); |
| 485 | |
| 486 | // добавляем инфу о вкладке |
| 487 | int width = (mButtonAutoWidth ? _getTextWidth(_name) : mButtonDefaultWidth); |
| 488 | mWidthBar += width; |
| 489 | |
| 490 | mItemsInfo.insert(mItemsInfo.begin() + _index, TabItemInfo(width, _name, _sheet, _data)); |
| 491 | |
| 492 | // первая вкладка |
| 493 | if (1 == mItemsInfo.size()) |
| 494 | mIndexSelect = 0; |
| 495 | else |
| 496 | { |
| 497 | _sheet->setVisible(false); |
| 498 | if (_index <= mIndexSelect) |
| 499 | mIndexSelect++; |
| 500 | } |
| 501 | |
| 502 | updateBar(); |
| 503 | } |
| 504 | |
| 505 | void TabControl::setItemDataAt(size_t _index, Any _data) |
| 506 | { |
nothing calls this directly
no test coverage detected