* @brief Set the TMenuItem slider position based on the given value */
| 375 | * @brief Set the TMenuItem slider position based on the given value |
| 376 | */ |
| 377 | void gmenu_slider_set(TMenuItem *pItem, int min, int max, int value) |
| 378 | { |
| 379 | int nSteps; |
| 380 | |
| 381 | /// ASSERT: assertassert(pItem, "gmenu.cpp", 445); |
| 382 | nSteps = (int)(pItem->dwFlags & 0xFFF000) >> 12; |
| 383 | if (nSteps < 2) |
| 384 | nSteps = 2; |
| 385 | pItem->dwFlags &= 0xFFFFF000; |
| 386 | pItem->dwFlags |= ((max - min - 1) / 2 + (value - min) * nSteps) / (max - min); |
| 387 | } |
| 388 | |
| 389 | /** |
| 390 | * @brief Get the current value for the slider |
no outgoing calls
no test coverage detected