| 100 | } |
| 101 | |
| 102 | void RadioButton::UpdateDimensions() |
| 103 | { |
| 104 | if (mDirection == kRadioVertical) |
| 105 | { |
| 106 | for (int i = 0; i < mElements.size(); ++i) |
| 107 | { |
| 108 | int width = GetStringWidth(mElements[i].mLabel) + 5; |
| 109 | if (width > mWidth) |
| 110 | mWidth = width; |
| 111 | } |
| 112 | mHeight = radioSpacing * (int)mElements.size(); |
| 113 | mElementWidth = mWidth; |
| 114 | } |
| 115 | else |
| 116 | { |
| 117 | for (int i = 0; i < mElements.size(); ++i) |
| 118 | { |
| 119 | int width = GetStringWidth(mElements[i].mLabel) + 5; |
| 120 | if (width > mElementWidth) |
| 121 | mElementWidth = width; |
| 122 | } |
| 123 | mWidth = mElementWidth * (int)mElements.size(); |
| 124 | mHeight = radioSpacing; |
| 125 | } |
| 126 | |
| 127 | if (mForcedWidth != -1) |
| 128 | mWidth = mForcedWidth; |
| 129 | } |
| 130 | |
| 131 | void RadioButton::Clear() |
| 132 | { |
nothing calls this directly
no test coverage detected