Fixed currently selected driver index initialization in driverselect::onActivate and GfuiScrollListSetSelectedElement not visually selecting the element
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@1706 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 9884797b003813a0f4c12d3cb3741ef6ebabb439 Former-commit-id: e962b5000379217ca86c34e3595b4978c3ab54d1
This commit is contained in:
parent
a03ac6a89f
commit
53c89f0dd4
2 changed files with 11 additions and 10 deletions
|
@ -969,15 +969,15 @@ onActivate(void * /* dummy */)
|
|||
{
|
||||
if (ReloadValues) {
|
||||
|
||||
/* Load car/categories and players settings */
|
||||
GenCarsInfo();
|
||||
GenDrvList();
|
||||
/* Load car/categories and players settings */
|
||||
GenCarsInfo();
|
||||
GenDrvList();
|
||||
|
||||
/* Initialize current player and select it */
|
||||
CurrPlayer = PlayersInfo.begin();
|
||||
GfuiScrollListSetSelectedElement(ScrHandle, ScrollList, 0);
|
||||
}
|
||||
|
||||
//Set default player
|
||||
CurrPlayer = PlayersInfo.begin();
|
||||
|
||||
GfuiScrollListSetSelectedElement(ScrHandle,ScrollList,1);
|
||||
/* Display editable fields values */
|
||||
refreshEditVal();
|
||||
}
|
||||
|
|
|
@ -246,8 +246,7 @@ gfuiScrollListRemElt(tGfuiScrollList *scrollist, int index)
|
|||
@ingroup gui
|
||||
@param scr Current screen
|
||||
@param Id Scroll list Id
|
||||
@param userData address of the userData of the element to retrieve
|
||||
@return Name of the retrieved element
|
||||
@return selectElement Index of the element to select
|
||||
<br>NULL if Error
|
||||
*/
|
||||
bool
|
||||
|
@ -255,7 +254,6 @@ GfuiScrollListSetSelectedElement(void *scr, int Id, unsigned int selectElement)
|
|||
{
|
||||
tGfuiObject *object;
|
||||
tGfuiScrollList *scrollist;
|
||||
|
||||
|
||||
object = gfuiGetObject(scr, Id);
|
||||
if (object == NULL) {
|
||||
|
@ -271,6 +269,9 @@ GfuiScrollListSetSelectedElement(void *scr, int Id, unsigned int selectElement)
|
|||
|
||||
scrollist->selectedElt = selectElement;
|
||||
|
||||
if (scrollist->onSelect)
|
||||
scrollist->onSelect(scrollist->userDataOnSelect);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue