* Replaces a certain amount of colors in the palette of all * the text contained in the list. * @param colors Pointer to the set of colors. * @param firstcolor Offset of the first color to replace. * @param ncolors Amount of colors to replace. */
| 376 | * @param ncolors Amount of colors to replace. |
| 377 | */ |
| 378 | void TextList::setPalette(SDL_Color *colors, int firstcolor, int ncolors) |
| 379 | { |
| 380 | Surface::setPalette(colors, firstcolor, ncolors); |
| 381 | for (std::vector< std::vector<Text*> >::iterator u = _texts.begin(); u < _texts.end(); ++u) |
| 382 | { |
| 383 | for (std::vector<Text*>::iterator v = u->begin(); v < u->end(); ++v) |
| 384 | { |
| 385 | (*v)->setPalette(colors, firstcolor, ncolors); |
| 386 | } |
| 387 | } |
| 388 | for (std::vector<ArrowButton*>::iterator i = _arrowLeft.begin(); i < _arrowLeft.end(); ++i) |
| 389 | { |
| 390 | (*i)->setPalette(colors, firstcolor, ncolors); |
| 391 | } |
| 392 | for (std::vector<ArrowButton*>::iterator i = _arrowRight.begin(); i < _arrowRight.end(); ++i) |
| 393 | { |
| 394 | (*i)->setPalette(colors, firstcolor, ncolors); |
| 395 | } |
| 396 | if (_selector != 0) |
| 397 | { |
| 398 | _selector->setPalette(colors, firstcolor, ncolors); |
| 399 | } |
| 400 | _up->setPalette(colors, firstcolor, ncolors); |
| 401 | _down->setPalette(colors, firstcolor, ncolors); |
| 402 | _scrollbar->setPalette(colors, firstcolor, ncolors); |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Changes the resources for the text in the list |