| 113 | } |
| 114 | |
| 115 | void DropdownList::CalculateWidth() |
| 116 | { |
| 117 | mMaxItemWidth = mWidth; |
| 118 | for (int i = 0; i < mElements.size(); ++i) |
| 119 | { |
| 120 | int width = GetStringWidth(mElements[i].mLabel) + (mDrawTriangle ? 15 : 3); |
| 121 | if (width > mMaxItemWidth) |
| 122 | mMaxItemWidth = width; |
| 123 | } |
| 124 | |
| 125 | if (mAutoCalculateWidth) |
| 126 | mWidth = MIN(mMaxItemWidth, 180); |
| 127 | } |
| 128 | |
| 129 | void DropdownList::SetWidth(int width) |
| 130 | { |
nothing calls this directly
no test coverage detected