| 226 | } |
| 227 | |
| 228 | void UniformGrid::SetupRowDefinitions(uint32_t rows) |
| 229 | { |
| 230 | const auto definitions = RowDefinitions(); |
| 231 | |
| 232 | // Mark initial definitions so we don't erase them. |
| 233 | for (const auto &rd : definitions) |
| 234 | { |
| 235 | if (!GetAutoLayout(rd)) |
| 236 | { |
| 237 | SetAutoLayout(rd, false); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | // Remove non-autolayout rows we've added and then add them in the right spots. |
| 242 | if (rows != definitions.Size()) |
| 243 | { |
| 244 | for (int32_t r = definitions.Size() - 1; r >= 0; r--) |
| 245 | { |
| 246 | const auto layout = GetAutoLayout(definitions.GetAt(r)); |
| 247 | if (layout && layout.Value()) |
| 248 | { |
| 249 | definitions.RemoveAt(r); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | for (uint32_t r = definitions.Size(); r < rows; r++) |
| 254 | { |
| 255 | wux::Controls::RowDefinition rd; |
| 256 | SetAutoLayout(rd, true); |
| 257 | definitions.InsertAt(r, rd); |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | void UniformGrid::SetupColumnDefinitions(uint32_t columns) |
| 263 | { |
nothing calls this directly
no outgoing calls
no test coverage detected